Merge lp:~phablet-team/mfw-plugin-irc/dummy-branch into lp:mfw-plugin-irc
- dummy-branch
- Merge into trunk
Status: | Approved |
---|---|
Approved by: | Gustavo Pichorim Boiko |
Approved revision: | 21 |
Proposed branch: | lp:~phablet-team/mfw-plugin-irc/dummy-branch |
Merge into: | lp:mfw-plugin-irc |
Diff against target: |
674 lines (+308/-33) 16 files modified
.bzr-builddeb/default.conf (+2/-0) COPYING (+165/-0) data/irc.protocol.in (+5/-0) data/irc.service.in (+1/-1) debian/changelog (+1/-1) debian/control (+6/-9) debian/source/format (+0/-1) include/irc/connection.h (+1/-0) include/irc/group_chat.h (+5/-0) include/irc/group_manager.h (+1/-2) include/irc/messenger.h (+5/-2) src/CMakeLists.txt (+1/-1) src/irc/connection.cpp (+31/-8) src/irc/group_chat.cpp (+9/-1) src/irc/group_manager.cpp (+53/-4) src/irc/messenger.cpp (+22/-3) |
To merge this branch: | bzr merge lp:~phablet-team/mfw-plugin-irc/dummy-branch |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gustavo Pichorim Boiko (community) | Approve | ||
Review via email: mp+313489@code.launchpad.net |
Commit message
Finish the basic implementation of an IRC plugin.
Description of the change
Finish the basic implementation of an IRC plugin.
- 2. By Tiago Salem Herrmann
-
fix control file
- 3. By Tiago Salem Herrmann
-
remove some build deps not needed by this package
- 4. By Tiago Salem Herrmann
-
enable return to send on messaging-app
- 5. By Tiago Salem Herrmann
-
Enable Attachments
- 6. By Tiago Salem Herrmann
-
Add EnableRejoin property
- 7. By Tiago Salem Herrmann
-
Fix leaving and rejoing channels
- 8. By Tiago Salem Herrmann
-
add property EnableTabCompletion
- 9. By Tiago Salem Herrmann
-
try different nicknames on collision
- 10. By Tiago Salem Herrmann
-
Add property: LeaveRoomsOnClose
- 11. By Tiago Salem Herrmann
-
Set self contact as remote
- 12. By Tiago Salem Herrmann
-
Force self contact to be always the last
- 13. By Tiago Salem Herrmann
-
If we just joined the channel, put our state as RemotePending
- 14. By Gustavo Pichorim Boiko
-
Keep the self contact as pending while reporting users.
- 15. By Tiago Salem Herrmann
-
Emit a separate signal to move self contact to the final members list
- 16. By Tiago Salem Herrmann
-
add random ids to messages
- 17. By Tiago Salem Herrmann
-
add fallback values
- 18. By Tiago Salem Herrmann
-
move self contact to pending list before removing other members
- 19. By Tiago Salem Herrmann
-
Add persistent property
- 20. By Ken VanDine
-
packaging cleanup
- 21. By Tiago Salem Herrmann
-
Move plugins to a separate directory
Unmerged revisions
- 21. By Tiago Salem Herrmann
-
Move plugins to a separate directory
- 20. By Ken VanDine
-
packaging cleanup
- 19. By Tiago Salem Herrmann
-
Add persistent property
- 18. By Tiago Salem Herrmann
-
move self contact to pending list before removing other members
- 17. By Tiago Salem Herrmann
-
add fallback values
- 16. By Tiago Salem Herrmann
-
add random ids to messages
- 15. By Tiago Salem Herrmann
-
Emit a separate signal to move self contact to the final members list
- 14. By Gustavo Pichorim Boiko
-
Keep the self contact as pending while reporting users.
- 13. By Tiago Salem Herrmann
-
If we just joined the channel, put our state as RemotePending
- 12. By Tiago Salem Herrmann
-
Force self contact to be always the last
Preview Diff
1 | === added directory '.bzr-builddeb' | |||
2 | === added file '.bzr-builddeb/default.conf' | |||
3 | --- .bzr-builddeb/default.conf 1970-01-01 00:00:00 +0000 | |||
4 | +++ .bzr-builddeb/default.conf 2017-03-22 14:38:33 +0000 | |||
5 | @@ -0,0 +1,2 @@ | |||
6 | 1 | [BUILDDEB] | ||
7 | 2 | split = True | ||
8 | 0 | 3 | ||
9 | === added file 'COPYING' | |||
10 | --- COPYING 1970-01-01 00:00:00 +0000 | |||
11 | +++ COPYING 2017-03-22 14:38:33 +0000 | |||
12 | @@ -0,0 +1,165 @@ | |||
13 | 1 | GNU LESSER GENERAL PUBLIC LICENSE | ||
14 | 2 | Version 3, 29 June 2007 | ||
15 | 3 | |||
16 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | ||
17 | 5 | Everyone is permitted to copy and distribute verbatim copies | ||
18 | 6 | of this license document, but changing it is not allowed. | ||
19 | 7 | |||
20 | 8 | |||
21 | 9 | This version of the GNU Lesser General Public License incorporates | ||
22 | 10 | the terms and conditions of version 3 of the GNU General Public | ||
23 | 11 | License, supplemented by the additional permissions listed below. | ||
24 | 12 | |||
25 | 13 | 0. Additional Definitions. | ||
26 | 14 | |||
27 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser | ||
28 | 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU | ||
29 | 17 | General Public License. | ||
30 | 18 | |||
31 | 19 | "The Library" refers to a covered work governed by this License, | ||
32 | 20 | other than an Application or a Combined Work as defined below. | ||
33 | 21 | |||
34 | 22 | An "Application" is any work that makes use of an interface provided | ||
35 | 23 | by the Library, but which is not otherwise based on the Library. | ||
36 | 24 | Defining a subclass of a class defined by the Library is deemed a mode | ||
37 | 25 | of using an interface provided by the Library. | ||
38 | 26 | |||
39 | 27 | A "Combined Work" is a work produced by combining or linking an | ||
40 | 28 | Application with the Library. The particular version of the Library | ||
41 | 29 | with which the Combined Work was made is also called the "Linked | ||
42 | 30 | Version". | ||
43 | 31 | |||
44 | 32 | The "Minimal Corresponding Source" for a Combined Work means the | ||
45 | 33 | Corresponding Source for the Combined Work, excluding any source code | ||
46 | 34 | for portions of the Combined Work that, considered in isolation, are | ||
47 | 35 | based on the Application, and not on the Linked Version. | ||
48 | 36 | |||
49 | 37 | The "Corresponding Application Code" for a Combined Work means the | ||
50 | 38 | object code and/or source code for the Application, including any data | ||
51 | 39 | and utility programs needed for reproducing the Combined Work from the | ||
52 | 40 | Application, but excluding the System Libraries of the Combined Work. | ||
53 | 41 | |||
54 | 42 | 1. Exception to Section 3 of the GNU GPL. | ||
55 | 43 | |||
56 | 44 | You may convey a covered work under sections 3 and 4 of this License | ||
57 | 45 | without being bound by section 3 of the GNU GPL. | ||
58 | 46 | |||
59 | 47 | 2. Conveying Modified Versions. | ||
60 | 48 | |||
61 | 49 | If you modify a copy of the Library, and, in your modifications, a | ||
62 | 50 | facility refers to a function or data to be supplied by an Application | ||
63 | 51 | that uses the facility (other than as an argument passed when the | ||
64 | 52 | facility is invoked), then you may convey a copy of the modified | ||
65 | 53 | version: | ||
66 | 54 | |||
67 | 55 | a) under this License, provided that you make a good faith effort to | ||
68 | 56 | ensure that, in the event an Application does not supply the | ||
69 | 57 | function or data, the facility still operates, and performs | ||
70 | 58 | whatever part of its purpose remains meaningful, or | ||
71 | 59 | |||
72 | 60 | b) under the GNU GPL, with none of the additional permissions of | ||
73 | 61 | this License applicable to that copy. | ||
74 | 62 | |||
75 | 63 | 3. Object Code Incorporating Material from Library Header Files. | ||
76 | 64 | |||
77 | 65 | The object code form of an Application may incorporate material from | ||
78 | 66 | a header file that is part of the Library. You may convey such object | ||
79 | 67 | code under terms of your choice, provided that, if the incorporated | ||
80 | 68 | material is not limited to numerical parameters, data structure | ||
81 | 69 | layouts and accessors, or small macros, inline functions and templates | ||
82 | 70 | (ten or fewer lines in length), you do both of the following: | ||
83 | 71 | |||
84 | 72 | a) Give prominent notice with each copy of the object code that the | ||
85 | 73 | Library is used in it and that the Library and its use are | ||
86 | 74 | covered by this License. | ||
87 | 75 | |||
88 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license | ||
89 | 77 | document. | ||
90 | 78 | |||
91 | 79 | 4. Combined Works. | ||
92 | 80 | |||
93 | 81 | You may convey a Combined Work under terms of your choice that, | ||
94 | 82 | taken together, effectively do not restrict modification of the | ||
95 | 83 | portions of the Library contained in the Combined Work and reverse | ||
96 | 84 | engineering for debugging such modifications, if you also do each of | ||
97 | 85 | the following: | ||
98 | 86 | |||
99 | 87 | a) Give prominent notice with each copy of the Combined Work that | ||
100 | 88 | the Library is used in it and that the Library and its use are | ||
101 | 89 | covered by this License. | ||
102 | 90 | |||
103 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license | ||
104 | 92 | document. | ||
105 | 93 | |||
106 | 94 | c) For a Combined Work that displays copyright notices during | ||
107 | 95 | execution, include the copyright notice for the Library among | ||
108 | 96 | these notices, as well as a reference directing the user to the | ||
109 | 97 | copies of the GNU GPL and this license document. | ||
110 | 98 | |||
111 | 99 | d) Do one of the following: | ||
112 | 100 | |||
113 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this | ||
114 | 102 | License, and the Corresponding Application Code in a form | ||
115 | 103 | suitable for, and under terms that permit, the user to | ||
116 | 104 | recombine or relink the Application with a modified version of | ||
117 | 105 | the Linked Version to produce a modified Combined Work, in the | ||
118 | 106 | manner specified by section 6 of the GNU GPL for conveying | ||
119 | 107 | Corresponding Source. | ||
120 | 108 | |||
121 | 109 | 1) Use a suitable shared library mechanism for linking with the | ||
122 | 110 | Library. A suitable mechanism is one that (a) uses at run time | ||
123 | 111 | a copy of the Library already present on the user's computer | ||
124 | 112 | system, and (b) will operate properly with a modified version | ||
125 | 113 | of the Library that is interface-compatible with the Linked | ||
126 | 114 | Version. | ||
127 | 115 | |||
128 | 116 | e) Provide Installation Information, but only if you would otherwise | ||
129 | 117 | be required to provide such information under section 6 of the | ||
130 | 118 | GNU GPL, and only to the extent that such information is | ||
131 | 119 | necessary to install and execute a modified version of the | ||
132 | 120 | Combined Work produced by recombining or relinking the | ||
133 | 121 | Application with a modified version of the Linked Version. (If | ||
134 | 122 | you use option 4d0, the Installation Information must accompany | ||
135 | 123 | the Minimal Corresponding Source and Corresponding Application | ||
136 | 124 | Code. If you use option 4d1, you must provide the Installation | ||
137 | 125 | Information in the manner specified by section 6 of the GNU GPL | ||
138 | 126 | for conveying Corresponding Source.) | ||
139 | 127 | |||
140 | 128 | 5. Combined Libraries. | ||
141 | 129 | |||
142 | 130 | You may place library facilities that are a work based on the | ||
143 | 131 | Library side by side in a single library together with other library | ||
144 | 132 | facilities that are not Applications and are not covered by this | ||
145 | 133 | License, and convey such a combined library under terms of your | ||
146 | 134 | choice, if you do both of the following: | ||
147 | 135 | |||
148 | 136 | a) Accompany the combined library with a copy of the same work based | ||
149 | 137 | on the Library, uncombined with any other library facilities, | ||
150 | 138 | conveyed under the terms of this License. | ||
151 | 139 | |||
152 | 140 | b) Give prominent notice with the combined library that part of it | ||
153 | 141 | is a work based on the Library, and explaining where to find the | ||
154 | 142 | accompanying uncombined form of the same work. | ||
155 | 143 | |||
156 | 144 | 6. Revised Versions of the GNU Lesser General Public License. | ||
157 | 145 | |||
158 | 146 | The Free Software Foundation may publish revised and/or new versions | ||
159 | 147 | of the GNU Lesser General Public License from time to time. Such new | ||
160 | 148 | versions will be similar in spirit to the present version, but may | ||
161 | 149 | differ in detail to address new problems or concerns. | ||
162 | 150 | |||
163 | 151 | Each version is given a distinguishing version number. If the | ||
164 | 152 | Library as you received it specifies that a certain numbered version | ||
165 | 153 | of the GNU Lesser General Public License "or any later version" | ||
166 | 154 | applies to it, you have the option of following the terms and | ||
167 | 155 | conditions either of that published version or of any later version | ||
168 | 156 | published by the Free Software Foundation. If the Library as you | ||
169 | 157 | received it does not specify a version number of the GNU Lesser | ||
170 | 158 | General Public License, you may choose any version of the GNU Lesser | ||
171 | 159 | General Public License ever published by the Free Software Foundation. | ||
172 | 160 | |||
173 | 161 | If the Library as you received it specifies that a proxy can decide | ||
174 | 162 | whether future versions of the GNU Lesser General Public License shall | ||
175 | 163 | apply, that proxy's public statement of acceptance of any version is | ||
176 | 164 | permanent authorization for you to choose that version for the | ||
177 | 165 | Library. | ||
178 | 0 | 166 | ||
179 | === modified file 'data/irc.protocol.in' | |||
180 | --- data/irc.protocol.in 2016-12-16 18:58:01 +0000 | |||
181 | +++ data/irc.protocol.in 2017-03-22 14:38:33 +0000 | |||
182 | @@ -9,3 +9,8 @@ | |||
183 | 9 | ShowOnSelector=1 | 9 | ShowOnSelector=1 |
184 | 10 | ShowOnlineStatus=0 | 10 | ShowOnlineStatus=0 |
185 | 11 | JoinExistingChannels=1 | 11 | JoinExistingChannels=1 |
186 | 12 | ReturnToSend=1 | ||
187 | 13 | EnableAttachments=0 | ||
188 | 14 | EnableRejoin=1 | ||
189 | 15 | EnableTabCompletion=1 | ||
190 | 16 | LeaveRoomsOnClose=1 | ||
191 | 12 | 17 | ||
192 | === modified file 'data/irc.service.in' | |||
193 | --- data/irc.service.in 2016-12-16 18:58:01 +0000 | |||
194 | +++ data/irc.service.in 2017-03-22 14:38:33 +0000 | |||
195 | @@ -1,3 +1,3 @@ | |||
196 | 1 | [D-BUS Service] | 1 | [D-BUS Service] |
197 | 2 | Name=org.freedesktop.Telepathy.ConnectionManager.@CM@ | 2 | Name=org.freedesktop.Telepathy.ConnectionManager.@CM@ |
199 | 3 | Exec=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/messaging-framework-runner --connection-manager-name @CM@ --protocol-name @PROTOCOL@ --connector messaging::PluginConnector --PluginConnector::path=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/libmfw-plugin-@CM@.so | 3 | Exec=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/messaging-framework-runner --connection-manager-name @CM@ --protocol-name @PROTOCOL@ --connector messaging::PluginConnector --PluginConnector::path=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/messaging-framework/libmfw-plugin-@CM@.so |
200 | 4 | 4 | ||
201 | === modified file 'debian/changelog' | |||
202 | --- debian/changelog 2016-12-16 18:58:01 +0000 | |||
203 | +++ debian/changelog 2017-03-22 14:38:33 +0000 | |||
204 | @@ -1,4 +1,4 @@ | |||
206 | 1 | mfw-plugin-irc (0.1) xenial; urgency=medium | 1 | mfw-plugin-irc (0.1-0ubuntu1) xenial; urgency=medium |
207 | 2 | 2 | ||
208 | 3 | * Initial release | 3 | * Initial release |
209 | 4 | 4 | ||
210 | 5 | 5 | ||
211 | === modified file 'debian/control' | |||
212 | --- debian/control 2016-12-16 18:58:01 +0000 | |||
213 | +++ debian/control 2017-03-22 14:38:33 +0000 | |||
214 | @@ -1,11 +1,8 @@ | |||
215 | 1 | Source: mfw-plugin-irc | 1 | Source: mfw-plugin-irc |
216 | 2 | Priority: optional | 2 | Priority: optional |
217 | 3 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> | 3 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
221 | 4 | Build-Depends: astyle:native, | 4 | Build-Depends: cmake, |
219 | 5 | clang-format-3.5:native, | ||
220 | 6 | cmake, | ||
222 | 7 | debhelper (>= 9), | 5 | debhelper (>= 9), |
223 | 8 | dos2unix:native, | ||
224 | 9 | doxygen, | 6 | doxygen, |
225 | 10 | gcovr, | 7 | gcovr, |
226 | 11 | google-mock, | 8 | google-mock, |
227 | @@ -14,16 +11,16 @@ | |||
228 | 14 | libboost-filesystem-dev, | 11 | libboost-filesystem-dev, |
229 | 15 | libboost-program-options-dev, | 12 | libboost-program-options-dev, |
230 | 16 | libboost-system-dev, | 13 | libboost-system-dev, |
231 | 14 | libcppnetlib-dev, | ||
232 | 17 | libdbus-cpp-dev, | 15 | libdbus-cpp-dev, |
233 | 18 | libgoogle-glog-dev, | 16 | libgoogle-glog-dev, |
235 | 19 | libircclient-dev | 17 | libircclient-dev, |
236 | 20 | libmessaging-framework-dev, | 18 | libmessaging-framework-dev, |
237 | 21 | libprocess-cpp-dev, | 19 | libprocess-cpp-dev, |
239 | 22 | libtelepathy-qt5-dev, | 20 | libtelepathy-qt5-dev, |
240 | 23 | pkg-config, | 21 | pkg-config, |
244 | 24 | qtbase5-dev, | 22 | qtbase5-dev |
245 | 25 | libcppnetlib-dev, | 23 | Standards-Version: 3.9.7 |
243 | 26 | Standards-Version: 3.9.5 | ||
246 | 27 | Section: libs | 24 | Section: libs |
247 | 28 | Homepage: https://launchpad.net/mfw-plugin-irc | 25 | Homepage: https://launchpad.net/mfw-plugin-irc |
248 | 29 | Vcs-Bzr: https://code.launchpad.net/ | 26 | Vcs-Bzr: https://code.launchpad.net/ |
249 | 30 | 27 | ||
250 | === removed directory 'debian/source' | |||
251 | === removed file 'debian/source/format' | |||
252 | --- debian/source/format 2016-12-16 18:58:01 +0000 | |||
253 | +++ debian/source/format 1970-01-01 00:00:00 +0000 | |||
254 | @@ -1,1 +0,0 @@ | |||
255 | 1 | 3.0 (native) | ||
256 | 2 | 0 | ||
257 | === modified file 'include/irc/connection.h' | |||
258 | --- include/irc/connection.h 2016-12-16 18:58:01 +0000 | |||
259 | +++ include/irc/connection.h 2017-03-22 14:38:33 +0000 | |||
260 | @@ -95,6 +95,7 @@ | |||
261 | 95 | 95 | ||
262 | 96 | std::string server_id; | 96 | std::string server_id; |
263 | 97 | std::string nickname; | 97 | std::string nickname; |
264 | 98 | int nick_collision; | ||
265 | 98 | 99 | ||
266 | 99 | private: | 100 | private: |
267 | 100 | 101 | ||
268 | 101 | 102 | ||
269 | === modified file 'include/irc/group_chat.h' | |||
270 | --- include/irc/group_chat.h 2016-12-16 18:58:01 +0000 | |||
271 | +++ include/irc/group_chat.h 2017-03-22 14:38:33 +0000 | |||
272 | @@ -39,6 +39,10 @@ | |||
273 | 39 | void mark_message_as_delivered(const std::string& message_token); | 39 | void mark_message_as_delivered(const std::string& message_token); |
274 | 40 | std::string id(); | 40 | std::string id(); |
275 | 41 | 41 | ||
276 | 42 | void set_active(bool active); | ||
277 | 43 | bool active(); | ||
278 | 44 | |||
279 | 45 | |||
280 | 42 | private: | 46 | private: |
281 | 43 | /// @brief Creates a new instance translating the given recipient to a user. | 47 | /// @brief Creates a new instance translating the given recipient to a user. |
282 | 44 | GroupChat(const std::shared_ptr<messaging::Group> &group, | 48 | GroupChat(const std::shared_ptr<messaging::Group> &group, |
283 | @@ -46,6 +50,7 @@ | |||
284 | 46 | 50 | ||
285 | 47 | irc_session_t *irc_session; | 51 | irc_session_t *irc_session; |
286 | 48 | std::string channel_id; | 52 | std::string channel_id; |
287 | 53 | bool is_active; | ||
288 | 49 | 54 | ||
289 | 50 | }; | 55 | }; |
290 | 51 | 56 | ||
291 | 52 | 57 | ||
292 | === modified file 'include/irc/group_manager.h' | |||
293 | --- include/irc/group_manager.h 2016-12-16 18:58:01 +0000 | |||
294 | +++ include/irc/group_manager.h 2017-03-22 14:38:33 +0000 | |||
295 | @@ -38,6 +38,7 @@ | |||
296 | 38 | std::string group_id() override; | 38 | std::string group_id() override; |
297 | 39 | std::string group_title() override; | 39 | std::string group_title() override; |
298 | 40 | std::string group_subject() override; | 40 | std::string group_subject() override; |
299 | 41 | bool persistent() override; | ||
300 | 41 | std::shared_ptr<messaging::Member> group_creator() override; | 42 | std::shared_ptr<messaging::Member> group_creator() override; |
301 | 42 | std::set<std::string> group_admins() override; | 43 | std::set<std::string> group_admins() override; |
302 | 43 | messaging::Members members() override; | 44 | messaging::Members members() override; |
303 | @@ -72,8 +73,6 @@ | |||
304 | 72 | irc_session_t *irc_session; | 73 | irc_session_t *irc_session; |
305 | 73 | std::string creator; | 74 | std::string creator; |
306 | 74 | 75 | ||
307 | 75 | /// @brief this valImClientImplue is created when chat is created and sent in any method call into the chat | ||
308 | 76 | |||
309 | 77 | }; | 76 | }; |
310 | 78 | 77 | ||
311 | 79 | } | 78 | } |
312 | 80 | 79 | ||
313 | === modified file 'include/irc/messenger.h' | |||
314 | --- include/irc/messenger.h 2016-12-16 18:58:01 +0000 | |||
315 | +++ include/irc/messenger.h 2017-03-22 14:38:33 +0000 | |||
316 | @@ -14,6 +14,7 @@ | |||
317 | 14 | class Message; | 14 | class Message; |
318 | 15 | class File; | 15 | class File; |
319 | 16 | class Connector; | 16 | class Connector; |
320 | 17 | class Connection; | ||
321 | 17 | class GroupManager; | 18 | class GroupManager; |
322 | 18 | 19 | ||
323 | 19 | class IRC_PUBLIC Messenger | 20 | class IRC_PUBLIC Messenger |
324 | @@ -25,7 +26,7 @@ | |||
325 | 25 | DEFINE_PTRS(Messenger); | 26 | DEFINE_PTRS(Messenger); |
326 | 26 | /// @endcond | 27 | /// @endcond |
327 | 27 | 28 | ||
329 | 28 | static std::shared_ptr<Messenger> create(const std::shared_ptr<Messenger::Observer>& messenger_observer, irc_session_t *irc_session); | 29 | static std::shared_ptr<Messenger> create(const std::shared_ptr<Messenger::Observer>& messenger_observer, const std::shared_ptr<irc::Connection> &connection, irc_session_t *irc_session); |
330 | 29 | 30 | ||
331 | 30 | std::shared_ptr<messaging::Chat> create_chat_with(const messaging::Recipient::shared_ptr& recipient, const std::shared_ptr<messaging::Chat::Observer>& observer) override; | 31 | std::shared_ptr<messaging::Chat> create_chat_with(const messaging::Recipient::shared_ptr& recipient, const std::shared_ptr<messaging::Chat::Observer>& observer) override; |
332 | 31 | 32 | ||
333 | @@ -34,9 +35,11 @@ | |||
334 | 34 | std::shared_ptr<GroupManager> get_group_manager(const std::string &group_chat_id); | 35 | std::shared_ptr<GroupManager> get_group_manager(const std::string &group_chat_id); |
335 | 35 | void handle_join_new_channel(const std::string &channel); | 36 | void handle_join_new_channel(const std::string &channel); |
336 | 36 | void handle_join_new_channel(const std::string &channel, const std::string &the_creator); | 37 | void handle_join_new_channel(const std::string &channel, const std::string &the_creator); |
337 | 38 | void remove_chat(const std::string &chat_id); | ||
338 | 37 | 39 | ||
339 | 40 | std::shared_ptr<irc::Connection> connection; | ||
340 | 38 | private: | 41 | private: |
342 | 39 | Messenger(const std::shared_ptr<messaging::Messenger::Observer>& observer, irc_session_t *irc_session); | 42 | Messenger(const std::shared_ptr<messaging::Messenger::Observer>& observer, const std::shared_ptr<irc::Connection> &connection, irc_session_t *irc_session); |
343 | 40 | 43 | ||
344 | 41 | /// @brief identity provider to correlate msg_id with imdn unique identifier. First will be | 44 | /// @brief identity provider to correlate msg_id with imdn unique identifier. First will be |
345 | 42 | /// used internally for chat messages and the other used as message external unique id | 45 | /// used internally for chat messages and the other used as message external unique id |
346 | 43 | 46 | ||
347 | === modified file 'src/CMakeLists.txt' | |||
348 | --- src/CMakeLists.txt 2016-12-16 18:58:01 +0000 | |||
349 | +++ src/CMakeLists.txt 2017-03-22 14:38:33 +0000 | |||
350 | @@ -34,4 +34,4 @@ | |||
351 | 34 | 34 | ||
352 | 35 | install( | 35 | install( |
353 | 36 | TARGETS ${PLUGIN_NAME} | 36 | TARGETS ${PLUGIN_NAME} |
355 | 37 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) | 37 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/messaging-framework) |
356 | 38 | 38 | ||
357 | === modified file 'src/irc/connection.cpp' | |||
358 | --- src/irc/connection.cpp 2016-12-16 18:58:01 +0000 | |||
359 | +++ src/irc/connection.cpp 2017-03-22 14:38:33 +0000 | |||
360 | @@ -151,6 +151,15 @@ | |||
361 | 151 | std::string irc_channel(params[1]); | 151 | std::string irc_channel(params[1]); |
362 | 152 | ctx->channel_members_changed(irc_channel, channel_users[irc_channel]); | 152 | ctx->channel_members_changed(irc_channel, channel_users[irc_channel]); |
363 | 153 | channel_users.erase(irc_channel); | 153 | channel_users.erase(irc_channel); |
364 | 154 | } else if (event == LIBIRC_RFC_ERR_NICKNAMEINUSE) { | ||
365 | 155 | if (ctx->nick_collision++ < 3) { | ||
366 | 156 | std::string irc_nick(params[1]); | ||
367 | 157 | irc_nick += "_"; | ||
368 | 158 | irc_cmd_nick(session, irc_nick.c_str()); | ||
369 | 159 | } else { | ||
370 | 160 | LOG(INFO) << "Could not connect. Nickname already in use"; | ||
371 | 161 | ctx->disconnect(messaging::Connection::StatusChangedReason::name_in_use); | ||
372 | 162 | } | ||
373 | 154 | } | 163 | } |
374 | 155 | } | 164 | } |
375 | 156 | 165 | ||
376 | @@ -213,6 +222,7 @@ | |||
377 | 213 | , port(6667) | 222 | , port(6667) |
378 | 214 | , use_ssl(false) | 223 | , use_ssl(false) |
379 | 215 | , verify_ssl_cert(true) | 224 | , verify_ssl_cert(true) |
380 | 225 | , nick_collision(0) | ||
381 | 216 | { | 226 | { |
382 | 217 | messaging::Parameter server_param{"server", "s", messaging::Parameter::Flags::required|messaging::Parameter::Flags::required_for_registration}; | 227 | messaging::Parameter server_param{"server", "s", messaging::Parameter::Flags::required|messaging::Parameter::Flags::required_for_registration}; |
383 | 218 | messaging::Parameter port_param{"port", "q", messaging::Parameter::Flags::none}; | 228 | messaging::Parameter port_param{"port", "q", messaging::Parameter::Flags::none}; |
384 | @@ -253,6 +263,9 @@ | |||
385 | 253 | { | 263 | { |
386 | 254 | throw std::runtime_error{"nickname could not be found"}; | 264 | throw std::runtime_error{"nickname could not be found"}; |
387 | 255 | } | 265 | } |
388 | 266 | if (username.empty()) { | ||
389 | 267 | username = nickname; | ||
390 | 268 | } | ||
391 | 256 | } | 269 | } |
392 | 257 | else | 270 | else |
393 | 258 | { | 271 | { |
394 | @@ -269,6 +282,10 @@ | |||
395 | 269 | fullname = fullname_param.extract_from(dict).as_string(); | 282 | fullname = fullname_param.extract_from(dict).as_string(); |
396 | 270 | } | 283 | } |
397 | 271 | 284 | ||
398 | 285 | if (fullname.empty()) { | ||
399 | 286 | fullname = nickname; | ||
400 | 287 | } | ||
401 | 288 | |||
402 | 272 | if (use_ssl_param.can_extract_from(dict)) | 289 | if (use_ssl_param.can_extract_from(dict)) |
403 | 273 | { | 290 | { |
404 | 274 | use_ssl = use_ssl_param.extract_from(dict).as_bool(); | 291 | use_ssl = use_ssl_param.extract_from(dict).as_bool(); |
405 | @@ -361,7 +378,7 @@ | |||
406 | 361 | irc_set_ctx(irc_session, ctx); | 378 | irc_set_ctx(irc_session, ctx); |
407 | 362 | 379 | ||
408 | 363 | // initiate other components | 380 | // initiate other components |
410 | 364 | messenger_ = Messenger::create(messenger_observer_, irc_session); | 381 | messenger_ = Messenger::create(messenger_observer_, shared_from_this(), irc_session); |
411 | 365 | group_starter_ = irc::GroupStarter::create(messenger_, irc_session); | 382 | group_starter_ = irc::GroupStarter::create(messenger_, irc_session); |
412 | 366 | 383 | ||
413 | 367 | // Initiate the IRC server connection | 384 | // Initiate the IRC server connection |
414 | @@ -405,6 +422,7 @@ | |||
415 | 405 | switch (new_status) | 422 | switch (new_status) |
416 | 406 | { | 423 | { |
417 | 407 | case Status::connected: | 424 | case Status::connected: |
418 | 425 | nick_collision = 0; | ||
419 | 408 | break; | 426 | break; |
420 | 409 | case Status::connecting: | 427 | case Status::connecting: |
421 | 410 | break; | 428 | break; |
422 | @@ -459,9 +477,14 @@ | |||
423 | 459 | 477 | ||
424 | 460 | messaging::Members members; | 478 | messaging::Members members; |
425 | 461 | for (auto user: users) { | 479 | for (auto user: users) { |
427 | 462 | members.push_back(std::make_shared<messaging::Member>(user, messaging::PendingStatus::None, messaging::Role::Member)); | 480 | if (user != self_identifier()) { |
428 | 481 | members.push_back(std::make_shared<messaging::Member>(user, messaging::PendingStatus::None, messaging::Role::Member)); | ||
429 | 482 | continue; | ||
430 | 483 | } | ||
431 | 463 | } | 484 | } |
432 | 464 | group_manager->handle_members_changed(members); | 485 | group_manager->handle_members_changed(members); |
433 | 486 | members.push_back(std::make_shared<messaging::Member>(self_identifier(), messaging::PendingStatus::None, messaging::Role::Member)); | ||
434 | 487 | group_manager->handle_members_changed(members); | ||
435 | 465 | } | 488 | } |
436 | 466 | 489 | ||
437 | 467 | void irc::Connection::channel_member_joined(const std::string &channel, const std::string &nick) | 490 | void irc::Connection::channel_member_joined(const std::string &channel, const std::string &nick) |
438 | @@ -474,18 +497,18 @@ | |||
439 | 474 | return; | 497 | return; |
440 | 475 | } | 498 | } |
441 | 476 | } | 499 | } |
443 | 477 | group_manager->handle_member_joined(std::make_shared<messaging::Member>(nick, messaging::PendingStatus::None, messaging::Role::Member)); | 500 | messaging::PendingStatus pending_status = messaging::PendingStatus::None; |
444 | 501 | if (nick == self_identifier()) { | ||
445 | 502 | pending_status = messaging::PendingStatus::Remote; | ||
446 | 503 | } | ||
447 | 504 | group_manager->handle_member_joined(std::make_shared<messaging::Member>(nick, pending_status, messaging::Role::Member)); | ||
448 | 478 | } | 505 | } |
449 | 479 | 506 | ||
450 | 480 | void irc::Connection::channel_member_left(const std::string &channel, const std::string &nick) | 507 | void irc::Connection::channel_member_left(const std::string &channel, const std::string &nick) |
451 | 481 | { | 508 | { |
452 | 482 | std::shared_ptr<irc::GroupManager> group_manager = messenger_->get_group_manager(channel); | 509 | std::shared_ptr<irc::GroupManager> group_manager = messenger_->get_group_manager(channel); |
453 | 483 | if (!group_manager) { | 510 | if (!group_manager) { |
459 | 484 | messenger_->handle_join_new_channel(channel, self_identifier()); | 511 | return; |
455 | 485 | group_manager = messenger_->get_group_manager(channel); | ||
456 | 486 | if (!group_manager) { | ||
457 | 487 | return; | ||
458 | 488 | } | ||
460 | 489 | } | 512 | } |
461 | 490 | 513 | ||
462 | 491 | group_manager->handle_member_left(std::make_shared<messaging::Member>(nick, messaging::PendingStatus::None, messaging::Role::Member)); | 514 | group_manager->handle_member_left(std::make_shared<messaging::Member>(nick, messaging::PendingStatus::None, messaging::Role::Member)); |
463 | 492 | 515 | ||
464 | === modified file 'src/irc/group_chat.cpp' | |||
465 | --- src/irc/group_chat.cpp 2016-12-16 18:58:01 +0000 | |||
466 | +++ src/irc/group_chat.cpp 2017-03-22 14:38:33 +0000 | |||
467 | @@ -30,11 +30,14 @@ | |||
468 | 30 | , irc_session(session) | 30 | , irc_session(session) |
469 | 31 | , channel_id(group->id()) | 31 | , channel_id(group->id()) |
470 | 32 | { | 32 | { |
472 | 33 | irc_cmd_join(session, channel_id.c_str(), ""); | 33 | set_active(!irc_cmd_join(irc_session, channel_id.c_str(), "")); |
473 | 34 | } | 34 | } |
474 | 35 | 35 | ||
475 | 36 | std::string irc::GroupChat::send_message(const messaging::Message& message) | 36 | std::string irc::GroupChat::send_message(const messaging::Message& message) |
476 | 37 | { | 37 | { |
477 | 38 | if (!is_active) { | ||
478 | 39 | set_active(!irc_cmd_join(irc_session, channel_id.c_str(), "")); | ||
479 | 40 | } | ||
480 | 38 | boost::uuids::uuid uuid = boost::uuids::random_generator()(); | 41 | boost::uuids::uuid uuid = boost::uuids::random_generator()(); |
481 | 39 | messaging::DeliveryStatus status = messaging::DeliveryStatus::permanently_failed; | 42 | messaging::DeliveryStatus status = messaging::DeliveryStatus::permanently_failed; |
482 | 40 | std::string id(boost::lexical_cast<std::string>(uuid)); | 43 | std::string id(boost::lexical_cast<std::string>(uuid)); |
483 | @@ -72,3 +75,8 @@ | |||
484 | 72 | { | 75 | { |
485 | 73 | return channel_id; | 76 | return channel_id; |
486 | 74 | } | 77 | } |
487 | 78 | |||
488 | 79 | void irc::GroupChat::set_active(bool active) | ||
489 | 80 | { | ||
490 | 81 | is_active = active; | ||
491 | 82 | } | ||
492 | 75 | 83 | ||
493 | === modified file 'src/irc/group_manager.cpp' | |||
494 | --- src/irc/group_manager.cpp 2016-12-16 18:58:01 +0000 | |||
495 | +++ src/irc/group_manager.cpp 2017-03-22 14:38:33 +0000 | |||
496 | @@ -2,6 +2,7 @@ | |||
497 | 2 | 2 | ||
498 | 3 | #include <irc/messenger.h> | 3 | #include <irc/messenger.h> |
499 | 4 | #include <irc/group_chat.h> | 4 | #include <irc/group_chat.h> |
500 | 5 | #include <irc/connection.h> | ||
501 | 5 | 6 | ||
502 | 6 | 7 | ||
503 | 7 | #include <memory> | 8 | #include <memory> |
504 | @@ -93,44 +94,92 @@ | |||
505 | 93 | 94 | ||
506 | 94 | void irc::GroupManager::add_members(const messaging::Members &members) | 95 | void irc::GroupManager::add_members(const messaging::Members &members) |
507 | 95 | { | 96 | { |
508 | 96 | |||
509 | 97 | } | 97 | } |
510 | 98 | 98 | ||
511 | 99 | void irc::GroupManager::remove_members(const messaging::Members &members) | 99 | void irc::GroupManager::remove_members(const messaging::Members &members) |
512 | 100 | { | 100 | { |
513 | 101 | for (auto member : members) { | ||
514 | 102 | if (member->id() == messenger_.lock()->connection->self_identifier()) { | ||
515 | 103 | leave_group(); | ||
516 | 104 | } | ||
517 | 105 | } | ||
518 | 101 | } | 106 | } |
519 | 102 | 107 | ||
520 | 103 | void irc::GroupManager::leave_group() | 108 | void irc::GroupManager::leave_group() |
521 | 104 | { | 109 | { |
522 | 105 | irc_cmd_part(irc_session, group_id().c_str()); | 110 | irc_cmd_part(irc_session, group_id().c_str()); |
523 | 111 | std::string self_identifier = messenger_.lock()->connection->self_identifier(); | ||
524 | 112 | |||
525 | 113 | // first move self contact to pending list | ||
526 | 114 | auto it = std::find_if(participants.begin(), participants.end(), [self_identifier](const std::shared_ptr<messaging::Member>& m) { | ||
527 | 115 | return m->id() == self_identifier; | ||
528 | 116 | }); | ||
529 | 117 | if (it != participants.end()) { | ||
530 | 118 | participants.erase(it); | ||
531 | 119 | participants.push_back(std::make_shared<messaging::Member>(self_identifier, messaging::PendingStatus::Remote, messaging::Role::Member)); | ||
532 | 120 | } | ||
533 | 121 | announce_members_updated(participants); | ||
534 | 122 | |||
535 | 123 | participants.clear(); | ||
536 | 124 | announce_members_updated(participants); | ||
537 | 125 | |||
538 | 126 | announce_group_cancelled(messaging::CancelGroupReason::Leave, ""); | ||
539 | 127 | chat_.lock()->set_active(false); | ||
540 | 128 | messenger_.lock()->remove_chat(group_id()); | ||
541 | 106 | } | 129 | } |
542 | 107 | 130 | ||
543 | 108 | void irc::GroupManager::dissolve_group() | 131 | void irc::GroupManager::dissolve_group() |
544 | 109 | { | 132 | { |
546 | 110 | 133 | // not supported on irc | |
547 | 111 | } | 134 | } |
548 | 112 | 135 | ||
549 | 113 | void irc::GroupManager::handle_members_changed(messaging::Members new_participants) | 136 | void irc::GroupManager::handle_members_changed(messaging::Members new_participants) |
550 | 114 | { | 137 | { |
553 | 115 | for (auto participant : new_participants) { | 138 | for (auto new_participant : new_participants) { |
554 | 116 | participants.push_back(participant); | 139 | auto it = std::find_if(participants.begin(), participants.end(), [new_participant](const std::shared_ptr<messaging::Member>& m) { |
555 | 140 | return m->id() == new_participant->id(); | ||
556 | 141 | }); | ||
557 | 142 | if (it != participants.end()) { | ||
558 | 143 | participants.erase(it); | ||
559 | 144 | } | ||
560 | 145 | participants.push_back(new_participant); | ||
561 | 117 | } | 146 | } |
562 | 118 | announce_members_updated(participants); | 147 | announce_members_updated(participants); |
563 | 119 | } | 148 | } |
564 | 120 | 149 | ||
565 | 121 | void irc::GroupManager::handle_member_joined(const std::shared_ptr<messaging::Member> &member) | 150 | void irc::GroupManager::handle_member_joined(const std::shared_ptr<messaging::Member> &member) |
566 | 122 | { | 151 | { |
567 | 152 | auto it = std::find_if(participants.begin(), participants.end(), [member](const std::shared_ptr<messaging::Member>& m) { | ||
568 | 153 | return m->id() == member->id(); | ||
569 | 154 | }); | ||
570 | 155 | |||
571 | 156 | if (it != participants.end()) { | ||
572 | 157 | return; | ||
573 | 158 | } | ||
574 | 159 | |||
575 | 123 | participants.push_back(member); | 160 | participants.push_back(member); |
576 | 124 | announce_members_updated(participants); | 161 | announce_members_updated(participants); |
577 | 125 | } | 162 | } |
578 | 126 | 163 | ||
579 | 127 | void irc::GroupManager::handle_member_left(const std::shared_ptr<messaging::Member> &member) | 164 | void irc::GroupManager::handle_member_left(const std::shared_ptr<messaging::Member> &member) |
580 | 128 | { | 165 | { |
581 | 166 | if (member->id() == messenger_.lock()->connection->self_identifier()) { | ||
582 | 167 | leave_group(); | ||
583 | 168 | return; | ||
584 | 169 | } | ||
585 | 170 | |||
586 | 129 | auto it = std::find_if(participants.begin(), participants.end(), [member](const std::shared_ptr<messaging::Member>& m) { | 171 | auto it = std::find_if(participants.begin(), participants.end(), [member](const std::shared_ptr<messaging::Member>& m) { |
587 | 130 | return m->id() == member->id(); | 172 | return m->id() == member->id(); |
588 | 131 | }); | 173 | }); |
589 | 174 | |||
590 | 132 | if (it != participants.end()) { | 175 | if (it != participants.end()) { |
591 | 133 | participants.erase(it); | 176 | participants.erase(it); |
592 | 134 | announce_members_updated(participants); | 177 | announce_members_updated(participants); |
593 | 135 | } | 178 | } |
594 | 136 | } | 179 | } |
595 | 180 | |||
596 | 181 | bool irc::GroupManager::persistent() | ||
597 | 182 | { | ||
598 | 183 | return false; | ||
599 | 184 | } | ||
600 | 185 | |||
601 | 137 | 186 | ||
602 | === modified file 'src/irc/messenger.cpp' | |||
603 | --- src/irc/messenger.cpp 2016-12-16 18:58:01 +0000 | |||
604 | +++ src/irc/messenger.cpp 2017-03-22 14:38:33 +0000 | |||
605 | @@ -2,6 +2,12 @@ | |||
606 | 2 | #include <irc/group_chat.h> | 2 | #include <irc/group_chat.h> |
607 | 3 | #include <irc/contact_chat.h> | 3 | #include <irc/contact_chat.h> |
608 | 4 | #include <irc/group_manager.h> | 4 | #include <irc/group_manager.h> |
609 | 5 | #include <irc/connection.h> | ||
610 | 6 | |||
611 | 7 | #include <boost/lexical_cast.hpp> | ||
612 | 8 | #include <boost/uuid/uuid.hpp> | ||
613 | 9 | #include <boost/uuid/uuid_generators.hpp> | ||
614 | 10 | #include <boost/uuid/uuid_io.hpp> | ||
615 | 5 | 11 | ||
616 | 6 | #include <messaging/group.h> | 12 | #include <messaging/group.h> |
617 | 7 | #include <messaging/user.h> | 13 | #include <messaging/user.h> |
618 | @@ -13,15 +19,16 @@ | |||
619 | 13 | 19 | ||
620 | 14 | using namespace std; | 20 | using namespace std; |
621 | 15 | 21 | ||
623 | 16 | irc::Messenger::Messenger(const std::shared_ptr<messaging::Messenger::Observer>& observer, irc_session_t *session) | 22 | irc::Messenger::Messenger(const std::shared_ptr<messaging::Messenger::Observer>& observer, const std::shared_ptr<irc::Connection> &_connection, irc_session_t *session) |
624 | 17 | : messaging::Messenger{observer} | 23 | : messaging::Messenger{observer} |
625 | 24 | , connection(_connection) | ||
626 | 18 | , irc_session(session) | 25 | , irc_session(session) |
627 | 19 | { | 26 | { |
628 | 20 | } | 27 | } |
629 | 21 | 28 | ||
631 | 22 | std::shared_ptr<irc::Messenger> irc::Messenger::create(const std::shared_ptr<messaging::Messenger::Observer>& observer, irc_session_t *session) | 29 | std::shared_ptr<irc::Messenger> irc::Messenger::create(const std::shared_ptr<messaging::Messenger::Observer>& observer, const std::shared_ptr<irc::Connection> &connection, irc_session_t *session) |
632 | 23 | { | 30 | { |
634 | 24 | std::shared_ptr<Messenger> messenger(new Messenger{observer, session}); | 31 | std::shared_ptr<Messenger> messenger(new Messenger{observer, connection, session}); |
635 | 25 | return messenger; | 32 | return messenger; |
636 | 26 | } | 33 | } |
637 | 27 | 34 | ||
638 | @@ -48,6 +55,7 @@ | |||
639 | 48 | auto chat = get_chat(channel); | 55 | auto chat = get_chat(channel); |
640 | 49 | if (!chat) { | 56 | if (!chat) { |
641 | 50 | messaging::Members initial_invitees; | 57 | messaging::Members initial_invitees; |
642 | 58 | initial_invitees.push_back(std::make_shared<messaging::Member>(connection->self_identifier(), messaging::PendingStatus::Remote)); | ||
643 | 51 | std::string initial_title; | 59 | std::string initial_title; |
644 | 52 | announce_new_group_invitation_received(std::make_shared<messaging::Group>(channel, initial_invitees, initial_title, std::make_shared<messaging::Member>(the_creator))); | 60 | announce_new_group_invitation_received(std::make_shared<messaging::Group>(channel, initial_invitees, initial_title, std::make_shared<messaging::Member>(the_creator))); |
645 | 53 | } | 61 | } |
646 | @@ -58,6 +66,9 @@ | |||
647 | 58 | messaging::Message api_message; | 66 | messaging::Message api_message; |
648 | 59 | api_message.sender = sender; | 67 | api_message.sender = sender; |
649 | 60 | api_message.message = message; | 68 | api_message.message = message; |
650 | 69 | boost::uuids::uuid uuid = boost::uuids::random_generator()(); | ||
651 | 70 | api_message.id = boost::lexical_cast<std::string>(uuid); | ||
652 | 71 | |||
653 | 61 | auto chat = get_chat(sender); | 72 | auto chat = get_chat(sender); |
654 | 62 | if (chat) { | 73 | if (chat) { |
655 | 63 | dynamic_pointer_cast<irc::ContactChat>(chat)->handle_incoming_message(api_message); | 74 | dynamic_pointer_cast<irc::ContactChat>(chat)->handle_incoming_message(api_message); |
656 | @@ -71,6 +82,9 @@ | |||
657 | 71 | messaging::Message api_message; | 82 | messaging::Message api_message; |
658 | 72 | api_message.sender = sender; | 83 | api_message.sender = sender; |
659 | 73 | api_message.message = message; | 84 | api_message.message = message; |
660 | 85 | boost::uuids::uuid uuid = boost::uuids::random_generator()(); | ||
661 | 86 | api_message.id = boost::lexical_cast<std::string>(uuid); | ||
662 | 87 | |||
663 | 74 | auto chat = get_chat(channel); | 88 | auto chat = get_chat(channel); |
664 | 75 | if (chat) { | 89 | if (chat) { |
665 | 76 | dynamic_pointer_cast<irc::GroupChat>(chat)->handle_incoming_message(api_message); | 90 | dynamic_pointer_cast<irc::GroupChat>(chat)->handle_incoming_message(api_message); |
666 | @@ -101,3 +115,8 @@ | |||
667 | 101 | 115 | ||
668 | 102 | return std::dynamic_pointer_cast<irc::GroupManager>(group_manager); | 116 | return std::dynamic_pointer_cast<irc::GroupManager>(group_manager); |
669 | 103 | } | 117 | } |
670 | 118 | |||
671 | 119 | void irc::Messenger::remove_chat(const std::string &chat_id) | ||
672 | 120 | { | ||
673 | 121 | chats().erase(chat_id); | ||
674 | 122 | } |
Looks good!