Commit graph

32 commits

Author SHA1 Message Date
Albert Astals Cid
9faa049c55 Make clang-format happy 2024-06-04 19:02:58 +02:00
Aleix Pol
a0d93fa537 Make sure we are not using deprecated APIs
Bumps the deprecation values in line with the APIs we depend on.
2024-04-27 17:47:29 +02:00
Albert Astals Cid
6fe9a4354e Make clang-format happy 2024-03-27 19:22:02 +01:00
Alexander Lohnau
2e67f95017 Add explicit moc includes to cpp files
The rationale is explained in https://planet.kde.org/friedrich-kossebau-2023-06-28-include-also-moc-files-of-headers/

In case of KDEConnect, it impressively speeds up compilation. Before it
took 390 seconds on a clean build and with this change it took 330 seconds.
This is due to the mocs_compilation having to include the header files
and thus all their headers. Due to the lots of small plugins we have,
this means that the same headers must be compiled plenty of times.
When we include the moc files directly in the C++ file, they are already
available.
2023-07-30 07:27:45 +00:00
Nicolas Fella
a918ffc0cb Add and make use of ECM's clang-format integration 2022-09-11 23:21:58 +00:00
Simon Redman
9ab80593e8 [SMS App] Use interface for querying a range of messages
## Summary
This patch adds an interface to return only a specified window of messages, making loading the conversations history smooth, fast, and enjoyable.

The current implementation of the conversation interface loads all messages every time the conversation is requested. This is might be painfully slow to load in case the conversation is large or if there are a lot of MMS/RCS messages in the conversation (since those are wildly slower to load than SMS)

Requires https://invent.kde.org/kde/kdeconnect-android/merge_requests/122 to enable Android functionality

## Test Plan

 - With new Android app and old Desktop app:
   - The Android app will notice the missing fields and query for all messages as before.
 - With old Android app and new Desktop app:
   - The desktop will send fields for the new interface which will not be read and all messages will be returned.
 - With new Android app and new Desktop app:
   - The new interface is used and returns only a certain number of messages at a time.
2020-11-02 16:40:58 +00:00
Nicolas Fella
5ff1a2f488 Remove unused member 2020-10-18 18:00:53 +02:00
Aniket Kumar
706fc314fb Adding support to send attachments to the remote device. 2020-08-31 15:35:25 +05:30
Aniket Kumar
e368dd4ab5 Implementing support to request and receive original attachment file from the remote device. 2020-08-23 17:43:22 +05:30
Nicolas Fella
87db95b22f Convert license headers to SPDX expressions 2020-08-17 09:48:10 +00:00
Nicolas Fella
8f41be36dc Remove unneeded destructor/copy constructor/copy assignment operator
We don't have a custom destructor and the copy ctor/assignment operator don't do anything special, so the default one will do the right thing.

This is in accordance with the rule of zero (https://cpppatterns.com/patterns/rule-of-zero.html)
2020-07-29 17:30:29 +02:00
Nicolas Fella
1bd59787e2 [sms] Change address type in DBus API from variant to variantlist
While mostly theoretical it makes for a more expressive API since it communicates that it is a list instead of a single value. It also allows to get rid of some conversion code.

This is also preparation work for potentially using the custom type capabilities that QtDBus offers.
2020-07-29 15:18:19 +00:00
Aniket Kumar
af8a5bc49b Enabled seding of multi-target messages in SMS app. 2020-07-08 14:23:13 +05:30
Antonio Larrosa
1d36164230 Use ecm_qt_declare_logging_category to declare the logging categories
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.
2020-05-26 18:55:47 +02: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
Abdel-Rahman Abdel-Rahman
d3062cafd4 Receive SMS subscription ID and reply using it
This interprets the "sub_id" field to use it later for replying in
order to reply to SMS messages from the same SIM.
2020-04-07 20:01:18 +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
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
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
Nicolas Fella
c18c7b27f1 Add sanity check to dbus-exposed requestConversation() 2019-05-01 12:47:33 +00:00
Nicolas Fella
ad5428b054 Fix deviceTest 2019-05-01 12:46:02 +00:00
Simon Redman
362b0ba2e2 Move ConversationsDbusInterface pointer handling to ConversationsDbusInterface 2019-03-29 22:30:13 +00:00
Nicolas Fella
3b8fedea1a Replace http GNU urls with https 2019-03-23 17:29:26 +01:00
Albert Vaca Cintora
0ecf00822b Fixed warnings 2019-03-07 19:48:06 +01: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
9009439956 Handle case where more messages were requested but there were no more available from the remote
Previously, we would have a thread which was never woken. Now we wake the thread and it does its thing, even though we were not able to do anything about its request

Resolves https://bugs.kde.org/show_bug.cgi?id=400488
2018-12-14 09:59:42 -07:00
Simon Redman
7025fd6795 Un-break build. Apparently I didn't test as I thought I had. 2018-12-12 22:49:33 -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
Simon Redman
a7db3ab5e1 [Desktop] Update conversation list when a new message arrives
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
2018-10-07 21:46:39 -06:00
Simon Redman
563dde9891 Correct braces and add contributors
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
2018-10-06 21:59:15 -06:00
Simon Redman
23d931cb10 [Desktop] Allow SMS app to handle newly recieved messages
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
2018-09-16 16:20:45 -06:00
Simon Redman
bcc9fb06db Split SMS and Telephony plugin on desktop
Summary:
Telephony and SMS handling are quite distinct so they should be in separate plugins for better maintainability, given that @sredman has big plans with SMS.
This diff should be fully backwards compatible, but whether we really want to do that is up to discussion

Test Plan: Only supeficially tested. Receive an SMS (old way), Notification is shown

Reviewers: #kde_connect, sredman

Reviewed By: sredman

Subscribers: albertvaka, apol, sredman, kdeconnect, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D13594
2018-09-10 11:31:05 +02:00
Renamed from plugins/telephony/conversationsdbusinterface.cpp (Browse further)