Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
298adcf0
by Philipp Hörist at 2019-08-02T09:55:24Z
3 changed files:
- gajim/command_system/implementation/standard.py
- gajim/common/modules/muc.py
- gajim/groupchat_control.py
Changes:
| ... | ... | @@ -312,7 +312,7 @@ class StandardGroupChatCommands(CommandContainer): |
| 312 | 312 |
@command('part', 'close', raw=True, empty=True)
|
| 313 | 313 |
@doc(_("Leave the group chat, optionally giving a reason, and close tab or window"))
|
| 314 | 314 |
def leave(self, reason):
|
| 315 |
- self.leave()
|
|
| 315 |
+ self.leave(reason=reason)
|
|
| 316 | 316 |
|
| 317 | 317 |
@command(raw=True, empty=True)
|
| 318 | 318 |
@doc(_("""
|
| ... | ... | @@ -163,14 +163,15 @@ class MUC(BaseModule): |
| 163 | 163 |
self._set_muc_state(muc_data.jid, MUCJoinedState.JOINING)
|
| 164 | 164 |
self._con.connection.send(presence)
|
| 165 | 165 |
|
| 166 |
- def leave(self, room_jid):
|
|
| 166 |
+ def leave(self, room_jid, reason=None):
|
|
| 167 | 167 |
self._log.info('Leave MUC: %s', room_jid)
|
| 168 | 168 |
self._remove_join_timeout(room_jid)
|
| 169 | 169 |
self._set_muc_state(room_jid, MUCJoinedState.NOT_JOINED)
|
| 170 | 170 |
muc_data = self._get_muc_data(room_jid)
|
| 171 | 171 |
self._con.get_module('Presence').send_presence(
|
| 172 | 172 |
muc_data.occupant_jid,
|
| 173 |
- typ='unavailable')
|
|
| 173 |
+ typ='unavailable',
|
|
| 174 |
+ status=reason)
|
|
| 174 | 175 |
# We leave a group chat, disable bookmark autojoin
|
| 175 | 176 |
self._con.get_module('Bookmarks').set_autojoin(room_jid, False)
|
| 176 | 177 |
|
| ... | ... | @@ -1544,8 +1544,9 @@ class GroupchatControl(ChatControlBase): |
| 1544 | 1544 |
|
| 1545 | 1545 |
self.update_actions()
|
| 1546 | 1546 |
|
| 1547 |
- def leave(self):
|
|
| 1548 |
- app.connections[self.account].get_module('MUC').leave(self.room_jid)
|
|
| 1547 |
+ def leave(self, reason=None):
|
|
| 1548 |
+ app.connections[self.account].get_module('MUC').leave(self.room_jid,
|
|
| 1549 |
+ reason=reason)
|
|
| 1549 | 1550 |
self.got_disconnected()
|
| 1550 | 1551 |
self._close_control()
|
| 1551 | 1552 |
|