Merge lp:~d.filoni/telegram-app/audio_receiving into lp:telegram-app

Proposed by Devid Antonio Filoni
Status: Merged
Approved by: Jin
Approved revision: 234
Merged at revision: 235
Proposed branch: lp:~d.filoni/telegram-app/audio_receiving
Merge into: lp:telegram-app
Diff against target: 129 lines (+24/-13)
4 files modified
telegram/app/qml/AccountMessageMedia.qml (+3/-5)
telegram/app/qml/MediaPlayerItem.qml (+5/-1)
telegram/app/qml/components/DialogsListItem.qml (+14/-1)
telegram/app/qml/components/MessagesListItem.qml (+2/-6)
To merge this branch: bzr merge lp:~d.filoni/telegram-app/audio_receiving
Reviewer Review Type Date Requested Status
Jin (community) Approve
Review via email: mp+307072@code.launchpad.net

Description of the change

This MR enables audio receiving support (so it partially fixes bug #1375179), all the code was already there, I don't know why it was disabled, it was already disabled in initial bzr commit so there is no history about that change. This commit also fixes the color palette (using Qt SystemPalette) which was not declared and the seekbar position which sometimes was not properly updated at track end.
Tested on mako, OTA-13.

To post a comment you must log in.
Revision history for this message
Andrea Bernabei (faenil) wrote :

It was disabled because Ubuntu Touch was missing the Opus codec, which has only very recently been added to the OS.

See https://bugs.launchpad.net/ubuntu/+source/media-hub/+bug/1460464

In any case, thanks a lot for taking the time to add the feature back! This is a great addition now that all the pieces of the puzzle are available! :)

Revision history for this message
Devid Antonio Filoni (d.filoni) wrote :

Thank you! I was a bit scared about this change as the code was disabled but your comment reassured me ;)

Revision history for this message
Jin (jindallo) wrote :

The patch looks good,
I will approve after validation done.

Thanks for this contribution.

Revision history for this message
Jin (jindallo) wrote :

Hello @Devid,

Thanks for the patch,
but there is a defect we found in testing:
    a) Try to get an audio message from other client
    b) It shows "Photo/Sticker" on main view (AccountPage)

I think we could manage a way to make it sense,
so that will be more reasonable to our user :)

Revision history for this message
Jin (jindallo) :
review: Needs Information
Revision history for this message
Devid Antonio Filoni (d.filoni) wrote :

Hi Jin,
I noticed that too, but I'm not sure about how to fix it as in DialogsListItem we only have a switch between the following actions:
    property real typeMessageActionChatCreate: 0xa6638b9a
    property real typeMessageActionChatAddUser: 0x5e3cfc4b
    property real typeMessageActionChatDeleteUser: 0xb2ae9b0c
    property real typeMessageActionChatJoinedByLink: 0xf89cf5e8
    property real typeMessageActionChatSentImage: 0xB6AEF7B0
    property real typeMessageActionChatChangeTitle: 0xB5A1CE5A

Photo/Sticker is printed when matching typeMessageActionChatSentImage so ATM in DialogsListItem code there is no way to recognize one type between images and audio files and I have no ideas about how to fix that :( Please point me to a direction so I can fix it ;)

Revision history for this message
Jin (jindallo) wrote :

Hello @Devid,

Thanks for the information,
actually the typeMessageActionChatSentImage is mapping to messageActionEmpty on our library,
well, that's not good since we only support image showing before,
but now we have sticker and your audio!

So let's have a look on this way:
    a) add a boolean isStick by telegram.documentIsSticker() function to check if it is a sticker
    b) add a boolean isAudioMessage by file_handler.targetType to check if it is a image
then we have a way to do that as you want! Take a try,
any problems you can post here and I will help you to get it done :)

233. By Devid Antonio Filoni

Show voice message info in DialogsListItem component

Revision history for this message
Devid Antonio Filoni (d.filoni) wrote :

@Jin: many thanks! I committed the change

Revision history for this message
Jin (jindallo) wrote :

Hello @Devid,

The code looks good,
I will verify it for you,
thanks!

Revision history for this message
Jin (jindallo) wrote :

Hello @Devid,

Verified pass,
but we still have a suggestion on the showing string/text,
our app. is referring the design of Android so:
    res = i18n.tr("<font color=\"DarkBlue\">Photo</font>")
    res = i18n.tr("<font color=\"DarkBlue\">Sticker</font>")
    res = i18n.tr("<font color=\"DarkBlue\">Voice message</font>")
are good enough. Would you kindly give this a patch then we will merge that for you.

Again, thanks for the contribution!

Revision history for this message
Devid Antonio Filoni (d.filoni) wrote :

Hi @Jin,
I'm sorry for this, I don't have an Android/iOS device and I used the web
app/existing code as reference.
No problem, I'll commit this once I'm back at home ;)
Thank you!

On Wed, Oct 5, 2016 at 8:42 AM, Jin <email address hidden> wrote:

> Hello @Devid,
>
> Verified pass,
> but we still have a suggestion on the showing string/text,
> our app. is referring the design of Android so:
> res = i18n.tr("<font color=\"DarkBlue\">Photo</font>")
> res = i18n.tr("<font color=\"DarkBlue\">Sticker</font>")
> res = i18n.tr("<font color=\"DarkBlue\">Voice message</font>")
> are good enough. Would you kindly give this a patch then we will merge
> that for you.
>
> Again, thanks for the contribution!
>
> --
> https://code.launchpad.net/~d.filoni/telegram-app/audio_
> receiving/+merge/307072
> You are the owner of lp:~d.filoni/telegram-app/audio_receiving.
>

234. By Devid Antonio Filoni

Fix DialogsListItem labels according to design spec

Revision history for this message
Jin (jindallo) wrote :

Code is good and verified pass,
I approve.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'telegram/app/qml/AccountMessageMedia.qml'
2--- telegram/app/qml/AccountMessageMedia.qml 2016-09-05 10:26:19 +0000
3+++ telegram/app/qml/AccountMessageMedia.qml 2016-10-05 20:43:58 +0000
4@@ -32,17 +32,15 @@
5 property variant mediaPlayer
6 property bool isAudioMessage: file_handler.targetType == FileHandler.TypeTargetMediaAudio
7 onIsAudioMessageChanged: {
8- /*
9 if(isAudioMessage) {
10 if(mediaPlayer)
11 mediaPlayer.destroy()
12- //mediaPlayer = media_player_component.createObject(msg_media)
13+ mediaPlayer = media_player_component.createObject(msg_media)
14 } else {
15 if(mediaPlayer)
16 mediaPlayer.destroy()
17 mediaPlayer = 0
18 }
19- */
20 }
21
22 signal mediaClicked(int type, string path);
23@@ -269,7 +267,7 @@
24 return Qt.resolvedUrl("qrc:/qml/files/attachment_download.png");
25 }
26 }
27- visible: !downloading && !msg_media.isAudioMessage
28+ visible: !downloading
29 }
30
31 Label {
32@@ -323,7 +321,7 @@
33 right: parent.right
34 rightMargin: units.dp(4)
35 }
36- visible: msg_media.showStatus && file_handler.targetType != FileHandler.TypeTargetMediaAudio
37+ visible: msg_media.showStatus
38
39 message: msg_media.message
40 hasMedia: msg_media.hasMedia
41
42=== modified file 'telegram/app/qml/MediaPlayerItem.qml'
43--- telegram/app/qml/MediaPlayerItem.qml 2015-09-22 09:57:07 +0000
44+++ telegram/app/qml/MediaPlayerItem.qml 2016-10-05 20:43:58 +0000
45@@ -10,6 +10,10 @@
46
47 property alias filePath: player.source
48
49+ SystemPalette {
50+ id: masterPalette
51+ }
52+
53 DropShadow {
54 anchors.fill: play_btn_scene
55 radius: 4.0
56@@ -101,7 +105,7 @@
57
58 Rectangle {
59 anchors.left: parent.left
60- anchors.right: seeker.horizontalCenter
61+ anchors.right: (player.status == MediaPlayer.EndOfMedia) ? parent.right : seeker.horizontalCenter
62 height: parent.height
63 radius: parent.radius
64 color: masterPalette.highlight
65
66=== modified file 'telegram/app/qml/components/DialogsListItem.qml'
67--- telegram/app/qml/components/DialogsListItem.qml 2016-06-16 11:19:41 +0000
68+++ telegram/app/qml/components/DialogsListItem.qml 2016-10-05 20:43:58 +0000
69@@ -33,6 +33,8 @@
70 property bool showMessage: true
71 property Message message: telegram.message(dialog.topMessage)
72 property variant messageDate: CalendarConv.fromTime_t(message.date)
73+ property bool isAudioMessage: file_handler.targetType == FileHandler.TypeTargetMediaAudio
74+ property alias isSticker: file_handler.isSticker
75
76 property bool online: isChat ? false : (user.status.classType == image.typeUserStatusOnline)
77
78@@ -51,6 +53,12 @@
79 signal currentIndexChanged(int index);
80 signal currentDialogChanged(Dialog dialog);
81
82+ FileHandler {
83+ id: file_handler
84+ telegram: telegramObject
85+ target: message
86+ }
87+
88 leadingActions: ListItemActions {
89 actions: [
90 Action {
91@@ -220,7 +228,12 @@
92
93 case typeMessageActionChatSentImage:
94 if (fromUserName != "") {
95- res = i18n.tr("<font color=\"DarkBlue\">Photo/Sticker</font>")
96+ if (isAudioMessage)
97+ res = i18n.tr("<font color=\"DarkBlue\">Voice message</font>")
98+ else if (isSticker)
99+ res = i18n.tr("<font color=\"DarkBlue\">Sticker</font>")
100+ else
101+ res = i18n.tr("<font color=\"DarkBlue\">Photo</font>")
102 }
103 break
104
105
106=== modified file 'telegram/app/qml/components/MessagesListItem.qml'
107--- telegram/app/qml/components/MessagesListItem.qml 2016-07-22 06:27:59 +0000
108+++ telegram/app/qml/components/MessagesListItem.qml 2016-10-05 20:43:58 +0000
109@@ -244,7 +244,7 @@
110 // Math.max(message_status.x + message_status.width - message_text_frame.x)//, column.maxWidthNoMsg)
111 height: childrenRect.height
112 anchors.left: parent.left
113- visible: !hasMedia || message_media.isAudioMessage
114+ visible: !hasMedia
115
116 Label {
117 id: message_text
118@@ -288,11 +288,7 @@
119
120 property real htmlWidth: Cutegram.htmlWidth(text)
121 property string messageText: {
122- if (message_media.isAudioMessage) {
123- return i18n.tr("Audio attachment not supported yet ;(")
124- } else {
125- return message_text.parseText(message.message)
126- }
127+ return message_text.parseText(message.message)
128 }
129 }
130

Subscribers

People subscribed via source and target branches

to status/vote changes: