The current implementation seems to have an issue with an undetected binding loop that causes lockup. During investigation I figured that the code was way to complex and brittle for what we need.
This is a cleaner reimplementation. It also replaces the custom Avatar component with the one from Kirigami.
The looks are subject to tweaking of course
Launching smsapp prints:
qrc:/qml/main.qml:36: ReferenceError: _initialMessage is not defined
This patch applies the changes made to the property from C++ in
c17972881b to QML.
This automatizes the generation of logging categories so a
kdeconnect-kde.categories is generated and installed to
/usr/share/qlogging-categories5/ so kdebugsettings can use it.
Also, sets the default logging level to Warning. So now the logs
of users won't be filled with debug messages but they can
modify the configuration easily with kdebugsettings.
## Summary
This patch makes SMS message field scrollable and limits its height to ⅓
of window height (or ⅔ for smaller windows) so messages in conversation
are shown even when writing very long messages.
## Test Plan (and screenshots)
<small>These screenshots are in APNG and WEBP formats. Download them if
your browser does not support this format.</small>
### Before:
Message field height was not limited. Message field could be even higher
than window. That makes first lines of this field and messages in
conversation inaccessible.
![grab-noscroll.apng](/uploads/70a44ec3abd0e0707cf69f53ee832542/grab-noscroll.apng)
### After:
Message field height is limited to ⅓ or ⅔ of window height. When text
content reaches this threshold, scroll bars will show up.
![grab-scroll.webp](/uploads/489b9bb197a092f715bc2160acc7fd42/grab-scroll.webp)
SMS character counter was changing its width (both growing and
shrinking) so it also resized message field (and that caused text
reflow). This patch makes counter width only grow.
Type SMS that is long enough to make SMS character counter wider than
“Send” button. Remove the text (leave there 150 or 60 chars to keep it
visible). Character counter should keep its width.
Creating a QRegularExpression is quite expensive and we use the same expression for each run. Sharing it between the runs leads to a significant performance improvement.
## Summary
Currently `OurSortFilterProxyModel` class is implemented in the same file with `ConversationListModel` class, which would likely grow in the future.
This MR separates `OurSortFilterProxyModel` class into its own separate file renaming it to `ConversationsSortFilterProxyModel`
https://invent.kde.org/kde/kdeconnect-kde/-/merge_requests/229
## Summary
This adds character counter below the “Send” button in SMS conversation. It
uses format XXX/Y where XXX is number of characters that can be added
without splitting the SMS into multiple messages (see article
Concatenated SMS on Wikipedia). Y is number of messages in in current
concatenated SMS. The counter is not visible when insertion of 10 7-bit
or 16-bit (depends on SMS encoding) does not create concatenated SMS.
SMS encoding is automatically guessed. 8-bit encodings are not
supported. If the message contains characters that are not supported by GSM 7-bit
encoding, counter automatically switches to UCS-2.
## Test Plan
Try entering some text that is longer than 150 characters in [GSM 03.38 encoding][1] or 60 characters in UCS-2. Number of remaining characters should be visible below the “Send” button. The character counter should show `0` at exactly 160 or 70 characters. Inserting one character should switch the counter to [Concatenated SMS][2] mode when number of messages is shown.
It should show exactly same number as SMS app in Android.
## Screenshots
These images are in APNG.
![grab.apng](/uploads/21ae23f2fa75c7aca487e61ddce94644/grab.apng)
![grab-cz.apng](/uploads/785e670a8598c5a65a4209f17e75f578/grab-cz.apng)
[1]: https://en.wikipedia.org/w/index.php?oldid=932080074#GSM_7-bit_default_alphabet_and_extension_table_of_3GPP_TS_23.038_/_GSM_03.38
[2]: https://en.wikipedia.org/w/index.php?oldid=943185255#Message_size
## Summary
Start a conversation with contacts having no previous conversation with.
It is currently only possible to use the messaging app to send a message to a conversation which already exists.
This patch implements this feature by integrating all contacts having no prior conversation with the recent conversations in the recent conversation list and at the bottom in a sorted manner, something like this,
The contacts are stored in the recent conversation list model as a conversation but with INVALID conversation ID and INVALID conversation DATE.
## Testing
Testing just needs kdeconnect daemon to be recompiled and executed.
This may need to be reworked at some point for more advanced usecases (multiple apps listening to SMS, variable-length message requests, etc.) but it's fine for now
BUG 410095
## Summary
Upgrade the SMS App to handle multitarget addresses in the "addresses" field of a message and drop usage of the "address" field
Also note that this has all the commits from https://invent.kde.org/kde/kdeconnect-kde/merge_requests/97, but I will rebase those away once that patch is landed
Bonus: Image composition for multitarget conversations
## Test Plan
- Apply Android-side patch https://invent.kde.org/kde/kdeconnect-android/merge_requests/80
- Launch SMS App
- Notice that you can see all the recipients of multitarget messages. (Replying still not supported, but might get implemented as part of fixing replying to single-target messages)
## Summary
Desktop companion to https://invent.kde.org/kde/kdeconnect-android/merge_requests/78
Give desktop SMS app a basic understanding of the MMSes coming from Android:
- Show a fake body if we get an attachment we can't display (for now, any attachment)
- Display a fake contact header for multi-target messages since Android does not yet export multi-target address information
- Disable attempting to reply to multi-target messages
BUG: 398889
## Test Plan
### Before:
MMS messages were silently dropped, meaning:
- Group MMS conversations were not visible
- Single-target conversations with the most-recent message an MMS were not visible
### After:
- Install https://invent.kde.org/kde/kdeconnect-android/merge_requests/78
- Multi-target conversations are displayed (kind of ugly, since they have no contact information
- Single-target conversations which end with an MMS are displayed
- Plain-text MMS is displayed nicely
- MMS attachments don't show
- MMS which are only an attachment with no body are displayed with a dummy body