Merge lp:~phablet-team/messaging-framework/multiple_api_fixes into lp:messaging-framework

Proposed by Tiago Salem Herrmann
Status: Approved
Approved by: Roberto Mier Escandon
Approved revision: 73
Proposed branch: lp:~phablet-team/messaging-framework/multiple_api_fixes
Merge into: lp:messaging-framework
Diff against target: 424 lines (+100/-11)
20 files modified
debian/control.in (+0/-1)
include/messaging/connection.h (+4/-0)
include/messaging/connector.h (+2/-0)
include/messaging/group_manager.h (+3/-0)
include/messaging/plugin_connector.h (+2/-0)
include/messaging/qt/network_monitor.h (+1/-1)
include/messaging/qt/tp/connection.h (+5/-0)
src/messaging/connection.cpp (+5/-0)
src/messaging/plugin_connector.cpp (+5/-0)
src/messaging/qt/network_monitor.cpp (+4/-2)
src/messaging/qt/tp/connection.cpp (+42/-3)
src/messaging/qt/tp/protocol.cpp (+4/-1)
src/messaging/qt/tp/text_channel.cpp (+8/-3)
tests/mock_connection.h (+1/-0)
tests/mock_connector.h (+1/-0)
tests/mock_group_manager.h (+1/-0)
tests/unit/messaging/blocking_connector.cpp (+5/-0)
tests/unit/messaging/blocking_connector.h (+1/-0)
tests/unit/messaging/plugin_connector_test.cpp (+5/-0)
tests/unit/messaging/runner_test.cpp (+1/-0)
To merge this branch: bzr merge lp:~phablet-team/messaging-framework/multiple_api_fixes
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
Roberto Mier Escandon (community) Approve
system-apps-ci-bot continuous-integration Approve
Review via email: mp+313457@code.launchpad.net

Commit message

Allow plugins to disable network monitor and to set self user id.

Description of the change

Allow plugins to disable network monitor and to set self user id.

To post a comment you must log in.
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:73
https://jenkins.canonical.com/system-apps/job/lp-messaging-framework-ci/108/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/2201
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/570
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/2204
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2031
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2031/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2031
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2031/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=zesty/2031
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=zesty/2031/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2031
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2031/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2031
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2031/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=zesty/2031
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=zesty/2031/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/2031
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/2031/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/2031
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/2031/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=zesty/2031
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=zesty/2031/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-messaging-framework-ci/108/rebuild

review: Approve (continuous-integration)
Revision history for this message
Roberto Mier Escandon (rmescandon) wrote :

Lgtm

review: Approve
74. By Renato Araujo Oliveira Filho

Trunk merged.

75. By Renato Araujo Oliveira Filho

Merged: lp:~phablet-team/messaging-framework/prepare_for_release

76. By Tiago Salem Herrmann

Do not test flags if it none

77. By Tiago Salem Herrmann

Only add self handle if it's not present on remote and regular users

78. By Gustavo Pichorim Boiko

Set the self contact as pending remote when creating rooms

79. By Tiago Salem Herrmann

bump clang version

80. By Tiago Salem Herrmann

try remove clang-format as it's not available on zesty

81. By Tiago Salem Herrmann

force unregister objects after disconnection

82. By Tiago Salem Herrmann

Set group self handle

83. By Tiago Salem Herrmann

Add persistent property

84. By Gustavo Pichorim Boiko

merge trunk

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

Looks good!

review: Approve

Unmerged revisions

84. By Gustavo Pichorim Boiko

merge trunk

83. By Tiago Salem Herrmann

Add persistent property

82. By Tiago Salem Herrmann

Set group self handle

81. By Tiago Salem Herrmann

force unregister objects after disconnection

80. By Tiago Salem Herrmann

try remove clang-format as it's not available on zesty

79. By Tiago Salem Herrmann

bump clang version

78. By Gustavo Pichorim Boiko

Set the self contact as pending remote when creating rooms

77. By Tiago Salem Herrmann

Only add self handle if it's not present on remote and regular users

76. By Tiago Salem Herrmann

Do not test flags if it none

75. By Renato Araujo Oliveira Filho

