- We do not need the return type. If a plugin declares it can handle the
packet it should do so. We don't have any fallback logic in place and
the packet types are namespaced with the plugin IDs anyway.
- Provide a default implementation with a warning, not all plugins need
to overwrite this
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.
## 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.
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.
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.
## 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:
After using the ConversationsDbusInterface for a little while, there can be significant (MBs) memory usage of cached messages. The QDBusAbstractAdaptor does not like to be manually deleted, but it looks like it is safe to do so after constructing a new one
This contradicts the comment in the BatteryPlugin and the BatteryDbusInterface, which says deletelater() is not safe. Has Qt been updated since then?
Test Plan:
- Run daemon
- Hopefully experience no crashes after many phone reconnects
Reviewers: #kde_connect, apol, albertvaka
Reviewed By: #kde_connect, apol, albertvaka
Subscribers: apol, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D16553
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: Change ThreadID to long
Test Plan:
Messages should send and receive as before. Additionally, if your device has assigned extremely large ThreadIDs, the SMS plugin should no longer crash.
This patch corresponds to the Android-side revision D17517
Reviewers: #kde_connect, nicolasfella
Reviewed By: #kde_connect, nicolasfella
Subscribers: nicolasfella, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D17516
Summary:
Add "event" field to ConversationMessage
Update packet type with proper field names and commenting
Future "proof" SmsPlugin against new event types
Test Plan:
- Install the corresponding Android-side patch D16600
- Verify that it is possible to synchronize messages the same as it was before
Reviewers: #kde_connect, apol
Reviewed By: #kde_connect, apol
Subscribers: apol, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D16599
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:
Drop support for creating notifications from the SMS plugin. The old usecase is better handled by the notifications plugin reply box anyway
Rename packets defined in SMS plugin from PACKET_TYPE_TELEPHONY_* to PACKET_TYPE_SMS_*
Update TELEPHONY plugin packet description to point to SMS plugin
Define TELEPHONY_REQUEST_MUTE packet to replace old TELEPHONY_REQUEST with mute event field
Please see Android-side patch here: D15544
Test Plan:
I see four test cases, based on the version of the app being used, where "old" means any version built with sources not containing this revision and "new" means any version built with sources using this revision:
- New Android vs. New Desktop
- Supported and works for me
- New Android vs. Old Desktop
- Supported and works for me
- Old Android vs. New Desktop
- Not supported - Download a new app from the Play store or F-Droid
- Old Android vs. Old Desktop
- If this is broken, it is not my fault :)
In the supported use cases:
- Test SMS reply
- Receive SMS (or MMS!) message
- Verify that the //notification// plugin forwards a replyable notification and that replying works
- Test incoming call ringer mute
- Enable ringer volume (not vibrate)
- Receive phone call
- Verify a desktop notification with a Mute button appears
- Verify that clicking the mute button causes the phone to stop making the ringer noise (vibration not affected)
Reviewers: #kde_connect, albertvaka, nicolasfella
Reviewed By: #kde_connect, albertvaka, nicolasfella
Subscribers: nicolasfella, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D15543
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