Merge lp:~renatofilho/phone-app/fix-1191820 into lp:phone-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 693
Merged at revision: 693
Proposed branch: lp:~renatofilho/phone-app/fix-1191820
Merge into: lp:phone-app
Diff against target: 53 lines (+12/-3)
3 files modified
approver/phoneappapprover.cpp (+8/-1)
approver/phoneappapprover.h (+1/-0)
approver/textchannelobserver.cpp (+3/-2)
To merge this branch: bzr merge lp:~renatofilho/phone-app/fix-1191820
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+171417@code.launchpad.net

Commit message

Used hex format for message id to avoid invalid character

To post a comment you must log in.
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

20 + QMetaObject::invokeMethod(ChatManager::instance(), "acknowledgeMessage",
21 + Q_ARG(QString, phoneNumber), Q_ARG(QString, messageId));

There is no need to use the invokeMethod here: as you are already in a slot, just call the acknowledgeMessage() method directly.

review: Needs Fixing
692. By Renato Araujo Oliveira Filho

Direct call "acknowledgeMessage" instead of use "invokeMethod"

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
693. By Renato Araujo Oliveira Filho

Merged mainline.

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

While the code does not have any problems in itself, it doesn't fix the problem reported.

review: Needs Fixing
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

> While the code does not have any problems in itself, it doesn't fix the
> problem reported.

Please disregard the previous comment. I did something wrong while testing.
The fix works and the code looks fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'approver/phoneappapprover.cpp'
2--- approver/phoneappapprover.cpp 2013-06-25 20:02:48 +0000
3+++ approver/phoneappapprover.cpp 2013-06-25 21:46:27 +0000
4@@ -63,7 +63,7 @@
5 SIGNAL(replyReceived(QString,QString)),
6 SLOT(onReplyReceived(QString,QString)));
7 connect(MessagingMenu::instance(), SIGNAL(messageRead(QString,QString)),
8- ChatManager::instance(), SLOT(acknowledgeMessage(QString,QString)));
9+ this, SLOT(onMessageRead(QString,QString)));
10
11 connect(PhoneAppUtils::instance(),
12 SIGNAL(applicationRunningChanged(bool)),
13@@ -74,6 +74,13 @@
14 {
15 }
16
17+void PhoneAppApprover::onMessageRead(const QString &phoneNumber, const QString &encodedMessageId)
18+{
19+ QString messageId(QByteArray::fromHex(encodedMessageId.toUtf8()));
20+ ChatManager::instance()->acknowledgeMessage(phoneNumber, messageId);
21+}
22+
23+
24 Tp::ChannelClassSpecList PhoneAppApprover::channelFilters() const
25 {
26 Tp::ChannelClassSpecList specList;
27
28=== modified file 'approver/phoneappapprover.h'
29--- approver/phoneappapprover.h 2013-06-25 20:02:48 +0000
30+++ approver/phoneappapprover.h 2013-06-25 21:46:27 +0000
31@@ -58,6 +58,7 @@
32 void onCallStateChanged(Tp::CallState state);
33 void onReplyReceived(const QString &phoneNumber, const QString &reply);
34 void closeSnapDecision();
35+ void onMessageRead(const QString &phoneNumber, const QString &encodedMessageId);
36 void onAcceptCallRequested();
37 void onRejectCallRequested();
38
39
40=== modified file 'approver/textchannelobserver.cpp'
41--- approver/textchannelobserver.cpp 2013-05-27 18:57:45 +0000
42+++ approver/textchannelobserver.cpp 2013-06-25 21:46:27 +0000
43@@ -72,8 +72,9 @@
44
45 g_object_unref(G_OBJECT(notification));
46
47- // and add the message to the messaging menu
48- MessagingMenu::instance()->addMessage(contact->id(), message.messageToken(), message.received(), message.text());
49+ // and add the message to the messaging menu (use hex format to avoid invalid characters)
50+ QByteArray token(message.messageToken().toUtf8());
51+ MessagingMenu::instance()->addMessage(contact->id(), token.toHex(), message.received(), message.text());
52 Ringtone::instance()->playIncomingMessageSound();
53 }
54

Subscribers

People subscribed via source and target branches