Merge lp:~tiagosh/messaging-app/mms-group-chat into lp:messaging-app

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 280
Merged at revision: 303
Proposed branch: lp:~tiagosh/messaging-app/mms-group-chat
Merge into: lp:messaging-app
Diff against target: 110 lines (+28/-10)
4 files modified
src/qml/MMSDelegate.qml (+13/-0)
src/qml/MessageBubble.qml (+6/-5)
src/qml/Messages.qml (+6/-2)
src/qml/messaging-app.qml (+3/-3)
To merge this branch: bzr merge lp:~tiagosh/messaging-app/mms-group-chat
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+243432@code.launchpad.net

Commit message

Add initial MMS group chat support.

Description of the change

Add initial MMS group chat support.

--Checklist--
Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~tiagosh/telepathy-ofono/mms-group-chat/+merge/243431
https://code.launchpad.net/~tiagosh/telephony-service/flag-mms/+merge/243433

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/<package-name>) on device or emulator?
Yes

If you changed the UI, was the change specified/approved by design?
N/A

If you changed UI labels, did you update the pot file?
N/A

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
N/A

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

merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
279. By Tiago Salem Herrmann

merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
280. By Tiago Salem Herrmann

fix variable name

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

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
Yes

Did CI run pass? If not, please explain why.
No, but not related to the changes

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes

Code looks good and works as expected!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/MMSDelegate.qml'
2--- src/qml/MMSDelegate.qml 2015-01-05 20:35:11 +0000
3+++ src/qml/MMSDelegate.qml 2015-02-04 21:00:55 +0000
4@@ -18,6 +18,7 @@
5
6 import QtQuick 2.2
7 import Ubuntu.Components 1.1
8+import Ubuntu.Telephony 0.1
9
10 MessageDelegate {
11 id: root
12@@ -215,6 +216,18 @@
13 value: root.messageText.length > 0 ? root.messageText : i18n.tr("Missing message data")
14 when: bubbleLoader.status === Loader.Ready
15 }
16+ Binding {
17+ target: bubbleLoader.item
18+ property: "sender"
19+ value: contactWatcher.isUnknown ? contactWatcher.phoneNumber : contactWatcher.alias
20+ when: bubbleLoader.status === Loader.Ready && messageData.senderId !== "self"
21+ }
22+
23+ ContactWatcher {
24+ id: contactWatcher
25+ phoneNumber: participants.length > 1 && messageData.senderId !== "self" ? messageData.senderId : ""
26+ }
27+
28 }
29 }
30 }
31
32=== modified file 'src/qml/MessageBubble.qml'
33--- src/qml/MessageBubble.qml 2014-11-21 13:55:07 +0000
34+++ src/qml/MessageBubble.qml 2015-02-04 21:00:55 +0000
35@@ -81,9 +81,9 @@
36 }
37 }
38 radius: 9
39- height: senderName.height + textLabel.height + textTimestamp.height + units.gu(1)
40+ height: senderName.height + senderName.anchors.topMargin + textLabel.height + textTimestamp.height + units.gu(1)
41 width: Math.min(units.gu(27),
42- Math.max(textLabel.contentWidth, textTimestamp.contentWidth))
43+ Math.max(textLabel.contentWidth, textTimestamp.contentWidth, senderName.contentWidth))
44 + units.gu(3)
45 anchors{
46 leftMargin: units.gu(1)
47@@ -95,12 +95,13 @@
48
49 anchors {
50 top: parent.top
51- topMargin: units.gu(0.5)
52+ topMargin: height != 0 ? units.gu(0.5) : 0
53 left: parent.left
54- leftMargin: root.messageIncoming ? units.gu(2) : units.gu(1)
55+ leftMargin: units.gu(1)
56 }
57 height: text === "" ? 0 : paintedHeight
58- fontSize: "large"
59+ width: paintedWidth > maxDelegateWidth ? maxDelegateWidth : undefined
60+ fontSize: "small"
61 }
62
63 Label {
64
65=== modified file 'src/qml/Messages.qml'
66--- src/qml/Messages.qml 2015-01-21 16:58:14 +0000
67+++ src/qml/Messages.qml 2015-02-04 21:00:55 +0000
68@@ -208,7 +208,7 @@
69 }
70
71 function markMessageAsRead(accountId, threadId, eventId, type) {
72- chatManager.acknowledgeMessage(participants[0], eventId, accountId)
73+ chatManager.acknowledgeMessage(participants, eventId, accountId)
74 return eventModel.markEventAsRead(accountId, threadId, eventId, type);
75 }
76
77@@ -947,7 +947,11 @@
78 }
79 }
80 updateFilters()
81- if (attachments.count > 0) {
82+ var isMMS = attachments.count > 0
83+ var isMmsGroupChat = participants.length > 1 && telepathyHelper.mmsGroupChat
84+ // mms group chat only works if we known our own phone number
85+ var isSelfContactKnown = account.selfContactId != ""
86+ if (isMMS || (isMmsGroupChat && isSelfContactKnown)) {
87 var newAttachments = []
88 for (var i = 0; i < attachments.count; i++) {
89 var attachment = []
90
91=== modified file 'src/qml/messaging-app.qml'
92--- src/qml/messaging-app.qml 2014-10-17 18:15:29 +0000
93+++ src/qml/messaging-app.qml 2015-02-04 21:00:55 +0000
94@@ -136,13 +136,13 @@
95 mainStack.currentPage.showBottomEdgePage(Qt.resolvedUrl("Messages.qml"))
96 }
97
98- function startChat(phoneNumber, text) {
99+ function startChat(phoneNumbers, text) {
100 var properties = {}
101- var participants = [phoneNumber]
102+ var participants = phoneNumbers.split(";")
103 properties["participants"] = participants
104 properties["text"] = text
105 emptyStack()
106- if (phoneNumber === "") {
107+ if (participants.length === 0) {
108 return;
109 }
110 mainStack.push(Qt.resolvedUrl("Messages.qml"), properties)

Subscribers

People subscribed via source and target branches