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
=== modified file 'telegram/app/qml/AccountDialogList.qml'
--- telegram/app/qml/AccountDialogList.qml 2016-03-07 11:25:51 +0000
+++ telegram/app/qml/AccountDialogList.qml 2016-04-07 21:52:16 +0000
@@ -64,6 +64,8 @@
64 delegate: DialogsListItem {64 delegate: DialogsListItem {
65 id: list_item65 id: list_item
66 anchors {66 anchors {
67 left: parent.left
68 right: parent.right
67 topMargin: units.dp(3)69 topMargin: units.dp(3)
68 leftMargin: units.dp(5)70 leftMargin: units.dp(5)
69 bottomMargin: units.dp(3)71 bottomMargin: units.dp(3)
7072
=== modified file 'telegram/app/qml/components/DialogsListItem.qml'
--- telegram/app/qml/components/DialogsListItem.qml 2016-03-11 07:53:28 +0000
+++ telegram/app/qml/components/DialogsListItem.qml 2016-04-07 21:52:16 +0000
@@ -142,8 +142,7 @@
142 visible: dialog.encrypted142 visible: dialog.encrypted
143 }143 }
144144
145 Text {145 Row {
146 id: title_text
147 anchors {146 anchors {
148 top: parent.top147 top: parent.top
149 left: image.right148 left: image.right
@@ -152,19 +151,49 @@
152 right: time_text.left151 right: time_text.left
153 margins: units.dp(4)152 margins: units.dp(4)
154 }153 }
155 horizontalAlignment: Text.AlignLeft154 spacing: units.dp(4)
156 verticalAlignment: Text.AlignVCenter155
157 clip: true156 Icon {
158 elide: Text.ElideRight157 id: contact_group_icon
159 wrapMode: Text.WrapAnywhere158 visible: isChat
160 maximumLineCount: 1159 name: "contact-group"
161 font.weight: Font.DemiBold160 anchors {
162 font.pixelSize: units.dp(17)//FontUtils.sizeToPixels("large")161 top: parent.top
163 text: list_item.title162 bottom: parent.bottom
163 topMargin: units.dp(4)
164 bottomMargin: units.dp(4)
165 }
166 width: height
167 }
168
169 Text {
170 id: title_text
171 horizontalAlignment: Text.AlignLeft
172 verticalAlignment: Text.AlignVCenter
173 clip: true
174 elide: Text.ElideRight
175 wrapMode: Text.WrapAnywhere
176 maximumLineCount: 1
177 font.weight: Font.DemiBold
178 font.pixelSize: units.dp(17)//FontUtils.sizeToPixels("large")
179 text: list_item.title
180 }
181
182 Icon {
183 id: audio_volume_muted_icon
184 visible: telegram.userData.isMuted(dialogId);
185 name: "audio-volume-muted"
186 anchors {
187 top: parent.top
188 bottom: parent.bottom
189 topMargin: units.dp(4)
190 bottomMargin: units.dp(4)
191 }
192 width: height
193 }
164 }194 }
165195
166 Text {196 Row {
167 id: message_text
168 anchors {197 anchors {
169 top: parent.verticalCenter198 top: parent.verticalCenter
170 bottom: parent.bottom199 bottom: parent.bottom
@@ -174,24 +203,43 @@
174 margins: units.dp(4)203 margins: units.dp(4)
175 topMargin: 0204 topMargin: 0
176 }205 }
177 visible: showMessage206
178 clip: true207 Text {
179 elide: Text.ElideRight208 id: message_author
180 wrapMode: Text.WrapAnywhere209 visible: showMessage && (message.out || isChat) && dialog.typingUsers.length === 0
181 maximumLineCount: 1210 maximumLineCount: 1
182 font.pixelSize: units.dp(15)//FontUtils.sizeToPixels("smaller")211 font.pixelSize: units.dp(15)//FontUtils.sizeToPixels("smaller")
183 color: Colors.grey212 color: Colors.telegram_blue
184 text: {213 text: {
185 if (!visible) return "";214 if (dialog.typingUsers.length > 0) return '';
186215 if (message.out) return i18n.tr("You: ");
187 var list = dialog.typingUsers;216 if (isChat) return telegramObject.user(message.fromId).firstName + ': ';
188 if (list.length > 0) {217 return '';
218 }
219 }
220
221 Text {
222 id: message_text
223 visible: showMessage
224 clip: true
225 elide: Text.ElideRight
226 wrapMode: Text.WrapAnywhere
227 maximumLineCount: 1
228 font.pixelSize: units.dp(15)//FontUtils.sizeToPixels("smaller")
229 color: Colors.grey
230 width: parent.width - message_author.width - (unread_rect.visible ? unread_rect.width : 0)
231 text: {
232 if (!visible) return "";
189 // TRANSLATORS: Indicates in a subtitle of a dialog list item that someone is typing.233 // TRANSLATORS: Indicates in a subtitle of a dialog list item that someone is typing.
190 return i18n.tr("typing...")234
191 } else {235 var list = dialog.typingUsers;
192 // We use emojis in our font currently, so no need to replace them here for now236 if (list.length > 0) {
193 //return emojis.bodyTextToEmojiText(message.message, 16, true);237 return i18n.tr("typing...")
194 return message.message238 } else {
239 // We use emojis in our font currently, so no need to replace them here for now
240 //return emojis.bodyTextToEmojiText(message.message, 16, true);
241 return message.message
242 }
195 }243 }
196 }244 }
197 }245 }
@@ -221,7 +269,7 @@
221 width: Math.min(height, units.gu(4))269 width: Math.min(height, units.gu(4))
222 height: units.gu(2.8)270 height: units.gu(2.8)
223 radius: width*0.5271 radius: width*0.5
224 color: "#5ec245"272 color: telegram.userData.isMuted(dialogId) ? Colors.grey : "#5ec245"
225 visible: dialog.unreadCount !== 0273 visible: dialog.unreadCount !== 0
226274
227 Text {275 Text {

Subscribers

People subscribed via source and target branches

to status/vote changes: