Commit graph

57 commits

Author SHA1 Message Date
Mike Noe
af0babd8fa smsapp/qml: Remove unneeded imports 2024-03-13 07:39:26 -04:00
Nicolas Fella
37ff0b5318 [app] Remove QML import versions
Those are not needed in Qt6 and only get in the way
2023-12-25 15:56:13 +00:00
Alexander Lohnau
ebfabd7c14 Port smsapp to Qt6
See https://invent.kde.org/libraries/kirigami-addons/-/issues/9 for the Avatar change
This app is now Qt6-only, but the rest of kdeconnect still works with Qt5. This is only a runtime dependency
2023-11-16 18:15:04 +00:00
Simon Redman
5b716dde02 [SMS App] Fix loading more messages
## Summary

For awhile (since at least early last year), it has not been possible to scroll past the first screen of message history. I believe this was due to a version bump in some library, but I was not able to biset it at the time.

This changes how messages are loaded to work again. I like this solution better anyway, because it means one can smoothly scroll back in time without needing to stop every time you reach the top of the history.

BUG: 452946

## Test Plan

### Before:
Scrolling to the top of the kdeconnect-sms history would do nothing. You could only view the first handful of messages in the conversation (whichever messages the app decided to load for you when you first open the conversation).

### After:
Scrolling to the top of the list of messages will cause the app to load more, allowing you to view more history of messages.
2023-01-22 22:10:46 +00:00
Nicolas Fella
8523fc0f86 [smsapp] Simplify device handling
The current device id is de-facto a global value

Store it in a singleton instead of passing it between our components
2022-05-31 16:50:53 +00:00
Nicolas Fella
8010739a8a [smsapp] Refactor and fix argument handling
Use a singleton instead of context properties for data handling

Fix passing initial message

Make device menu creation more declarative

Fix initial device handling

Update current device when new instance with initial device is requested
2022-05-23 22:10:07 +00:00
Bharadwaj Raju (away; can't respond)
fc83fb32e9 smsapp: Assorted UI improvements
- Move the device combobox to the global drawer
- Move search field and new button to header
- Use Kirigami SearchField instead
- Don't switch focus away from search field when typing
- Give the New button an icon
- Clarify the search field text
- Center messages view loading indicator
- Make send and attach buttons stick to bottom of text area
- Make cursor an I-beam when hovering over text area
- Move send button to the right
- Give proper padding to messages view top
- Move refresh action to global drawer
- Show refresh button directly in loading message where it is most useful

| Before | After |
| ------ | ------ |
| ![kdeconnectsms-old1](/uploads/469fa5f198ce81f1f53e8aa73694a824/kdeconnectsms-old1.png) | ![kdeconnectsms-new1](/uploads/c3b2b552d5d1bb73c566c6879c5b2a3c/kdeconnectsms-new1.png) |
| ![kdeconnectsms-old2](/uploads/eed795529946ed9ff856d8599bc66fb2/kdeconnectsms-old2.png) | ![kdeconnectsms-new2](/uploads/7abff93670aaea36052f3e3bfe01da62/kdeconnectsms-new2.png) |
| ![kdeconnectsms-old3](/uploads/f24dc7a902e33a1317cc8d9b90c39482/kdeconnectsms-old3.png) | ![kdeconnectsms-new3](/uploads/ea7d07f64d1904757dce56e86f1876ba/kdeconnectsms-new3.png) |

cc @teams/usability @teams/vdg
2022-02-09 03:47:36 +00:00
Aniket Kumar
706fc314fb Adding support to send attachments to the remote device. 2020-08-31 15:35:25 +05:30
Nicolas Fella
87db95b22f Convert license headers to SPDX expressions 2020-08-17 09:48:10 +00:00
Aniket Kumar
0b3d6bee85 Implementing Attachment class and adding support to display the thumbnails of attachments in QML. 2020-08-10 00:46:30 +05:30
Aniket Kumar
af8a5bc49b Enabled seding of multi-target messages in SMS app. 2020-07-08 14:23:13 +05:30
Aniket Kumar
0cee486a62 Fixed the wrapMode property value of TextArea from non existing TextArea.wrap to TextEdit.Wrap. 2020-07-08 14:15:30 +05:30
Ashvin Nihalani
74c6b71e04 UI Improvements
Removed Clutter Single Party Conversation
Added Name ti Multiparty
Changed Default Icon in Conversation List
2020-07-05 12:51:01 +00:00
Nicolas Fella
166a88072b [smsapp] Rework message items
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
2020-07-01 19:15:45 +00:00
Aniket Kumar
d0367f11fb Removing earlier hack to pass an address as a string instead of ConversationAdress type. 2020-05-18 08:11:26 +05:30
Simon Redman
b8aab3407a [SMS App] Sms helper improvements 2020-05-09 16:50:08 +00:00
Jiří Wolker
2ef5cd4551 [SMS App] Make SMS message field scrollable
## 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)
2020-04-23 17:24:51 -07:00
Jiří Wolker
6abe790aa4 [SMS App] Make SMS character counter width only grow
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.
2020-04-23 17:19:15 -07:00
Jiří Wolker
365791dc59 Show remaining character count in SMS app
## 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
2020-03-22 18:47:12 +00:00
Aniket Kumar
f211d7e401 Add feature to start new conversation with existing contacts
## 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.
2020-03-21 22:57:28 +00:00
Yuri Chornoivan
01c4d0411b Fix minor EBN issues 2019-12-22 09:49:55 +02:00
Yuri Chornoivan
f84b3c8c11 Fix localization of app and smsapp. Patch mainly by Victor Ryzhykh. 2019-12-21 09:59:36 +02:00
Simon Redman
2e04adf99c Fix never-ending loading by adding a new signal indicating the SMS plugin has received a reply (so is presumably done loading)
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
2019-07-29 22:12:37 +02:00
Simon Redman
91765a354d Update ConversationMessage.qml to latest version used in Kaidan 2019-07-27 10:02:24 +00:00
Simon Redman
8d939e130f ## Summary: Add a spinning loading indicator while waiting to get messages from the phone
## Test Plan
- Open SMS conversation
- See nice spinner
2019-07-21 17:27:08 +00:00
Simon Redman
19025fb287 Make the sms app load the proper number of messages to fill the initial screen and make it instantly show the most-recent message 2019-07-21 13:17:41 +02:00
Simon Redman
edee0e0e9d [SMS App] Handle addresses for multitarget messages
## 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)
2019-07-19 17:33:15 +00:00
Simon Redman
ee9547ed89 [SMS App] Basic plain-text MMS support
## 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
2019-07-19 15:29:28 +00:00
Nicolas Fella
3b8fedea1a Replace http GNU urls with https 2019-03-23 17:29:26 +01:00
Simon Redman
a922ca570d Use Shift+Enter instead of Ctrl+Enter to add newline to in-progress SMS message 2019-03-18 16:13:54 -06:00
Simon Redman
5cac399273 Fix bug causing smsapp's '--message' argument to not pass data through 2019-03-18 15:56:01 -06:00
Simon Redman
0bf02481a6 Properly disable new message-entry area when device is disconnected 2019-03-09 17:16:43 -07:00
Nicolas Fella
906cdfba64 Use input field from Kaidan
Summary: It looks a bit better

Test Plan: {F6314845}

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, sredman, mart, hein, apol, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16071
2019-03-10 00:36:18 +01:00
Nicolas Fella
fd99d84ead [SMS App] Allow passing a message via args
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
2019-03-09 22:44:28 +01:00
Simon Redman
3b92b0de1d Add dependency on kirigami to SMS app
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
2019-01-24 10:39:54 -07:00
Simon Redman
a14b39d541 [SMS App] Make sms app not crash when conversation is selected with no devices connected
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
2019-01-22 18:55:27 -07:00
Simon Redman
657dede4bf Add contributors to smsapp QML files 2018-12-15 17:26:44 -07:00
Simon Redman
2c35c1af51 [SMS App] Allow scrolling up to load and display older messages
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
2018-12-12 22:50:50 -07:00
Simon Redman
019e8d6a1c [SMS App] Make requestMoreMessages asynchronous, blocking, and caching
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
2018-12-12 22:42:56 -07:00
Billy Laws
c6fc4d92b7 Make the message TextField expanding, wrapping and scrollable
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
2018-11-29 18:02:42 +00:00
Simon Redman
e9d5c9e27e Revert "Replace tabs with spaces in messaging app"
This reverts commit 6657dff8cf.
2018-10-30 14:01:13 -06:00
Simon Redman
6657dff8cf Replace tabs with spaces in messaging app 2018-10-30 13:58:50 -06:00
Albert Vaca
1e9a1f93ed Fix license header for smsapp 2018-10-11 22:52:42 +02:00
Nicolas Fella
8bfe093939 Don't show phonenumber if name is available
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
2018-10-08 20:37:49 +02:00
Nicolas Fella
45e966c290 Fix person name displaying in ConversationDisplay
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
2018-10-08 20:36:35 +02:00
Simon Redman
d742684d21 Set view to track new elements as they are added
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
2018-09-16 15:52:44 -06:00
Nicolas Fella
5f63f78f77 Show new messages on the bottom
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
2018-08-06 00:22:18 +02:00
Nicolas Fella
21b52d7dcf Refine SMS conversation view
Summary: Use components from Kaidan messenger

Reviewers: #kde_connect, sredman

Reviewed By: #kde_connect, sredman

Subscribers: sredman, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D14635
2018-08-06 00:09:46 +02:00
Nicolas Fella
367f2e08a9 Clear SMS input field on send 2018-08-04 21:13:09 +02:00
Aleix Pol
31e93ef7bf (WIP) Upgrade Telephony plugin to read SMS history (KDE side)
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
2018-06-09 13:35:26 -06:00