Merge lp:~phablet-team/telephony-service/check_channel_is_active into lp:telephony-service/staging

Proposed by Renato Araujo Oliveira Filho
Status: Needs review
Proposed branch: lp:~phablet-team/telephony-service/check_channel_is_active
Merge into: lp:telephony-service/staging
Prerequisite: lp:~phablet-team/telephony-service/multiple_performance_improvements1
Diff against target: 33 lines (+15/-0)
2 files modified
libtelephonyservice/chatmanager.cpp (+14/-0)
libtelephonyservice/chatmanager.h (+1/-0)
To merge this branch: bzr merge lp:~phablet-team/telephony-service/check_channel_is_active
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+317266@code.launchpad.net

Commit message

Allows to check if a channel is active using qml properties.

To post a comment you must log in.

Unmerged revisions

1243. By Renato Araujo Oliveira Filho

Allows to check if a channel is active using qml properties.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libtelephonyservice/chatmanager.cpp'
2--- libtelephonyservice/chatmanager.cpp 2017-02-14 23:07:49 +0000
3+++ libtelephonyservice/chatmanager.cpp 2017-02-14 23:07:50 +0000
4@@ -325,3 +325,17 @@
5 QDBusInterface *handlerIface = TelepathyHelper::instance()->handlerInterface();
6 handlerIface->asyncCall("LeaveChat", channels.first()->objectPath(), message);
7 }
8+
9+bool ChatManager::channelIsActive(const QVariantMap &properties)
10+{
11+ QList<Tp::TextChannelPtr> channels = channelForProperties(properties);
12+ if (channels.isEmpty()) {
13+ return false;
14+ }
15+ Q_FOREACH(Tp::TextChannelPtr channel, channels) {
16+ if (channel->groupContacts(true).contains(channel->groupSelfContact())) {
17+ return true;
18+ }
19+ }
20+ return false;
21+}
22
23=== modified file 'libtelephonyservice/chatmanager.h'
24--- libtelephonyservice/chatmanager.h 2017-02-14 23:07:49 +0000
25+++ libtelephonyservice/chatmanager.h 2017-02-14 23:07:50 +0000
26@@ -56,6 +56,7 @@
27 void acknowledgeAllMessages(const QVariantMap &properties);
28 void leaveRooms(const QString &accountId, const QString &message);
29 void leaveRoom(const QVariantMap &properties, const QString &message);
30+ bool channelIsActive(const QVariantMap&);
31
32 private Q_SLOTS:
33 void onChannelObserverUnregistered();

Subscribers

People subscribed via source and target branches

to all changes: