From 97d5ffdb7d6b5e8254a104464b79ea0e1a932097 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Thu, 19 Jul 2007 11:54:15 +0000 Subject: [PATCH] Beter handling of status codes. See #3270. http://www.xmpp.org/extensions/xep-0045.html#registrar-statuscodes-init --- src/gajim.py | 10 ++++++++-- src/groupchat_control.py | 12 ++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/gajim.py b/src/gajim.py index d74039ec3..16b774549 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -1213,6 +1213,7 @@ class Interface: def handle_event_gc_config_change(self, account, array): #('GC_CONFIG_CHANGE', account, (jid, statusCode)) statuscode is a list # http://www.xmpp.org/extensions/xep-0045.html#roomconfig-notify + # http://www.xmpp.org/extensions/xep-0045.html#registrar-statuscodes-init jid = array[0] statusCode = array[1] @@ -1224,6 +1225,13 @@ class Interface: return changes = [] + if '102' in statusCode: + changes.append(_('Room now shows unavailable member')) + if '103' in statusCode: + changes.append(_('room now does not show unavailable members')) + if '104' in statusCode: + changes.append(\ + _('A non-privacy-related room configuration change has occurred')) if '170' in statusCode: changes.append(_('Room logging is now enabled')) if '171' in statusCode: @@ -1234,8 +1242,6 @@ class Interface: changes.append(_('Room is now semi-anonymous')) if '174' in statusCode: changes.append(_('Room is now fully-anonymous')) - if '104' in statusCode: - changes.append(_('Room configuration has changed')) for change in changes: gc_control.print_conversation(change) diff --git a/src/groupchat_control.py b/src/groupchat_control.py index bfd4364e7..35b934026 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -886,8 +886,20 @@ class GroupchatControl(ChatControlBase): affiliation = 'none' fake_jid = self.room_jid + '/' + nick newly_created = False + + # statusCode + # http://www.xmpp.org/extensions/xep-0045.html#registrar-statuscodes-init + if '100' in statusCode: + self.print_conversation(\ + _('Any occupant is allowed to see your full JID')) if '170' in statusCode: self.print_conversation(_('Room logging is enabled')) + if '201' in statusCode: + self.print_conversation(_('A new room has been created')) + if '210' in statusCode: + self.print_conversation(\ + _('The server has assigned or modified your roomnick')) + if show in ('offline', 'error'): if '307' in statusCode: if actor is None: # do not print 'kicked by None'