Commit graph

84 commits

Author SHA1 Message Date
Rihards Skuja
60bf200723 smsapp: fix reference to undefined var in QML
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.
2020-05-30 02:50:13 +00:00
Aniket Kumar
fca66244ab improved sorting and filtering methods 2020-05-19 10:07:06 +05:30
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
Nicolas Fella
785f70c28f [smsapp] Fix starting new conversation 2020-05-12 01:05:38 +02:00
Simon Redman
b8aab3407a [SMS App] Sms helper improvements 2020-05-09 16:50:08 +00:00
Simon Redman
95a62f4fdb [SMS App] Convert tabs to 2 spaces in ChatMessage.qml
How did those get there?
2020-04-23 19:13:44 -07: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
Aniket Kumar
1ed998a9b3 some fixes 2020-04-23 02:31:28 +00:00
Aniket Kumar
97fea5e692 Apply suggestion to smsapp/qml/ConversationList.qml 2020-04-23 02:31:28 +00:00
Aniket Kumar
cd0259aba6 Added searching on both fields all the time and generalized check for address 2020-04-23 02:31:28 +00:00
Aniket Kumar
518f161b4f added message diaplay for no matched contacts 2020-04-23 02:31:28 +00:00
Aniket Kumar
b0cffea4a1 minor fix 2020-04-23 02:31:28 +00:00
Aniket Kumar
6827f31aa1 UI chnages and sorting/filtering chnages for multitarget converations 2020-04-23 02:31:28 +00:00
Aniket Kumar
9db5634a6c Made New button static in UI 2020-04-23 02:31:28 +00:00
Aniket Kumar
d7c93488a8 added new arbitrary contact feature 2020-04-23 02:31:28 +00:00
Aniket Kumar
d26cfd427f Feature to add arbitrray phone numbers 2020-04-23 02:31:28 +00: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
Simon Redman
751bca008c Add loading notice while loading conversations 2020-02-03 01:37:25 +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
Nicolas Fella
a47fbe7215 [smsapp] Move aboutpage action into global drawer/menu 2019-12-19 23:18:11 +01:00
Yuri Chornoivan
bef029b8f5 Add i18n() 2019-10-23 22:26:33 +03:00
Simon Redman
9c91042441 Add loading indicator while loading conversations 2019-08-24 10:29:44 -07: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
Aleix Pol
c17972881b sms: Added opening kdeconnect-sms on the plasmoid and indicator
Add a menu entry on the kdeconnect-indicator within devices' submenu that opens kdeconnect-sms.
Also add it in the plasmoid in the device delegate.
2019-07-21 18:30:41 +02:00
Simon Redman
bc468f1e07 Use proper theme setting for text colour 2019-07-21 16:42:16 +02: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
Matthijs Tijink
a5f55acf0e Don't interpret HTML in SMS messages 2019-07-21 11:05:40 +00:00
Aleix Pol
f256e32fb2 smsapp: add main contextual actions
Includes an about page and a refresh button for the conversations.
2019-07-21 12:55:25 +02:00
Aleix Pol
ed9e3028be sms: improve the conversation delegate
Keep the two elements (name and last message) separate so we can elide
the texts on the right.
2019-07-21 12:35:19 +02:00
Albert Vaca Cintora
2ca09a5ec1 Added a todo 2019-07-20 13:54:23 +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
037543e42b [SMS App] Improve "No devices available" warning
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
2019-03-18 15:59: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
8742dc5797 Fix doubly-nested ConversationDisplay which was causing messages to not be send-able
Bug introduced by commit 1ec20886a8

Something in my build system changed so I was testing the wrong build when merging before!
2019-03-08 15:09:13 -07:00
Simon Redman
1ec20886a8 [SMS App] Add highlighting to ConversationList view
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
2019-02-26 22:55:50 -07: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
5b213e6144 [SMS App] Improve filter
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
2018-12-17 09:25:56 -07:00
Simon Redman
657dede4bf Add contributors to smsapp QML files 2018-12-15 17:26:44 -07:00