Merge lp:~rpadovani/telegram-app/showLastMessageAuthor into lp:telegram-app

Proposed by Riccardo Padovani
Status: Needs review
Proposed branch: lp:~rpadovani/telegram-app/showLastMessageAuthor
Merge into: lp:telegram-app
Diff against target: 157 lines (+81/-31)
2 files modified
telegram/app/qml/AccountDialogList.qml (+2/-0)
telegram/app/qml/components/DialogsListItem.qml (+79/-31)
To merge this branch: bzr merge lp:~rpadovani/telegram-app/showLastMessageAuthor
Reviewer Review Type Date Requested Status
libqtelegram team Pending
Review via email: mp+291312@code.launchpad.net

Description of the change

Show the name of the author of last message in conversations list if the
conversation is a chat or if the author is the user herself

To post a comment you must log in.
171. By Riccardo Padovani

Show group icon on the left of the title in the dialogs list and mute icon
on the right

172. By Riccardo Padovani

Fix text elide, grey notifications for muted chats

173. By Riccardo Padovani

Don't show the author if someone is typing

Revision history for this message
Jin (jindallo) wrote :

The code looks good to me,
I will approve this if verified pass from my local,
thanks.

Unmerged revisions

173. By Riccardo Padovani

Don't show the author if someone is typing

172. By Riccardo Padovani

Fix text elide, grey notifications for muted chats

171. By Riccardo Padovani

Show group icon on the left of the title in the dialogs list and mute icon
on the right

170. By Riccardo Padovani

Show the name of the author of last message in conversations list if the
conversation is a chat or if the author is the user herself

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'telegram/app/qml/AccountDialogList.qml'
2--- telegram/app/qml/AccountDialogList.qml 2016-03-07 11:25:51 +0000
3+++ telegram/app/qml/AccountDialogList.qml 2016-04-07 21:52:16 +0000
4@@ -64,6 +64,8 @@
5 delegate: DialogsListItem {
6 id: list_item
7 anchors {
8+ left: parent.left
9+ right: parent.right
10 topMargin: units.dp(3)
11 leftMargin: units.dp(5)
12 bottomMargin: units.dp(3)
13
14=== modified file 'telegram/app/qml/components/DialogsListItem.qml'
15--- telegram/app/qml/components/DialogsListItem.qml 2016-03-11 07:53:28 +0000
16+++ telegram/app/qml/components/DialogsListItem.qml 2016-04-07 21:52:16 +0000
17@@ -142,8 +142,7 @@
18 visible: dialog.encrypted
19 }
20
21- Text {
22- id: title_text
23+ Row {
24 anchors {
25 top: parent.top
26 left: image.right
27@@ -152,19 +151,49 @@
28 right: time_text.left
29 margins: units.dp(4)
30 }
31- horizontalAlignment: Text.AlignLeft
32- verticalAlignment: Text.AlignVCenter
33- clip: true
34- elide: Text.ElideRight
35- wrapMode: Text.WrapAnywhere
36- maximumLineCount: 1
37- font.weight: Font.DemiBold
38- font.pixelSize: units.dp(17)//FontUtils.sizeToPixels("large")
39- text: list_item.title
40+ spacing: units.dp(4)
41+
42+ Icon {
43+ id: contact_group_icon
44+ visible: isChat
45+ name: "contact-group"
46+ anchors {
47+ top: parent.top
48+ bottom: parent.bottom
49+ topMargin: units.dp(4)
50+ bottomMargin: units.dp(4)
51+ }
52+ width: height
53+ }
54+
55+ Text {
56+ id: title_text
57+ horizontalAlignment: Text.AlignLeft
58+ verticalAlignment: Text.AlignVCenter
59+ clip: true
60+ elide: Text.ElideRight
61+ wrapMode: Text.WrapAnywhere
62+ maximumLineCount: 1
63+ font.weight: Font.DemiBold
64+ font.pixelSize: units.dp(17)//FontUtils.sizeToPixels("large")
65+ text: list_item.title
66+ }
67+
68+ Icon {
69+ id: audio_volume_muted_icon
70+ visible: telegram.userData.isMuted(dialogId);
71+ name: "audio-volume-muted"
72+ anchors {
73+ top: parent.top
74+ bottom: parent.bottom
75+ topMargin: units.dp(4)
76+ bottomMargin: units.dp(4)
77+ }
78+ width: height
79+ }
80 }
81
82- Text {
83- id: message_text
84+ Row {
85 anchors {
86 top: parent.verticalCenter
87 bottom: parent.bottom
88@@ -174,24 +203,43 @@
89 margins: units.dp(4)
90 topMargin: 0
91 }
92- visible: showMessage
93- clip: true
94- elide: Text.ElideRight
95- wrapMode: Text.WrapAnywhere
96- maximumLineCount: 1
97- font.pixelSize: units.dp(15)//FontUtils.sizeToPixels("smaller")
98- color: Colors.grey
99- text: {
100- if (!visible) return "";
101-
102- var list = dialog.typingUsers;
103- if (list.length > 0) {
104+
105+ Text {
106+ id: message_author
107+ visible: showMessage && (message.out || isChat) && dialog.typingUsers.length === 0
108+ maximumLineCount: 1
109+ font.pixelSize: units.dp(15)//FontUtils.sizeToPixels("smaller")
110+ color: Colors.telegram_blue
111+ text: {
112+ if (dialog.typingUsers.length > 0) return '';
113+ if (message.out) return i18n.tr("You: ");
114+ if (isChat) return telegramObject.user(message.fromId).firstName + ': ';
115+ return '';
116+ }
117+ }
118+
119+ Text {
120+ id: message_text
121+ visible: showMessage
122+ clip: true
123+ elide: Text.ElideRight
124+ wrapMode: Text.WrapAnywhere
125+ maximumLineCount: 1
126+ font.pixelSize: units.dp(15)//FontUtils.sizeToPixels("smaller")
127+ color: Colors.grey
128+ width: parent.width - message_author.width - (unread_rect.visible ? unread_rect.width : 0)
129+ text: {
130+ if (!visible) return "";
131 // TRANSLATORS: Indicates in a subtitle of a dialog list item that someone is typing.
132- return i18n.tr("typing...")
133- } else {
134- // We use emojis in our font currently, so no need to replace them here for now
135- //return emojis.bodyTextToEmojiText(message.message, 16, true);
136- return message.message
137+
138+ var list = dialog.typingUsers;
139+ if (list.length > 0) {
140+ return i18n.tr("typing...")
141+ } else {
142+ // We use emojis in our font currently, so no need to replace them here for now
143+ //return emojis.bodyTextToEmojiText(message.message, 16, true);
144+ return message.message
145+ }
146 }
147 }
148 }
149@@ -221,7 +269,7 @@
150 width: Math.min(height, units.gu(4))
151 height: units.gu(2.8)
152 radius: width*0.5
153- color: "#5ec245"
154+ color: telegram.userData.isMuted(dialogId) ? Colors.grey : "#5ec245"
155 visible: dialog.unreadCount !== 0
156
157 Text {

Subscribers

People subscribed via source and target branches

to status/vote changes: