Merge lp:~phablet-team/messaging-framework/notify-group-creation-rejected into lp:messaging-framework
- notify-group-creation-rejected
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Gustavo Pichorim Boiko |
Approved revision: | 30 |
Merged at revision: | 28 |
Proposed branch: | lp:~phablet-team/messaging-framework/notify-group-creation-rejected |
Merge into: | lp:messaging-framework |
Prerequisite: | lp:~phablet-team/messaging-framework/typing-notification-feature |
Diff against target: |
562 lines (+89/-142) 23 files modified
debian/changelog (+8/-0) include/messaging/connector.h (+0/-1) include/messaging/group_manager.h (+5/-0) include/messaging/group_starter.h (+2/-21) include/messaging/plugin_connector.h (+1/-2) include/messaging/qt/tp/connection.h (+0/-8) include/messaging/qt/tp/text_channel.h (+12/-0) src/CMakeLists.txt (+0/-1) src/messaging/group_manager.cpp (+13/-0) src/messaging/group_starter.cpp (+0/-42) src/messaging/plugin_connector.cpp (+1/-2) src/messaging/qt/tp/connection.cpp (+3/-31) src/messaging/qt/tp/text_channel.cpp (+38/-0) tests/CMakeLists.txt (+0/-1) tests/mock_connection.cpp (+2/-3) tests/mock_connection.h (+1/-2) tests/mock_connector.cpp (+2/-3) tests/mock_connector.h (+1/-3) tests/mock_group_starter.cpp (+0/-11) tests/mock_group_starter.h (+0/-8) tests/unit/messaging/blocking_connector.cpp (+0/-1) tests/unit/messaging/blocking_connector.h (+0/-1) tests/unit/messaging/plugin_connector_test.cpp (+0/-1) |
To merge this branch: | bzr merge lp:~phablet-team/messaging-framework/notify-group-creation-rejected |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gustavo Pichorim Boiko (community) | Approve | ||
PS Jenkins bot | continuous-integration | Pending | |
Review via email: mp+296738@code.launchpad.net |
Commit message
Moved callbacks
- on_group_created()
- on_group_
to GroupManager. They were previously in a GroupStarter observer but that does not make sense, since is into the textchannel where the callbacks for the result of creating the group in the server should be announced.
Now, if received on_group_
Description of the change
Moved callbacks
- on_group_created()
- on_group_
to GroupManager. They were previously in a GroupStarter observer but that does not make sense, since is into the textchannel where the callbacks for the result of creating the group in the server should be announced.
Now, if received on_group_
- 30. By Roberto Mier Escandon
-
updated changelog
Preview Diff
1 | === modified file 'debian/changelog' |
2 | --- debian/changelog 2016-06-07 02:05:40 +0000 |
3 | +++ debian/changelog 2016-06-08 15:37:53 +0000 |
4 | @@ -1,3 +1,11 @@ |
5 | +messaging-framework (0.1-1ubuntu13) vivid; urgency=medium |
6 | + |
7 | + * Session creation rejection removes self handle |
8 | + * Added signals to start and stop typing |
9 | + * Added code for telepathy to know when the plugin receives is_typing callback |
10 | + |
11 | + -- Roberto Mier Escandon <roberto.escandon@canonical.com> Wed, 08 Jun 2016 17:35:10 +0200 |
12 | + |
13 | messaging-framework (0.1-1ubuntu12) vivid; urgency=medium |
14 | |
15 | * Update members method in textchannel using isolated methods for adding and |
16 | |
17 | === modified file 'include/messaging/connector.h' |
18 | --- include/messaging/connector.h 2016-05-16 10:33:21 +0000 |
19 | +++ include/messaging/connector.h 2016-06-08 15:37:53 +0000 |
20 | @@ -55,7 +55,6 @@ |
21 | virtual std::shared_ptr<Connection> request_connection(const std::shared_ptr<messaging::Connection::Observer>& connection_observer, |
22 | const std::shared_ptr<messaging::Messenger::Observer>& messenger_observer, |
23 | const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer, |
24 | - const std::shared_ptr<messaging::GroupStarter::Observer>& group_starter_observer, |
25 | const messaging::Dictionary<std::string, messaging::Variant>& dict) = 0; |
26 | |
27 | protected: |
28 | |
29 | === modified file 'include/messaging/group_manager.h' |
30 | --- include/messaging/group_manager.h 2016-05-18 21:37:35 +0000 |
31 | +++ include/messaging/group_manager.h 2016-06-08 15:37:53 +0000 |
32 | @@ -39,6 +39,8 @@ |
33 | public: |
34 | virtual ~Observer() = default; |
35 | |
36 | + virtual void on_group_created() = 0; |
37 | + virtual void on_group_creation_rejected() = 0; |
38 | virtual void on_group_cancelled() = 0; |
39 | virtual void on_group_quit() = 0; |
40 | virtual void on_group_title_changed(const std::string& new_title, const User& actor, const std::chrono::system_clock::time_point& when) = 0; |
41 | @@ -78,6 +80,9 @@ |
42 | |
43 | void validate_observer(); |
44 | |
45 | + void announce_group_created(); |
46 | + //TODO TRACE maybe a reason as parameter for knowing the rejected cause? |
47 | + void announce_group_creation_rejected(); |
48 | void announce_group_cancelled(); |
49 | void announce_group_quit(); |
50 | void announce_group_title_changed(const std::string& new_title, |
51 | |
52 | === modified file 'include/messaging/group_starter.h' |
53 | --- include/messaging/group_starter.h 2016-05-17 10:57:36 +0000 |
54 | +++ include/messaging/group_starter.h 2016-06-08 15:37:53 +0000 |
55 | @@ -17,18 +17,7 @@ |
56 | class MESSAGING_FW_PUBLIC GroupStarter : public NonCopyable, NonMovable |
57 | { |
58 | public: |
59 | - /// @brief Observer provides means to monitor the state of a GroupStarter instance. |
60 | - class Observer : NonCopyable, NonMovable |
61 | - { |
62 | - public: |
63 | - virtual ~Observer() = default; |
64 | - |
65 | - virtual void on_group_created(const std::string& id) = 0; |
66 | - virtual void on_group_creation_rejected(const std::string& id) = 0; |
67 | - |
68 | - protected: |
69 | - Observer() = default; |
70 | - }; |
71 | + virtual ~GroupStarter() = default; |
72 | |
73 | /// @brief create_group initiate group from app |
74 | virtual std::shared_ptr<GroupManager> create_group(const std::shared_ptr<Group> &group) = 0; |
75 | @@ -41,15 +30,7 @@ |
76 | |
77 | protected: |
78 | /// @brief GroupStarter constructs a new instance. |
79 | - GroupStarter(const std::shared_ptr<Observer> &observer); |
80 | - |
81 | - void announce_group_created(const std::string& id); |
82 | - void announce_group_creation_rejected(const std::string& id); |
83 | - |
84 | - /// @cond |
85 | - struct Private; |
86 | - std::shared_ptr<Private> impl; |
87 | - /// @endcond |
88 | + GroupStarter() = default; |
89 | }; |
90 | |
91 | } |
92 | |
93 | === modified file 'include/messaging/plugin_connector.h' |
94 | --- include/messaging/plugin_connector.h 2016-05-16 10:33:21 +0000 |
95 | +++ include/messaging/plugin_connector.h 2016-06-08 15:37:53 +0000 |
96 | @@ -85,8 +85,7 @@ |
97 | std::shared_ptr<Connection> request_connection(const std::shared_ptr<messaging::Connection::Observer>& connection_observer, |
98 | const std::shared_ptr<messaging::Messenger::Observer>& messenger_observer, |
99 | const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer, |
100 | - const std::shared_ptr<messaging::GroupStarter::Observer>& group_starter_observer, |
101 | - const messaging::Dictionary<std::string, messaging::Variant>& dict) override; |
102 | + const messaging::Dictionary<std::string, messaging::Variant>& dict) override; |
103 | |
104 | private: |
105 | std::shared_ptr<NamedSymbolLoader> named_symbol_loader; |
106 | |
107 | === modified file 'include/messaging/qt/tp/connection.h' |
108 | --- include/messaging/qt/tp/connection.h 2016-05-16 18:12:38 +0000 |
109 | +++ include/messaging/qt/tp/connection.h 2016-06-08 15:37:53 +0000 |
110 | @@ -48,7 +48,6 @@ |
111 | , public messaging::Connection::Observer |
112 | , public messaging::Messenger::Observer |
113 | , public messaging::PresenceManager::Observer |
114 | - , public messaging::GroupStarter::Observer |
115 | { |
116 | Q_OBJECT |
117 | public: |
118 | @@ -77,7 +76,6 @@ |
119 | : public messaging::Connection::Observer |
120 | , public messaging::Messenger::Observer |
121 | , public messaging::PresenceManager::Observer |
122 | - , public messaging::GroupStarter::Observer |
123 | , public std::enable_shared_from_this<Observer> |
124 | { |
125 | public: |
126 | @@ -99,9 +97,6 @@ |
127 | void on_new_group_invitation_received(const messaging::Recipient::shared_ptr& new_group, |
128 | const messaging::Recipient::shared_ptr& initiator) override; |
129 | |
130 | - void on_group_created(const std::string& id) override; |
131 | - void on_group_creation_rejected(const std::string& id) override; |
132 | - |
133 | private: |
134 | std::shared_ptr<qt::Runtime> runtime; ///< The qt::Runtime instance that we dispatch to. |
135 | Tp::SharedPtr<Connection> connection; ///< The managed connection instance. |
136 | @@ -126,9 +121,6 @@ |
137 | void on_new_group_invitation_received(const messaging::Recipient::shared_ptr& new_group, |
138 | const messaging::Recipient::shared_ptr& initiator) override; |
139 | |
140 | - void on_group_created(const std::string& id) override; |
141 | - void on_group_creation_rejected(const std::string& id) override; |
142 | - |
143 | /// @brief Creates a new instance for the given parameters, setting up |
144 | /// fixed and optional properties supported on this connection. |
145 | Connection(const std::shared_ptr<Connector>& connector, |
146 | |
147 | === modified file 'include/messaging/qt/tp/text_channel.h' |
148 | --- include/messaging/qt/tp/text_channel.h 2016-06-08 15:37:53 +0000 |
149 | +++ include/messaging/qt/tp/text_channel.h 2016-06-08 15:37:53 +0000 |
150 | @@ -72,6 +72,12 @@ |
151 | /// @brief on_closed received when the chat is no longer valid |
152 | void on_closed() override; |
153 | |
154 | + /// @brief on_group_created when the group has been created ok in the server |
155 | + void on_group_created() override; |
156 | + |
157 | + /// @brief on_group_creation_rejected when the group creation has been rejected by the server |
158 | + void on_group_creation_rejected() override; |
159 | + |
160 | /// @brief on_group_cancelled when the group is no longer valid |
161 | void on_group_cancelled() override; |
162 | |
163 | @@ -137,6 +143,12 @@ |
164 | /// @brief on_closed received when the chat is no longer valid and must be disposed. |
165 | void on_closed() override; |
166 | |
167 | + /// @brief on_group_created when the group has been created ok in the server |
168 | + void on_group_created() override; |
169 | + |
170 | + /// @brief on_group_creation_rejected when the group creation has been rejected by the server |
171 | + void on_group_creation_rejected() override; |
172 | + |
173 | /// @brief on_group_cancelled when the group is no longer valid |
174 | void on_group_cancelled() override; |
175 | |
176 | |
177 | === modified file 'src/CMakeLists.txt' |
178 | --- src/CMakeLists.txt 2016-05-30 16:43:03 +0000 |
179 | +++ src/CMakeLists.txt 2016-06-08 15:37:53 +0000 |
180 | @@ -14,7 +14,6 @@ |
181 | messaging/chat.cpp |
182 | messaging/group.cpp |
183 | messaging/group_manager.cpp |
184 | - messaging/group_starter.cpp |
185 | messaging/has_interfaces.cpp |
186 | messaging/connection.cpp |
187 | messaging/connector_factory_initializer.cpp |
188 | |
189 | === modified file 'src/messaging/group_manager.cpp' |
190 | --- src/messaging/group_manager.cpp 2016-05-16 13:13:01 +0000 |
191 | +++ src/messaging/group_manager.cpp 2016-06-08 15:37:53 +0000 |
192 | @@ -40,6 +40,19 @@ |
193 | } |
194 | } |
195 | |
196 | +void messaging::GroupManager::announce_group_created() |
197 | +{ |
198 | + validate_observer(); |
199 | + impl->observer->on_group_created(); |
200 | +} |
201 | + |
202 | +void messaging::GroupManager::announce_group_creation_rejected() |
203 | +{ |
204 | + validate_observer(); |
205 | + impl->observer->on_group_creation_rejected(); |
206 | +} |
207 | + |
208 | + |
209 | void messaging::GroupManager::announce_group_cancelled() |
210 | { |
211 | validate_observer(); |
212 | |
213 | === removed file 'src/messaging/group_starter.cpp' |
214 | --- src/messaging/group_starter.cpp 2016-05-16 18:12:38 +0000 |
215 | +++ src/messaging/group_starter.cpp 1970-01-01 00:00:00 +0000 |
216 | @@ -1,42 +0,0 @@ |
217 | -/* |
218 | - * Copyright © 2016 Canonical Ltd. |
219 | - * |
220 | - * This program is free software: you can redistribute it and/or modify it |
221 | - * under the terms of the GNU Lesser General Public License version 3, |
222 | - * as published by the Free Software Foundation. |
223 | - * |
224 | - * This program is distributed in the hope that it will be useful, |
225 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
226 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
227 | - * GNU Lesser General Public License for more details. |
228 | - * |
229 | - * You should have received a copy of the GNU Lesser General Public License |
230 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
231 | - */ |
232 | - |
233 | -#include <messaging/group_starter.h> |
234 | - |
235 | -class messaging::GroupStarter::Private |
236 | -{ |
237 | -public: |
238 | - Private(const std::shared_ptr<messaging::GroupStarter::Observer>& obs) |
239 | - : observer{obs} {} |
240 | - ~Private() {} |
241 | - |
242 | - std::shared_ptr<messaging::GroupStarter::Observer> observer; |
243 | -}; |
244 | - |
245 | -messaging::GroupStarter::GroupStarter(const std::shared_ptr<messaging::GroupStarter::Observer>& observer) |
246 | - : impl{new Private{observer}} |
247 | -{ |
248 | -} |
249 | - |
250 | -void messaging::GroupStarter::announce_group_created(const std::string& id) |
251 | -{ |
252 | - impl->observer->on_group_created(id); |
253 | -} |
254 | - |
255 | -void messaging::GroupStarter::announce_group_creation_rejected(const std::string& id) |
256 | -{ |
257 | - impl->observer->on_group_creation_rejected(id); |
258 | -} |
259 | |
260 | === modified file 'src/messaging/plugin_connector.cpp' |
261 | --- src/messaging/plugin_connector.cpp 2016-05-16 10:33:21 +0000 |
262 | +++ src/messaging/plugin_connector.cpp 2016-06-08 15:37:53 +0000 |
263 | @@ -104,10 +104,9 @@ |
264 | const std::shared_ptr<messaging::Connection::Observer>& connection_observer, |
265 | const std::shared_ptr<messaging::Messenger::Observer>& messenger_observer, |
266 | const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer, |
267 | - const std::shared_ptr<messaging::GroupStarter::Observer>& group_starter_observer, |
268 | const messaging::Dictionary<std::string, messaging::Variant>& dict) |
269 | { |
270 | - return connector->request_connection(connection_observer, messenger_observer, presence_observer, group_starter_observer, dict); |
271 | + return connector->request_connection(connection_observer, messenger_observer, presence_observer, dict); |
272 | } |
273 | |
274 | void messaging::PluginConnector::run() |
275 | |
276 | === modified file 'src/messaging/qt/tp/connection.cpp' |
277 | --- src/messaging/qt/tp/connection.cpp 2016-06-02 16:53:11 +0000 |
278 | +++ src/messaging/qt/tp/connection.cpp 2016-06-08 15:37:53 +0000 |
279 | @@ -31,6 +31,8 @@ |
280 | |
281 | #include <iostream> |
282 | |
283 | +#include <glog/logging.h> |
284 | + |
285 | #define MQT_TP_RECIPIENT "messaging-framework-qt-tp-recipient" |
286 | |
287 | Q_DECLARE_METATYPE(messaging::Recipient::shared_ptr) |
288 | @@ -86,22 +88,6 @@ |
289 | }); |
290 | } |
291 | |
292 | -void mqt::tp::Connection::Observer::on_group_created(const std::string &id) |
293 | -{ |
294 | - auto sp = shared_from_this(); |
295 | - runtime->enter_with_task([sp, id](){ |
296 | - sp->connection->on_group_created(id); |
297 | - }); |
298 | -} |
299 | - |
300 | -void mqt::tp::Connection::Observer::on_group_creation_rejected(const std::string &id) |
301 | -{ |
302 | - auto sp = shared_from_this(); |
303 | - runtime->enter_with_task([sp, id](){ |
304 | - sp->connection->on_group_creation_rejected(id); |
305 | - }); |
306 | -} |
307 | - |
308 | Tp::SharedPtr<mqt::tp::Connection> mqt::tp::Connection::create(const std::shared_ptr<msg::Connector>& connector, |
309 | const std::shared_ptr<mqt::Runtime>& runtime, |
310 | const QString& connection_manager_name, |
311 | @@ -158,7 +144,7 @@ |
312 | , runtime{runtime} |
313 | , connector{connector} |
314 | , observer{std::make_shared<mqt::tp::Connection::Observer>(runtime, Tp::SharedPtr<mqt::tp::Connection>{this})} |
315 | - , connection{connector->request_connection(observer, observer, observer, observer, mqt::VariantMapFacade{parameters})} |
316 | + , connection{connector->request_connection(observer, observer, observer, mqt::VariantMapFacade{parameters})} |
317 | { |
318 | qRegisterMetaType<messaging::Recipient::shared_ptr>(); |
319 | |
320 | @@ -346,20 +332,6 @@ |
321 | } |
322 | } |
323 | |
324 | -//TODO TRACE |
325 | -#include <glog/logging.h> |
326 | -void mqt::tp::Connection::on_group_created(const std::string &id) |
327 | -{ |
328 | - //TODO IMPLEMENT |
329 | - LOG(INFO) << __PRETTY_FUNCTION__ << " id:" << id; |
330 | -} |
331 | - |
332 | -void mqt::tp::Connection::on_group_creation_rejected(const std::string &id) |
333 | -{ |
334 | - //TODO IMPLEMENT |
335 | - LOG(INFO) << __PRETTY_FUNCTION__ << " id:" << id; |
336 | -} |
337 | - |
338 | void mqt::tp::Connection::connect(Tp::DBusError* error) noexcept(true) |
339 | { |
340 | try |
341 | |
342 | === modified file 'src/messaging/qt/tp/text_channel.cpp' |
343 | --- src/messaging/qt/tp/text_channel.cpp 2016-06-08 15:37:53 +0000 |
344 | +++ src/messaging/qt/tp/text_channel.cpp 2016-06-08 15:37:53 +0000 |
345 | @@ -160,6 +160,22 @@ |
346 | }); |
347 | } |
348 | |
349 | +void mqt::tp::TextChannel::Observer::on_group_created() |
350 | +{ |
351 | + auto sp = shared_from_this(); |
352 | + runtime->enter_with_task([sp](){ |
353 | + sp->tc->on_group_created(); |
354 | + }); |
355 | +} |
356 | + |
357 | +void mqt::tp::TextChannel::Observer::on_group_creation_rejected() |
358 | +{ |
359 | + auto sp = shared_from_this(); |
360 | + runtime->enter_with_task([sp](){ |
361 | + sp->tc->on_group_creation_rejected(); |
362 | + }); |
363 | +} |
364 | + |
365 | void mqt::tp::TextChannel::Observer::on_group_cancelled() |
366 | { |
367 | auto thiz = shared_from_this(); |
368 | @@ -484,6 +500,28 @@ |
369 | close(); |
370 | } |
371 | |
372 | +void mqt::tp::TextChannel::on_group_created() |
373 | +{ |
374 | + LOG(INFO) << __PRETTY_FUNCTION__; |
375 | +} |
376 | + |
377 | +void mqt::tp::TextChannel::on_group_creation_rejected() |
378 | +{ |
379 | + LOG(INFO) << __PRETTY_FUNCTION__ ; |
380 | + // Note (rmescandon): at this point, self handle should be removed from the group members, providing one of the reasons |
381 | + // described at: |
382 | + // https://telepathy.freedesktop.org/spec/Channel_Interface_Group.html#Enum:Channel_Group_Change_Reason |
383 | + // |
384 | + // but this should be done using RemoveMembersWithReason method described at spec: |
385 | + // https://telepathy.freedesktop.org/spec/Channel_Interface_Group.html#Method:RemoveMembersWithReason |
386 | + // |
387 | + // still not implemented in telepathy qt |
388 | + // |
389 | + // The alternative is only removing selfHandle from members |
390 | + bcgi->removeMembers(Tp::UIntList() << tp_connection->selfHandle()); |
391 | +} |
392 | + |
393 | + |
394 | void mqt::tp::TextChannel::on_group_cancelled() |
395 | { |
396 | close(); |
397 | |
398 | === modified file 'tests/CMakeLists.txt' |
399 | --- tests/CMakeLists.txt 2016-05-19 11:56:55 +0000 |
400 | +++ tests/CMakeLists.txt 2016-06-08 15:37:53 +0000 |
401 | @@ -38,7 +38,6 @@ |
402 | mock_messenger.cpp |
403 | mock_connection.cpp |
404 | mock_connector.cpp |
405 | - mock_group_starter.cpp |
406 | ) |
407 | |
408 | # make the .h files visible on qtcreator |
409 | |
410 | === modified file 'tests/mock_connection.cpp' |
411 | --- tests/mock_connection.cpp 2016-05-19 11:56:55 +0000 |
412 | +++ tests/mock_connection.cpp 2016-06-08 15:37:53 +0000 |
413 | @@ -21,12 +21,11 @@ |
414 | |
415 | MockConnection::MockConnection(const std::shared_ptr<messaging::Connection::Observer>& connection_observer, |
416 | const std::shared_ptr<messaging::Messenger::Observer>& messenger_observer, |
417 | - const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer, |
418 | - const std::shared_ptr<messaging::GroupStarter::Observer>& group_starter_observer) |
419 | + const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer) |
420 | : messaging::Connection{connection_observer} |
421 | , mock_messenger_{std::make_shared<NiceMock<MockMessenger>>(messenger_observer)} |
422 | , mock_presence_manager_{std::make_shared<NiceMock<MockPresenceManager>>(presence_observer)} |
423 | - , mock_group_starter_{std::make_shared<NiceMock<MockGroupStarter>>(group_starter_observer)} |
424 | + , mock_group_starter_{std::make_shared<NiceMock<MockGroupStarter>>()} |
425 | { |
426 | ON_CALL(*this, connect()).WillByDefault(Invoke(this, &MockConnection::fake_connect)); |
427 | ON_CALL(*this, presence_manager()).WillByDefault(Invoke(this, &MockConnection::fake_presence_manager)); |
428 | |
429 | === modified file 'tests/mock_connection.h' |
430 | --- tests/mock_connection.h 2016-05-19 11:56:55 +0000 |
431 | +++ tests/mock_connection.h 2016-06-08 15:37:53 +0000 |
432 | @@ -41,8 +41,7 @@ |
433 | |
434 | MockConnection(const std::shared_ptr<messaging::Connection::Observer>& connection_observer, |
435 | const std::shared_ptr<messaging::Messenger::Observer>& messenger_observer, |
436 | - const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer, |
437 | - const std::shared_ptr<messaging::GroupStarter::Observer>& group_starter_observer); |
438 | + const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer); |
439 | |
440 | void announce_status_connected(); |
441 | |
442 | |
443 | === modified file 'tests/mock_connector.cpp' |
444 | --- tests/mock_connector.cpp 2016-05-19 11:56:55 +0000 |
445 | +++ tests/mock_connector.cpp 2016-06-08 15:37:53 +0000 |
446 | @@ -23,17 +23,16 @@ |
447 | MockConnector::MockConnector() |
448 | { |
449 | ON_CALL(*this, parameters()).WillByDefault(ReturnRef(params_)); |
450 | - ON_CALL(*this, request_connection(_,_,_,_,_)).WillByDefault(Invoke(this, &MockConnector::fake_request_connection)); |
451 | + ON_CALL(*this, request_connection(_,_,_,_)).WillByDefault(Invoke(this, &MockConnector::fake_request_connection)); |
452 | } |
453 | |
454 | std::shared_ptr<messaging::Connection> MockConnector::fake_request_connection( |
455 | const std::shared_ptr<messaging::Connection::Observer>& connection_observer, |
456 | const std::shared_ptr<messaging::Messenger::Observer>& messenger_observer, |
457 | const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer, |
458 | - const std::shared_ptr<messaging::GroupStarter::Observer>& group_starter_observer, |
459 | const messaging::Dictionary<std::string, messaging::Variant>&) |
460 | { |
461 | - return std::make_shared<NiceMock<MockConnection>>(connection_observer, messenger_observer, presence_observer, group_starter_observer); |
462 | + return std::make_shared<NiceMock<MockConnection>>(connection_observer, messenger_observer, presence_observer); |
463 | } |
464 | |
465 | } |
466 | |
467 | === modified file 'tests/mock_connector.h' |
468 | --- tests/mock_connector.h 2016-05-19 11:56:55 +0000 |
469 | +++ tests/mock_connector.h 2016-06-08 15:37:53 +0000 |
470 | @@ -36,12 +36,11 @@ |
471 | MockConnector(); |
472 | |
473 | MOCK_CONST_METHOD0(parameters, const messaging::Enumerator<messaging::Parameter>&()); |
474 | - MOCK_METHOD5(request_connection, |
475 | + MOCK_METHOD4(request_connection, |
476 | std::shared_ptr<messaging::Connection>( |
477 | const std::shared_ptr<messaging::Connection::Observer>& connection_observer, |
478 | const std::shared_ptr<messaging::Messenger::Observer>& messenger_observer, |
479 | const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer, |
480 | - const std::shared_ptr<messaging::GroupStarter::Observer>& group_starter_observer, |
481 | const messaging::Dictionary<std::string, messaging::Variant>&)); |
482 | MOCK_METHOD0(run, void()); |
483 | MOCK_METHOD0(stop, void()); |
484 | @@ -53,7 +52,6 @@ |
485 | const std::shared_ptr<messaging::Connection::Observer>& connection_observer, |
486 | const std::shared_ptr<messaging::Messenger::Observer>& messenger_observer, |
487 | const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer, |
488 | - const std::shared_ptr<messaging::GroupStarter::Observer>& group_starter_observer, |
489 | const messaging::Dictionary<std::string, messaging::Variant>&); |
490 | }; |
491 | |
492 | |
493 | === removed file 'tests/mock_group_starter.cpp' |
494 | --- tests/mock_group_starter.cpp 2016-05-19 11:56:55 +0000 |
495 | +++ tests/mock_group_starter.cpp 1970-01-01 00:00:00 +0000 |
496 | @@ -1,11 +0,0 @@ |
497 | -#include <tests/mock_group_starter.h> |
498 | - |
499 | -namespace testing |
500 | -{ |
501 | - |
502 | -MockGroupStarter::MockGroupStarter(const std::shared_ptr<messaging::GroupStarter::Observer>& observer) |
503 | - : messaging::GroupStarter{observer} |
504 | -{ |
505 | -} |
506 | - |
507 | -} |
508 | |
509 | === modified file 'tests/mock_group_starter.h' |
510 | --- tests/mock_group_starter.h 2016-05-19 11:56:55 +0000 |
511 | +++ tests/mock_group_starter.h 2016-06-08 15:37:53 +0000 |
512 | @@ -13,14 +13,6 @@ |
513 | class MockGroupStarter : public messaging::GroupStarter |
514 | { |
515 | public: |
516 | - struct MockObserver : public messaging::GroupStarter::Observer |
517 | - { |
518 | - MOCK_METHOD1(on_group_created, void(const std::string& id)); |
519 | - MOCK_METHOD1(on_group_creation_rejected, void(const std::string& id)); |
520 | - }; |
521 | - |
522 | - MockGroupStarter(const std::shared_ptr<messaging::GroupStarter::Observer>& observer); |
523 | - |
524 | MOCK_METHOD1(create_group, std::shared_ptr<messaging::GroupManager>(const std::shared_ptr<messaging::Group>&)); |
525 | MOCK_METHOD1(accept_group, std::shared_ptr<messaging::GroupManager>(const std::shared_ptr<messaging::Group>&)); |
526 | MOCK_METHOD1(rejoin_group, std::shared_ptr<messaging::GroupManager>(const std::shared_ptr<messaging::Group>&)); |
527 | |
528 | === modified file 'tests/unit/messaging/blocking_connector.cpp' |
529 | --- tests/unit/messaging/blocking_connector.cpp 2016-05-19 11:56:55 +0000 |
530 | +++ tests/unit/messaging/blocking_connector.cpp 2016-06-08 15:37:53 +0000 |
531 | @@ -27,7 +27,6 @@ |
532 | const std::shared_ptr<messaging::Connection::Observer>&, |
533 | const std::shared_ptr<messaging::Messenger::Observer>&, |
534 | const std::shared_ptr<messaging::PresenceManager::Observer>&, |
535 | - const std::shared_ptr<messaging::GroupStarter::Observer>&, |
536 | const messaging::Dictionary<std::string, messaging::Variant>&) |
537 | { |
538 | throw std::logic_error{"Not implemented"}; |
539 | |
540 | === modified file 'tests/unit/messaging/blocking_connector.h' |
541 | --- tests/unit/messaging/blocking_connector.h 2016-05-19 11:56:55 +0000 |
542 | +++ tests/unit/messaging/blocking_connector.h 2016-06-08 15:37:53 +0000 |
543 | @@ -36,7 +36,6 @@ |
544 | const std::shared_ptr<messaging::Connection::Observer>& connection_observer, |
545 | const std::shared_ptr<messaging::Messenger::Observer>& messaging_observer, |
546 | const std::shared_ptr<messaging::PresenceManager::Observer>& presence_observer, |
547 | - const std::shared_ptr<messaging::GroupStarter::Observer>& group_starter_observer, |
548 | const messaging::Dictionary<std::string, messaging::Variant>&) override; |
549 | void run() override; |
550 | void stop() override; |
551 | |
552 | === modified file 'tests/unit/messaging/plugin_connector_test.cpp' |
553 | --- tests/unit/messaging/plugin_connector_test.cpp 2016-05-19 11:56:55 +0000 |
554 | +++ tests/unit/messaging/plugin_connector_test.cpp 2016-06-08 15:37:53 +0000 |
555 | @@ -39,7 +39,6 @@ |
556 | const std::shared_ptr<messaging::Connection::Observer>&, |
557 | const std::shared_ptr<messaging::Messenger::Observer>&, |
558 | const std::shared_ptr<messaging::PresenceManager::Observer>&, |
559 | - const std::shared_ptr<messaging::GroupStarter::Observer>&, |
560 | const messaging::Dictionary<std::string, messaging::Variant>&) override |
561 | { |
562 | throw std::logic_error{"Not implemented."}; |
Looks good!