Merged: lp:~phablet-team/messaging-framework/prepare_for_release

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control.in'
--- debian/control.in 2016-11-18 23:50:19 +0000
+++ debian/control.in 2017-03-22 21:19:38 +0000
@@ -3,7 +3,6 @@
3Priority: optional3Priority: optional
4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5Build-Depends: astyle,5Build-Depends: astyle,
6 clang-format-3.5:native,
7 clang:native,6 clang:native,
8 cmake,7 cmake,
9 debhelper (>= 9),8 debhelper (>= 9),
109
=== modified file 'include/messaging/connection.h'
--- include/messaging/connection.h 2016-10-21 14:02:19 +0000
+++ include/messaging/connection.h 2017-03-22 21:19:38 +0000
@@ -72,6 +72,8 @@
72 /// @param reason The reason why the connection status changed.72 /// @param reason The reason why the connection status changed.
73 virtual void on_status_changed(Status status, StatusChangedReason reason) = 0;73 virtual void on_status_changed(Status status, StatusChangedReason reason) = 0;
7474
75 virtual void on_self_id_changed(const std::string &self_id) = 0;
76
75 protected:77 protected:
76 Observer() = default;78 Observer() = default;
77 79
@@ -112,6 +114,8 @@
112 /// A note to integrators: It is safe to call this function from any thread.114 /// A note to integrators: It is safe to call this function from any thread.
113 void announce_status_changed(Status status, StatusChangedReason reason);115 void announce_status_changed(Status status, StatusChangedReason reason);
114116
117 void announce_self_id_changed(const std::string &self_id);
118
115private:119private:
116 /// @cond120 /// @cond
117 struct Private;121 struct Private;
118122
=== modified file 'include/messaging/connector.h'
--- include/messaging/connector.h 2016-06-07 18:15:24 +0000
+++ include/messaging/connector.h 2017-03-22 21:19:38 +0000
@@ -57,6 +57,8 @@
57 const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer,57 const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer,
58 const messaging::Dictionary<std::string, messaging::Variant>& dict) = 0;58 const messaging::Dictionary<std::string, messaging::Variant>& dict) = 0;
5959
60 virtual bool network_monitor_enabled() = 0;
61
60protected:62protected:
61 // Only subclasses can instantiate.63 // Only subclasses can instantiate.
62 Connector() = default;64 Connector() = default;
6365
=== modified file 'include/messaging/group_manager.h'
--- include/messaging/group_manager.h 2016-10-09 16:01:04 +0000
+++ include/messaging/group_manager.h 2017-03-22 21:19:38 +0000
@@ -108,6 +108,9 @@
108 /// @brief group_admins returns the list of admin identifiers108 /// @brief group_admins returns the list of admin identifiers
109 virtual std::set<std::string> group_admins() = 0;109 virtual std::set<std::string> group_admins() = 0;
110110
111 /// @brief check if group is persistent on server side
112 virtual bool persistent() = 0;
113
111 /// @brief members returns current participants in the group.114 /// @brief members returns current participants in the group.
112 virtual Members members() = 0;115 virtual Members members() = 0;
113116
114117
=== modified file 'include/messaging/plugin_connector.h'
--- include/messaging/plugin_connector.h 2016-06-07 18:15:24 +0000
+++ include/messaging/plugin_connector.h 2017-03-22 21:19:38 +0000
@@ -82,6 +82,8 @@
82 /// @brief stop requests the connector to stop executing.82 /// @brief stop requests the connector to stop executing.
83 void stop() override;83 void stop() override;
8484
85 bool network_monitor_enabled() override;
86
85 std::shared_ptr<Connection> request_connection(const std::shared_ptr<messaging::Connection::Observer>& connection_observer,87 std::shared_ptr<Connection> request_connection(const std::shared_ptr<messaging::Connection::Observer>& connection_observer,
86 const std::shared_ptr<messaging::Messenger::Observer>& messenger_observer,88 const std::shared_ptr<messaging::Messenger::Observer>& messenger_observer,
87 const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer,89 const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer,
8890
=== modified file 'include/messaging/qt/network_monitor.h'
--- include/messaging/qt/network_monitor.h 2016-07-18 11:42:37 +0000
+++ include/messaging/qt/network_monitor.h 2017-03-22 21:19:38 +0000
@@ -42,7 +42,7 @@
42 NetworkPartialOnline,42 NetworkPartialOnline,
43 NetworkOnline43 NetworkOnline
44 };44 };
45 NetworkMonitor(const std::weak_ptr<Connection> &connection, QObject *parent=0);45 NetworkMonitor(const std::weak_ptr<Connection> &connection, bool network_monitor_enabled = true, QObject *parent=0);
46 virtual ~NetworkMonitor();46 virtual ~NetworkMonitor();
4747
48 void stop_monitoring();48 void stop_monitoring();
4949
=== modified file 'include/messaging/qt/tp/connection.h'
--- include/messaging/qt/tp/connection.h 2016-08-23 22:33:39 +0000
+++ include/messaging/qt/tp/connection.h 2017-03-22 21:19:38 +0000
@@ -32,6 +32,8 @@
3232
33#include <memory>33#include <memory>
3434
35#include <QMutex>
36
35namespace messaging37namespace messaging
36{38{
37// A handy fwd declaration39// A handy fwd declaration
@@ -91,6 +93,8 @@
91 ///93 ///
92 /// Implemented from messaging::Connection::Observer.94 /// Implemented from messaging::Connection::Observer.
93 void on_status_changed(messaging::Connection::Status new_status, messaging::Connection::StatusChangedReason reason) override;95 void on_status_changed(messaging::Connection::Status new_status, messaging::Connection::StatusChangedReason reason) override;
96
97 void on_self_id_changed(const std::string &self_id) override;
9498
95 /// @brief on_message_without_chat_received called when received a messages that creates a new chat99 /// @brief on_message_without_chat_received called when received a messages that creates a new chat
96 void on_message_without_chat_received(const Recipient::shared_ptr& recipient, const Message &message) override;100 void on_message_without_chat_received(const Recipient::shared_ptr& recipient, const Message &message) override;
@@ -106,6 +110,7 @@
106 Tp::SharedPtr<Connection> connection; ///< The managed connection instance.110 Tp::SharedPtr<Connection> connection; ///< The managed connection instance.
107 };111 };
108112
113 void on_self_id_changed(const std::string &self_id) override;
109 /// @brief on_message_without_chat_received implementation of messaging::Messaging::Observer method114 /// @brief on_message_without_chat_received implementation of messaging::Messaging::Observer method
110 void on_message_without_chat_received(const Recipient::shared_ptr& recipient, const Message &message) override;115 void on_message_without_chat_received(const Recipient::shared_ptr& recipient, const Message &message) override;
111116
112117
=== modified file 'src/messaging/connection.cpp'
--- src/messaging/connection.cpp 2016-10-24 10:12:54 +0000
+++ src/messaging/connection.cpp 2017-03-22 21:19:38 +0000
@@ -32,3 +32,8 @@
32{32{
33 impl->observer->on_status_changed(new_status, reason);33 impl->observer->on_status_changed(new_status, reason);
34}34}
35
36void messaging::Connection::announce_self_id_changed(const std::string &self_id)
37{
38 impl->observer->on_self_id_changed(self_id);
39}
3540
=== modified file 'src/messaging/plugin_connector.cpp'
--- src/messaging/plugin_connector.cpp 2016-06-07 18:15:24 +0000
+++ src/messaging/plugin_connector.cpp 2017-03-22 21:19:38 +0000
@@ -118,3 +118,8 @@
118{118{
119 connector->stop();119 connector->stop();
120}120}
121
122bool messaging::PluginConnector::network_monitor_enabled()
123{
124 connector->network_monitor_enabled();
125}
121126
=== modified file 'src/messaging/qt/network_monitor.cpp'
--- src/messaging/qt/network_monitor.cpp 2016-10-25 18:16:46 +0000
+++ src/messaging/qt/network_monitor.cpp 2017-03-22 21:19:38 +0000
@@ -8,14 +8,16 @@
88
9namespace mq = messaging::qt;9namespace mq = messaging::qt;
1010
11mq::NetworkMonitor::NetworkMonitor(const std::weak_ptr<Connection> &connection, QObject *parent)11mq::NetworkMonitor::NetworkMonitor(const std::weak_ptr<Connection> &connection, bool network_monitor_enabled, QObject *parent)
12 : QObject(parent)12 : QObject(parent)
13 , network_config_manager_{this}13 , network_config_manager_{this}
14 , connection_{connection}14 , connection_{connection}
15 , current_ssid_{}15 , current_ssid_{}
16 , is_connection_ready_{false}16 , is_connection_ready_{false}
17{17{
18 start_monitoring();18 if (network_monitor_enabled) {
19 start_monitoring();
20 }
19}21}
2022
21mq::NetworkMonitor::~NetworkMonitor()23mq::NetworkMonitor::~NetworkMonitor()
2224
=== modified file 'src/messaging/qt/tp/connection.cpp'
--- src/messaging/qt/tp/connection.cpp 2016-10-24 10:35:20 +0000
+++ src/messaging/qt/tp/connection.cpp 2017-03-22 21:19:38 +0000
@@ -57,6 +57,15 @@
57{57{
58}58}
5959
60void mqt::tp::Connection::Observer::on_self_id_changed(const std::string &self_id)
61{
62 auto sp = shared_from_this();
63 runtime->enter_with_task([sp, self_id]()
64 {
65 sp->connection->on_self_id_changed(self_id);
66 });
67}
68
60void mqt::tp::Connection::Observer::on_status_changed(messaging::Connection::Status new_status, messaging::Connection::StatusChangedReason reason)69void mqt::tp::Connection::Observer::on_status_changed(messaging::Connection::Status new_status, messaging::Connection::StatusChangedReason reason)
61{70{
62 auto sp = shared_from_this();71 auto sp = shared_from_this();
@@ -87,10 +96,16 @@
87void mqt::tp::Connection::Observer::on_new_group_invitation_received(const messaging::Group::shared_ptr& new_group)96void mqt::tp::Connection::Observer::on_new_group_invitation_received(const messaging::Group::shared_ptr& new_group)
88{97{
89 auto sp = shared_from_this();98 auto sp = shared_from_this();
90 runtime->enter_with_task([sp, new_group]()99 QMutex mutex;
100 QWaitCondition wait;
101
102 runtime->enter_with_task([sp, new_group, &mutex, &wait]()
91 {103 {
92 sp->connection->on_new_group_invitation_received(new_group);104 sp->connection->on_new_group_invitation_received(new_group);
105 wait.wakeAll();
106 mutex.unlock();
93 });107 });
108 wait.wait(&mutex);
94}109}
95110
96Tp::SharedPtr<mqt::tp::Connection> mqt::tp::Connection::create(const std::shared_ptr<msg::Connector>& connector,111Tp::SharedPtr<mqt::tp::Connection> mqt::tp::Connection::create(const std::shared_ptr<msg::Connector>& connector,
@@ -150,7 +165,7 @@
150 , connector{connector}165 , connector{connector}
151 , observer{std::make_shared<mqt::tp::Connection::Observer>(runtime, Tp::SharedPtr<mqt::tp::Connection>{this})}166 , observer{std::make_shared<mqt::tp::Connection::Observer>(runtime, Tp::SharedPtr<mqt::tp::Connection>{this})}
152 , connection{connector->request_connection(observer, observer, observer, mqt::VariantMapFacade{parameters})}167 , connection{connector->request_connection(observer, observer, observer, mqt::VariantMapFacade{parameters})}
153 , network_monitor_{connection}168 , network_monitor_{connection, connector->network_monitor_enabled()}
154{169{
155 qRegisterMetaType<messaging::Recipient::shared_ptr>();170 qRegisterMetaType<messaging::Recipient::shared_ptr>();
156171
@@ -256,8 +271,19 @@
256 {271 {
257 LOG(ERROR) << "An exception has been thrown when disconnecting framework connection implementation";272 LOG(ERROR) << "An exception has been thrown when disconnecting framework connection implementation";
258 }273 }
274
275 QTimer::singleShot(250, [=](){
276 dbusConnection().unregisterObject(objectPath(), QDBusConnection::UnregisterTree);
277 dbusConnection().unregisterService(busName());
278
279 });
259}280}
260 281
282void mqt::tp::Connection::on_self_id_changed(const std::string &self_id)
283{
284 setSelfID(self_id.c_str());
285}
286
261void mqt::tp::Connection::on_message_without_chat_received(const Recipient::shared_ptr& recipient, const messaging::Message &message)287void mqt::tp::Connection::on_message_without_chat_received(const Recipient::shared_ptr& recipient, const messaging::Message &message)
262{288{
263 if (recipient->type() != messaging::RecipientType::user) {289 if (recipient->type() != messaging::RecipientType::user) {
@@ -641,8 +667,13 @@
641 handles_.left.find(target_handle)->second.toLatin1().data());667 handles_.left.find(target_handle)->second.toLatin1().data());
642 break;668 break;
643 case Tp::HandleTypeRoom: {669 case Tp::HandleTypeRoom: {
670 messaging::Members initial_invitees;
671 initial_invitees.push_back(std::make_shared<Member>(connection->self_identifier(),
672 PendingStatus::Remote,
673 Flags<Role>(Role::Member),
674 std::string{}/* display_name*/ ));
644 recipient = std::make_shared<messaging::Group>(675 recipient = std::make_shared<messaging::Group>(
645 group_handles_.left.find(target_handle)->second.toLatin1().data());676 group_handles_.left.find(target_handle)->second.toLatin1().data(), initial_invitees);
646677
647 try678 try
648 {679 {
@@ -665,6 +696,10 @@
665 additional_properties[Group::SUBJECT] = std::make_shared<messaging::BoostVariant>(group_manager->group_subject());696 additional_properties[Group::SUBJECT] = std::make_shared<messaging::BoostVariant>(group_manager->group_subject());
666 }697 }
667 auto members = group_manager->members();698 auto members = group_manager->members();
699 members.push_back(std::make_shared<Member>(connection->self_identifier(),
700 PendingStatus::Remote,
701 Flags<Role>(Role::Member),
702 std::string{}/* display_name*/ ));
668 recipient = std::make_shared<messaging::Group>(703 recipient = std::make_shared<messaging::Group>(
669 group_manager->group_id(),704 group_manager->group_id(),
670 members,705 members,
@@ -719,6 +754,10 @@
719 is_room ? PendingStatus::Remote : PendingStatus::None,754 is_room ? PendingStatus::Remote : PendingStatus::None,
720 Flags<Role>(Role::Member),755 Flags<Role>(Role::Member),
721 std::string{}/* display_name*/ ));756 std::string{}/* display_name*/ ));
757 initial_invitees.push_back(std::make_shared<Member>(connection->self_identifier(),
758 PendingStatus::Remote,
759 Flags<Role>(Role::Member),
760 std::string{}/* display_name*/ ));
722 }761 }
723 }762 }
724763
725764
=== modified file 'src/messaging/qt/tp/protocol.cpp'
--- src/messaging/qt/tp/protocol.cpp 2016-05-20 06:21:33 +0000
+++ src/messaging/qt/tp/protocol.cpp 2017-03-22 21:19:38 +0000
@@ -43,7 +43,10 @@
4343
44Tp::ConnMgrParamFlags parameter_flags_to_qt_tp(const messaging::Parameter::Flags& flags)44Tp::ConnMgrParamFlags parameter_flags_to_qt_tp(const messaging::Parameter::Flags& flags)
45{45{
46 Tp::ConnMgrParamFlags result;46 Tp::ConnMgrParamFlags result = 0;
47 if (flags == messaging::Parameter::Flags::none) {
48 return result;
49 }
4750
48 if (FlagHelper<messaging::Parameter::Flags>::is_set_in<messaging::Parameter::Flags::required>(flags))51 if (FlagHelper<messaging::Parameter::Flags>::is_set_in<messaging::Parameter::Flags::required>(flags))
49 {52 {
5053
=== modified file 'src/messaging/qt/tp/text_channel.cpp'
--- src/messaging/qt/tp/text_channel.cpp 2016-10-19 09:19:08 +0000
+++ src/messaging/qt/tp/text_channel.cpp 2017-03-22 21:19:38 +0000
@@ -328,8 +328,7 @@
328 &error)[0];328 &error)[0];
329 if (error.isValid())329 if (error.isValid())
330 {330 {
331 LOG(ERROR) << "Could not get creator handle";331 LOG(WARNING) << "Could not get creator handle";
332 return;
333 }332 }
334333
335 // NOTE (rmescandon): Build and populate values for Subject interface before than roomConfig one. This is needed for having334 // NOTE (rmescandon): Build and populate values for Subject interface before than roomConfig one. This is needed for having
@@ -372,6 +371,7 @@
372 return;371 return;
373 }372 }
374373
374 room_config_interface->setPersistent(group_manager->persistent());
375 room_config_interface->setConfigurationRetrieved(true);375 room_config_interface->setConfigurationRetrieved(true);
376376
377 // As telepathy does not offer a way to differentiate whether it can be changed one configuration element377 // As telepathy does not offer a way to differentiate whether it can be changed one configuration element
@@ -386,6 +386,7 @@
386 Tp::ChannelGroupFlagProperties;386 Tp::ChannelGroupFlagProperties;
387 group_interface = Tp::BaseChannelGroupInterface::create();387 group_interface = Tp::BaseChannelGroupInterface::create();
388 group_interface->setGroupFlags(groupFlags);388 group_interface->setGroupFlags(groupFlags);
389 group_interface->setSelfHandle(tp_connection->selfHandle());
389390
390 roles_interface = interfaces::BaseChannelRolesInterface::create();391 roles_interface = interfaces::BaseChannelRolesInterface::create();
391392
@@ -406,6 +407,7 @@
406 Tp::ChannelGroupFlagProperties;407 Tp::ChannelGroupFlagProperties;
407 group_interface = Tp::BaseChannelGroupInterface::create();408 group_interface = Tp::BaseChannelGroupInterface::create();
408 group_interface->setGroupFlags(groupFlags);409 group_interface->setGroupFlags(groupFlags);
410 group_interface->setSelfHandle(tp_connection->selfHandle());
409411
410 // we need to plug this interface here to avoid a crash412 // we need to plug this interface here to avoid a crash
411 plug_interface_if_available(group_interface);413 plug_interface_if_available(group_interface);
@@ -817,7 +819,10 @@
817819
818 // selfHandle will be set as member while the channel is active, so add it to received members. In case we are820 // selfHandle will be set as member while the channel is active, so add it to received members. In case we are
819 // expelled or the group is dissolved, let's remove that selfHandle from members821 // expelled or the group is dissolved, let's remove that selfHandle from members
820 handles << tp_connection->selfHandle();822 uint selfHandle = tp_connection->selfHandle();
823 if (!remote_handles.contains(selfHandle) && !handles.contains(selfHandle)) {
824 handles << tp_connection->selfHandle();
825 }
821826
822 group_interface->setMembers(handles, local_info_list, remote_handles, /* details */ QVariantMap());827 group_interface->setMembers(handles, local_info_list, remote_handles, /* details */ QVariantMap());
823 if (!roles_interface.isNull())828 if (!roles_interface.isNull())
824829
=== modified file 'tests/mock_connection.h'
--- tests/mock_connection.h 2016-10-21 14:02:19 +0000
+++ tests/mock_connection.h 2017-03-22 21:19:38 +0000
@@ -37,6 +37,7 @@
37 struct MockObserver : public messaging::Connection::Observer37 struct MockObserver : public messaging::Connection::Observer
38 {38 {
39 MOCK_METHOD2(on_status_changed, void(messaging::Connection::Status, messaging::Connection::StatusChangedReason));39 MOCK_METHOD2(on_status_changed, void(messaging::Connection::Status, messaging::Connection::StatusChangedReason));
40 MOCK_METHOD1(on_self_id_changed, void(const std::string&));
40 };41 };
4142
42 MockConnection(const std::shared_ptr<messaging::Connection::Observer>& connection_observer,43 MockConnection(const std::shared_ptr<messaging::Connection::Observer>& connection_observer,
4344
=== modified file 'tests/mock_connector.h'
--- tests/mock_connector.h 2016-06-07 18:15:24 +0000
+++ tests/mock_connector.h 2017-03-22 21:19:38 +0000
@@ -44,6 +44,7 @@
44 const messaging::Dictionary<std::string, messaging::Variant>&));44 const messaging::Dictionary<std::string, messaging::Variant>&));
45 MOCK_METHOD0(run, void());45 MOCK_METHOD0(run, void());
46 MOCK_METHOD0(stop, void());46 MOCK_METHOD0(stop, void());
47 MOCK_METHOD0(network_monitor_enabled, bool());
4748
48private:49private:
49 messaging::StdVectorEnumerator<messaging::Parameter> params_;50 messaging::StdVectorEnumerator<messaging::Parameter> params_;
5051
=== modified file 'tests/mock_group_manager.h'
--- tests/mock_group_manager.h 2016-10-09 16:01:04 +0000
+++ tests/mock_group_manager.h 2017-03-22 21:19:38 +0000
@@ -40,6 +40,7 @@
40 MOCK_METHOD0(leave_group, void());40 MOCK_METHOD0(leave_group, void());
41 MOCK_METHOD0(dissolve_group, void());41 MOCK_METHOD0(dissolve_group, void());
42 MOCK_METHOD0(join_group, void());42 MOCK_METHOD0(join_group, void());
43 MOCK_METHOD0(persistent, bool());
43 MOCK_METHOD1(change_group_title, void(const std::string&));44 MOCK_METHOD1(change_group_title, void(const std::string&));
44 MOCK_METHOD1(change_group_subject, void(const std::string&));45 MOCK_METHOD1(change_group_subject, void(const std::string&));
45 MOCK_METHOD1(add_members, void(const messaging::Members&));46 MOCK_METHOD1(add_members, void(const messaging::Members&));
4647
=== modified file 'tests/unit/messaging/blocking_connector.cpp'
--- tests/unit/messaging/blocking_connector.cpp 2016-06-07 18:15:24 +0000
+++ tests/unit/messaging/blocking_connector.cpp 2017-03-22 21:19:38 +0000
@@ -48,3 +48,8 @@
48 stop_requested = true;48 stop_requested = true;
49 cv.notify_all();49 cv.notify_all();
50}50}
51
52bool testing::BlockingConnector::network_monitor_enabled()
53{
54 return true;
55}
5156
=== modified file 'tests/unit/messaging/blocking_connector.h'
--- tests/unit/messaging/blocking_connector.h 2016-06-07 18:15:24 +0000
+++ tests/unit/messaging/blocking_connector.h 2017-03-22 21:19:38 +0000
@@ -39,6 +39,7 @@
39 const messaging::Dictionary<std::string, messaging::Variant>&) override;39 const messaging::Dictionary<std::string, messaging::Variant>&) override;
40 void run() override;40 void run() override;
41 void stop() override;41 void stop() override;
42 bool network_monitor_enabled() override;
4243
43private:44private:
44 std::mutex m;45 std::mutex m;
4546
=== modified file 'tests/unit/messaging/plugin_connector_test.cpp'
--- tests/unit/messaging/plugin_connector_test.cpp 2016-06-07 18:15:24 +0000
+++ tests/unit/messaging/plugin_connector_test.cpp 2017-03-22 21:19:38 +0000
@@ -51,6 +51,11 @@
51 void stop() override51 void stop() override
52 {52 {
53 }53 }
54
55 bool network_monitor_enabled() override
56 {
57 return true;
58 }
54};59};
5560
56class Creator61class Creator
5762
=== modified file 'tests/unit/messaging/runner_test.cpp'
--- tests/unit/messaging/runner_test.cpp 2016-05-27 22:49:16 +0000
+++ tests/unit/messaging/runner_test.cpp 2017-03-22 21:19:38 +0000
@@ -73,6 +73,7 @@
7373
74 MOCK_METHOD0(run, int());74 MOCK_METHOD0(run, int());
75 MOCK_METHOD1(stop, void(int));75 MOCK_METHOD1(stop, void(int));
76 MOCK_METHOD0(network_manager_enabled, bool());
76};77};
7778
78/// @brief the_dummy_runner returns a functor executing a runner with a dummy configuration,79/// @brief the_dummy_runner returns a functor executing a runner with a dummy configuration,

Subscribers

People subscribed via source and target branches

to all changes: