## 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
Summary:
Make "No devices available" warning more obvious, add explaination
New warning:
{F6479206}
With mouseover explanation:
{F6479207}
Test Plan:
- Open app with remote device connected, everything behaves as normal
- Disconnect remote device, observe warning at top of dialogue
- Mouse over warning, be told what the situation means for your use of the app
- Note that, due to [[https://bugs.kde.org/show_bug.cgi?id=401587|bug 401587]], it is not actually possible to view cached content. That will be fixed eventually.
Reviewers: #kde_connect, apol
Reviewed By: #kde_connect, apol
Subscribers: apol, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D17616
Summary:
Add --message option to kdeconnect-sms to pass a message. The user only needs to choose a recepient and the message will be sent. Useful for integration with 3rd party
apps, e.g. via Purpose
Test Plan:
kdeconnect-sms --message "Hello World", choose chat, message is sent
Click another chat, no message sent
kdeconnect-sms without args, no message sent
Reviewers: #kde_connect, sredman
Reviewed By: #kde_connect, sredman
Subscribers: andyholmes, sredman, apol, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D17292
Summary: Let the ListView use its default highlighting (did I not notice before?) and keep the currently-selected chat highlighted at all times
Test Plan:
- Launch app
- Use mouse or arrow keys to select a conversation. The highlight should follow the selected conversation
Reviewers: #kde_connect, apol
Reviewed By: #kde_connect, apol
Subscribers: apol, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D17612
Summary:
Resolves Bug 401255
Bonus: Disable some very noisy debugging from the SMS app
Test Plan:
- Build KDE Connect with or without Kirigami
- Verify successful build with no complaints about Kirigami
- Build KDE Connect's Messenger:
- Without Kirigami: Verify that CMake warns that Kirigami is not found
- With Kirigami: Verify that app launches successfully
Reviewers: #kde_connect, nicolasfella
Reviewed By: #kde_connect, nicolasfella
Subscribers: apol, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D17572
Summary: This patch fixes T10184 and stops the SMS app from crashing when a conversation is selected but no devices are connected. It also allows the SMS app to access the cached messages in the ConversationsDbusInterface so the app is still slightly useful even when the device is disconnected.
Test Plan:
- Open sms app
- Open a few conversations
- Disconnect phone (Force close app?)
- Re-open a conversation which was previously opened
- Verify that the messages appear. It is possible to scroll up to view any older cached messages too!
- Open a conversation which was not opened previously
- Verify that a single messages is shown (since this was the only one in cache, from populating the list of all conversations)
- Verify that attempting to scroll this conversation does nothing, but also does not crash the app
Note: Opening the app with no phone connected will cause it to lose its handle on the deviceId, so it can't spawn a new Dbus interface, so it will remain blank and empty. Solving that is a project for another day.
Reviewers: #kde_connect
Reviewed By: #kde_connect
Subscribers: apol, nicolasfella, kdeconnect
Tags: #kde_connect
Maniphest Tasks: T10184
Differential Revision: https://phabricator.kde.org/D17634
Summary:
- Allow filter box to handle keystrokes passed to the ListView
- This is a little cheesy, but fixes T8341
- Pin filter box to always be visible
- Clear filter on Esc
Test Plan:
- Try typing a contact you would like to search for
- Before: Every time you type a new letter, the filter box would lose focus and you would have to click it to give it focus again
- Now: You can type smoothly
- Try scrolling the list
- Before: The filter box disappeared off the top of the screen
- Now: The filter box is always visible
- Try pressing escape
- Before: Nothing
- Now: Filter clears
- Bonus: When using the arrow keys to navigate, before the filter was manually handling those and the view would not loop. Now, the view loops if you try to select an item past the beginning or end (Easiest to see with highlighting from D17612)
Reviewers: #kde_connect, apol
Reviewed By: #kde_connect, apol
Subscribers: kdeconnect
Tags: #kde_connect
Maniphest Tasks: T8341
Differential Revision: https://phabricator.kde.org/D17614
Summary:
Scroll up to show older messages
Newly received messages will not force the view to the bottom unless the new message is being added "very close" to the visible area
Test Plan:
Message History:
- Open conversation
- Scroll/Drag up to load older messages
New Message:
- Open conversation
- Scroll to bottom
- Verify that a newly-received or newly-sent message is added to the GUI
- Scroll up
- Verify that sending/receiving a message does not disturb the view
- Scroll back to verify that the new message was indeed added to the list
Reviewers: #kde_connect, apol
Reviewed By: #kde_connect, apol
Subscribers: apol, nicolasfella, kdeconnect
Tags: #kde_connect
Maniphest Tasks: T9556
Differential Revision: https://phabricator.kde.org/D15979
Summary:
The most serious change from this patch is to move the asynchronous replying to a request from the app for more messages to a newly-spawned, self-destructing thread. Within that thread, we block until the remote device replies with the requested messages.
All gotten messages are cached in the ConversationDbusInterface, so all future requests are fast and don't hit the remote device.
Test Plan: After applying this diff, the messaging app should show 10 messages every time it is opened
Reviewers: #kde_connect, nicolasfella, albertvaka
Reviewed By: #kde_connect, albertvaka
Subscribers: albertvaka, apol, nicolasfella, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D16475
Summary:
A scrollbar will show if the entered text fills more than 1/3rd
of the screen, pressing enter will send the message and shift +
enter will add a new line.
Reviewers: #kde_connect, sredman
Reviewed By: #kde_connect, sredman
Subscribers: sredman, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D17224
Summary:
Whenever a ConversationMessage was constructed, a warning was printed saying "Both point size and pixel size set. Using pixel size." Stop double-setting the font size and the warnings stop
This may be system-specific because I don't see where we are setting the font's point size. I will test this on a few different systems (I haven't yet) and I hope others will test it on their system!
Note that this is easiest to test when applied on top of D15979 so you can scroll up to cause more messages to be constructed
Test Plan:
Before patch: Experience many warnings when using the SMS app
After patch: Experience fewer (0?) warnings when using the SMS app
Reviewers: #kde_connect, apol
Reviewed By: #kde_connect, apol
Subscribers: kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D16769
Summary: Move ColumnLayout containing text elements inside of the graphical bounding rectangle
Test Plan:
Pre patch:
- Launch messaging app
- Open conversation
- Notice huge spew of warnings like: "qrc:/qml/ChatMessage.qml:84:5: QML ColumnLayout: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead."
Post patch:
- Launch messaging app
- Open conversation
- No warnings about undefined behavior
Reviewers: apol
Reviewed By: apol
Subscribers: kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D16534
Summary:
Move the "No devices available" text in smsapp from combobox to the ConversationList.
P.S.
It's a GCI task.
Test Plan:
* Build and run smsapp
* Try pairing and unpairing the device
* See the difference
Reviewers: #kde_connect, sredman
Reviewed By: #kde_connect, sredman
Subscribers: sredman, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D16467
Summary:
Showing the number next to the name is neither pretty nor necessary IMHO.
My Android SMS app displays the number more subtle in an extra line below in gray. I could get behind something similar, but until this is implemented just don't show it
Depends on D16015
Reviewers: #kde_connect, sredman
Reviewed By: #kde_connect, sredman
Subscribers: sredman, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D16017
Summary: Don't ask my why this works this way
Test Plan: I see Name: phonenumber for contacts and just phonenumber for non-contacts now
Reviewers: #kde_connect, sredman
Reviewed By: #kde_connect, sredman
Subscribers: sredman, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D16015
Summary:
When a new message is delivered, the conversation list should update by changing the preview text and re-sorting the conversations
Bonus bug discovered and fixed: previously, when the conversations list was being populated, it made a request for the first message in every conversation. This would be fine if the conversationdbusinterface pulled from local cache. However, this actually triggers a request to the phone for *every* conversation.
This should be handled differently in conversationdbusinterface's requestConversation as well, but that's a project for a later day (TODO comments added)
Test Plan:
- Launch SMS app
- Verify conversations list appears
- Verify lack of massive stream of debug output indicating lots of messages for the wrong conversation are being received
- Verify that opening a particular conversation shows the messages after a short delay while the backend fetches the content from the phone
- Verify that receiving a new message into an existing conversation updates the conversation list
Reviewers: #kde_connect, nicolasfella
Reviewed By: #kde_connect, nicolasfella
Subscribers: nicolasfella, apol, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D15608
Summary: Improve contact matching by checking if the requested address ends with a candidate phone number, or vice-versa
Test Plan:
Check that *all* conversations which correspond to a contact are matched
- All of mine match. If someone finds one which doesn't, I will need the particulars...
Reviewers: #kde_connect, nicolasfella
Reviewed By: #kde_connect, nicolasfella
Subscribers: nicolasfella, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D15992
Summary: Braces to start a method are on a newline, braces to begin an in-method block are on the same line
Test Plan: Pure source code cosmetic changes. Hopefully no functionality has changed!
Reviewers: #kde_connect, nicolasfella
Reviewed By: #kde_connect, nicolasfella
Subscribers: apol, nicolasfella, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D15978
Summary:
Update sms app model to use new conversationUpdated signal
Filter incoming messages which belong to a different conversation than the one currently being viewed
See Android-side diff D15360 which adds support for sending live updates when a new message is sent or received
Test Plan:
This patch relies on D15360 for Android-side support
- Positive case:
- Open a conversation in the SMS app
- Receive a new message into that conversation (text yourself?)
- Verify that the new message appears at the bottom of the appropriate conversation
- Negative case:
- Open a conversation in the SMS app
- Receive a new message into a different conversation (text yourself?)
- Verify that the new message does *not* appear in the open conversation
Reviewers: #kde_connect, nicolasfella
Reviewed By: #kde_connect, nicolasfella
Subscribers: nicolasfella, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D15409
Summary: Set the currentIndex of the ConversationDisplay to show the newest messages by default, but stay where the user positioned it if viewing older messages
Test Plan:
Launch SMS App:
- Select conversation
- View should show the most recent messages
- Receive new message
- View should scroll to show the new message
- Scroll up to view older messages
- Receive new message
- View should continue to show older messages and not scroll to the bottom
Reviewers: nicolasfella
Reviewed By: nicolasfella
Subscribers: nicolasfella, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D15562
Summary: QSortFilterProxyModel filters based on a regex. When the user inserts regex special characters things go bad.
Reviewers: #kde_connect, apol
Reviewed By: #kde_connect, apol
Subscribers: apol, broulik, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D14642
Summary: Like every messaging app I know does
Test Plan: Compare message order with phone
Reviewers: #kde_connect, sredman
Reviewed By: #kde_connect, sredman
Subscribers: sredman, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D14638
Summary:
For real usecases of SMS support, we will almost always need access to the message history in some way
Specifically resolve T8338
Incidentally resolve T6651 since Telephony shall no longer create a notification
Test Plan:
Setup:
- Build corresponding Android-side diff (D11698)
- Build this diff
Step 1: Does anything at all work?
- Put a breakpoint in the handleBatchMessages method of the telephony plugin, ideally after constructing a Message object
- Use DBus to poke /modules/kdeconnect/devices/<deviceID>/telephony.requestAllConversations()
- Verify that the constructed Message is one you sent or received and that it is the most recent in the corresponding conversation
Step 2: DBus
- Open the Interface org.kde.kdeconnect.device.conversations of /modules/kdeconnect/devices/<deviceId>
- Poke activeConversations and verify an empty array is returned
- Poke requestAllConversationThreads
- Poke activeConversations and verify that a list of numbers has been returned. These are conversationIds
- Use a conversationId to call getFirstFromConversation
- Verify that the returned Message object is one which you recognize
- Note that if the message is an MMS it will be blank and meaningless. Try a different conversationId. MMS support "coming soon!"
Step 3: SMS App
- Use ccmake (or similar) to set SMSAPP_ENABLE to ON
- Build the project
- Run ./bin/kdeconnect-sms
- Verify that the app shows a list of everyone you have an SMS conversation with (MMS messages are stripped out)
- If you have the Contacts plugin working, verify that most contacts have their name and photo instead of their phone number
Reviewers: #kde_connect, nicolasfella, apol
Reviewed By: #kde_connect, nicolasfella, apol
Subscribers: andyholmes, apol, nicolasfella, #kde_connect
Tags: #kde_connect
Maniphest Tasks: T8338, T6651
Differential Revision: https://phabricator.kde.org/D11854
Creates a tiny messaging app that uses KPeople to query the contacts and
KDE connect telephony plugins to send plugins.
To be ready, still needs some work on the contacts sync side and some
messages history would be nice.