From 3a1b83228db150eb83cd7fa2b707364092555b85 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Thu, 19 Jul 2007 13:12:11 +0000 Subject: [PATCH] Beter handling of status code in MUC. see #3270. --- src/gajim.py | 4 ++++ src/groupchat_control.py | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/gajim.py b/src/gajim.py index 16b774549..538cf1296 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -1225,6 +1225,9 @@ class Interface: return changes = [] + if '100' in statusCode: + # Can be a presence (see chg_contact_status in groupchat_contol.py) + changes.append(_('Any occupant is allowed to see your full JID')) if '102' in statusCode: changes.append(_('Room now shows unavailable member')) if '103' in statusCode: @@ -1233,6 +1236,7 @@ class Interface: changes.append(\ _('A non-privacy-related room configuration change has occurred')) if '170' in statusCode: + # Can be a presence (see chg_contact_status in groupchat_contol.py) changes.append(_('Room logging is now enabled')) if '171' in statusCode: changes.append(_('Room logging is now disabled')) diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 35b934026..c0fc847f4 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -890,9 +890,11 @@ class GroupchatControl(ChatControlBase): # statusCode # http://www.xmpp.org/extensions/xep-0045.html#registrar-statuscodes-init if '100' in statusCode: + # Can be a message (see handle_event_gc_config_change in gajim.py) self.print_conversation(\ _('Any occupant is allowed to see your full JID')) if '170' in statusCode: + # Can be a message (see handle_event_gc_config_change in gajim.py) self.print_conversation(_('Room logging is enabled')) if '201' in statusCode: self.print_conversation(_('A new room has been created')) @@ -959,6 +961,20 @@ class GroupchatControl(ChatControlBase): os.remove(files[old_file]) os.rename(old_file, files[old_file]) self.print_conversation(s, 'info', tim) + elif '321' in statusCode: + s = _('%(nick)s has been removed from the room (%(reason)s)') % { + 'nick': nick, 'reason': _('affiliation changed') } + self.print_conversation(s, 'info', tim = tim) + elif '322' in statusCode: + s = _('%(nick)s has been removed from the room (%(reason)s)') % { + 'nick': nick, + 'reason': _('room configuration changed to members-only') } + self.print_conversation(s, 'info', tim = tim) + elif '332' in statusCode: + s = _('%(nick)s has been removed from the room (%(reason)s)') % { + 'nick': nick, + 'reason': _('system shutdown') } + self.print_conversation(s, 'info', tim = tim) elif 'destroyed' in statusCode: # Room has been destroyed self.print_conversation(reason, 'info', tim)