Previously, incoming messages were appened to a QList. This list was accidentally sorted because that's how Android returned them, but new messages were appended to the wrong end of the list. This patch specifically and intentionally sorts messages so new ones become visible
Details
- Reviewers
apol - Commits
- R224:e5b6c147d8a9: Sort Cached Messages
- Open SMS GUI, verify that the most-recent messages are shown
- Either send or recieve an SMS
- Wait about 5s (I do not know why this is necessary. Probably some Android weirdness)
- De-select the current conversation, then re-select it
- TODO: Make the app automatically respond to new messages
- The newly sent or recieved message should be shown in the most-recent position
Diff Detail
- Repository
- R224 KDE Connect
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Yes because in the app we ask the ConversationDBusInterface for the 10 most recent messages. Since the list was badly sorted it would return the 10 most recent messages at the time they were requested. If new messages came in, they would not be shown (you made a reference to this earlier as having to disconnect and reconnect to see new messages). They would be correctly sorted in the QML app, but the app was already receiving stale data. This makes the situation a little better in that you only have to change which conversation is being viewed to see new messages.
I think the method of getting messages into the app might need to be redesigned at some point regardless, but I expect we will want a sorted representation in the model no matter what
I have drawn what was happening before: Hopefully that helps show why this is a needed change:
plugins/telephony/conversationsdbusinterface.h | ||
---|---|---|
86 | The timestamp is a field of ConversationMessage already. It feels kind of dumb to store it twice like this, but it is very easy to do it this way... |