Merge lp:~boiko/messaging-app/acknowledge_removed_messages into lp:messaging-app

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Bill Filler
Approved revision: 431
Merged at revision: 442
Proposed branch: lp:~boiko/messaging-app/acknowledge_removed_messages
Merge into: lp:messaging-app
Diff against target: 50 lines (+16/-2)
3 files modified
src/qml/MainPage.qml (+1/-1)
src/qml/ThreadDelegate.qml (+1/-1)
src/qml/messaging-app.qml (+14/-0)
To merge this branch: bzr merge lp:~boiko/messaging-app/acknowledge_removed_messages
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Tiago Salem Herrmann (community) Needs Fixing
Review via email: mp+270120@code.launchpad.net

Commit message

Acknowledge pending messages before removing the threads.

Description of the change

Acknowledge pending messages before removing the threads.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Tiago Salem Herrmann (tiagosh) :
review: Needs Fixing
430. By Gustavo Pichorim Boiko

Fix retrieving the participants whose messages should be acknowledge

431. By Gustavo Pichorim Boiko

Also cover the case when multi-selecting the threads and removing them.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/MainPage.qml'
2--- src/qml/MainPage.qml 2015-04-30 22:47:38 +0000
3+++ src/qml/MainPage.qml 2015-09-24 20:32:11 +0000
4@@ -235,7 +235,7 @@
5 }
6
7 if (threadsToRemove.length > 0) {
8- threadModel.removeThreads(threadsToRemove);
9+ mainView.removeThreads(threadsToRemove);
10 }
11 }
12 }
13
14=== modified file 'src/qml/ThreadDelegate.qml'
15--- src/qml/ThreadDelegate.qml 2015-04-08 22:00:19 +0000
16+++ src/qml/ThreadDelegate.qml 2015-09-24 20:32:11 +0000
17@@ -95,7 +95,7 @@
18 iconName: "delete"
19 text: i18n.tr("Delete")
20 onTriggered: {
21- threadModel.removeThreads(model.threads);
22+ mainView.removeThreads(model.threads)
23 }
24 }
25
26
27=== modified file 'src/qml/messaging-app.qml'
28--- src/qml/messaging-app.qml 2015-07-15 23:32:27 +0000
29+++ src/qml/messaging-app.qml 2015-09-24 20:32:11 +0000
30@@ -83,6 +83,20 @@
31 }
32 }
33
34+ function removeThreads(threads) {
35+ // extract the participant IDs from one of the threads
36+ var thread = threads[0];
37+ var participants = thread.participants;
38+
39+ // and acknowledge all messages for the threads to be removed
40+ for (var i in threads) {
41+ chatManager.acknowledgeAllMessages(participants, threads[i].accountId)
42+ }
43+
44+ // at last remove the threads
45+ threadModel.removeThreads(threads);
46+ }
47+
48 Connections {
49 target: telepathyHelper
50 // restore default bindings if any system settings changed

Subscribers

People subscribed via source and target branches