[SMS App] Allow passing a message via args
ClosedPublic

Authored by nicolasfella on Dec 2 2018, 1:02 AM.

Details

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

Diff Detail

Repository
R224 KDE Connect
Branch
arcpatch-D17292
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 6116
Build 6134: arc lint + arc unit
nicolasfella created this revision.Dec 2 2018, 1:02 AM
Restricted Application added a project: KDE Connect. · View Herald TranscriptDec 2 2018, 1:02 AM
Restricted Application added a subscriber: kdeconnect. · View Herald Transcript
nicolasfella requested review of this revision.Dec 2 2018, 1:02 AM
apol added a subscriber: apol.Dec 3 2018, 12:23 PM

Maybe instead of weirdly propagating an initial message it would make sense to have a sendMessage function?

sredman added a subscriber: sredman.Dec 6 2018, 9:11 PM

I like the idea! It is very slick

  • It works for me
  • I think the operation should be cancel-able, maybe with an 'X' button on the InlineMessage banner to the right of "Choose recipient"
  • I think it would be better to not auto-send the message, but just populate the text box and leaving the user to push "Send" as a kind of confirmation. I click wrong buttons all the time, I would like a chance to double-check, especially in this case where there is no undo and potentially real-money cost.
smsapp/qml/ConversationList.qml
37

Spelling mistake: "Choose recipient"

I think it would be better to not auto-send the message...

I'd second that as a good idea. We use a similar mechanism in GSConnect when sharing links from the browser extension, but also to support sms: scheme handlers which can have a "body" field. If you were ever to support sms: scheme handlers it could be a reasonable security risk.

  • Only fill in message field and make it cancellable

Maybe instead of weirdly propagating an initial message it would make sense to have a sendMessage function?

Not sure I understand you. Where would that function be and who would call it? The information on the initial message needs to be available to both the ConversationList (for the select chat message) and the conversation (to fill the input field)

  • Only fill in message field and make it cancellable

These work for me! I'll let you and Aleix figure out the other part; I'm happy with how it currently looks or with whatever Aleix is happy with.

Also don't forget to fix the spelling error I put in an inline comment in my first reply 😃

apol added a comment.Feb 8 2019, 10:40 PM

LGTM, please @sredman accept the patch.

sredman accepted this revision.Feb 9 2019, 4:27 PM

Reminder that there is a spelling error on line 37 of ConversationList.qml

This revision is now accepted and ready to land.Feb 9 2019, 4:27 PM
nicolasfella closed this revision.Mar 9 2019, 9:44 PM