Commit 501b993b authored by Philipp Hörist's avatar Philipp Hörist

MUC: Add dedicated leave() method

parent 3626505e
......@@ -156,6 +156,13 @@ def _join(self, room_jid):
self._set_muc_state(room_jid, MUCJoinedState.JOINING)
self._con.connection.send(presence)
def leave(self, room_jid):
self._log.info('Leave MUC: %s', room_jid)
nick = self._get_muc_data(room_jid)
self._con.get_module('Presence').send_presence(
'%s/%s' % (room_jid, nick),
typ='unavailable')
def change_nick(self, room_jid, new_nick):
show = helpers.get_xmpp_show(app.SHOW_LIST[self._con.connected])
self._con.get_module('Presence').send_presence(
......
......@@ -2293,8 +2293,7 @@ def shutdown(self, status='offline'):
app.ged.remove_event_handler(*handler)
if self.is_connected:
app.connections[self.account].send_gc_status(self.nick,
self.room_jid, show='offline', status=status)
app.connections[self.account].get_module('MUC').leave(self.room_jid)
nick_list = app.contacts.get_nick_list(self.account, self.room_jid)
for nick in nick_list:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment