Summary:
Fixes an error of extracting SpannableString as String (which resulted in notification text being null).
Fixes group conversation text extraction on API <28.
Also includes some minor refactoring.
Reviewers: nicolasfella
Reviewed By: nicolasfella
Subscribers: kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D22140
The lock should be kept between the point we read and the point we write
Also, no need to pass SMSPlugin as a parameter, since enclossed classes
already have access to its parent by default.
We had a list of names before, but it was outdated. Using a library gives
us an up-to-date list plus a fallback that fetches the name from the
internet if not in the list.
According to some information I stumbled across while working on a different issue, Samsung devices do not support the content provider I was using to populate the list of SMS conversations. This is very annoying, but nevertheless there appears to be a workaround.
BUG: 401677
Many users with Samsung devices have reported problems using the SMS plugin.
Hopefully this will fix the SMS plugin on Samsung devices.
## Summary
Not having support for MMS caused some minor problems, like in https://bugs.kde.org/show_bug.cgi?id=398889 . This patch adds basic MMS support for plain-text MMS, including multi-target messages.
Android companion to https://invent.kde.org/kde/kdeconnect-kde/merge_requests/97
Currently there are several rough areas:
- Multi-target messages do not have the full list of recipients (I am planning to work on this in another patch, because this one is already quite large enough)
- Parsing MMS is significantly slower than parsing SMS. This makes sense, since we need to make significantly many more content:// calls for MMS. The only solution I can think of here is to add the ability to request a range of messages, which I need to do anyway, but which should not be part of this patch.
- The desktop app is totally busted with regard to multi-target MMS, but that will also be fixed in another MR
BUG: 398889
## Test Plan
### Before:
Open SMS app on desktop, scroll through conversations, notice:
- Any single-target message which had the most-recent message as an MMS does not appear
- Any multi-target MMS conversations do not appear
### After:
Open SMS app on desktop, notice:
- Conversations which have an MMS as their most-recent message appear
- MMS which consisted of only text are rendered correctly
- Multi-target conversations are shown (though pretty busted, as said before. Do not attempt to reply to one!)