Changeset 8710

Show
Ignore:
Timestamp:
09/04/07 20:38:33 (15 months ago)
Author:
asterix
Message:

Handle Multiple status code in MUC.

Location:
branches/gajim_0.11.1/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11.1/src/common/xmpp/protocol.py

    r8672 r8710  
    510510    def getStatusCode(self): 
    511511        """Returns the status code of the presence (for groupchat)""" 
    512         return self._muc_getItemAttr('status','code') 
     512        attrs = [] 
     513        for xtag in self.getTags('x'): 
     514            for child in xtag.getTags('status'): 
     515                attrs.append(child.getAttr('code')) 
     516        return attrs 
    513517 
    514518class Iq(Protocol):  
  • branches/gajim_0.11.1/src/groupchat_control.py

    r8709 r8710  
    838838                fake_jid = self.room_jid + '/' + nick 
    839839                newly_created = False 
     840                if '170' in statusCode: 
     841                        self.print_conversation(_('Room logging is enabled'), 'info') 
    840842                if show in ('offline', 'error'): 
    841                         if statusCode == '307': 
     843                        if '307' in statusCode: 
    842844                                if actor is None: # do not print 'kicked by None' 
    843845                                        s = _('%(nick)s has been kicked: %(reason)s') % { 
     
    850852                                                'reason': reason } 
    851853                                self.print_conversation(s, 'info') 
    852                         elif statusCode == '301': 
     854                        elif '301' in statusCode: 
    853855                                if actor is None: # do not print 'banned by None' 
    854856                                        s = _('%(nick)s has been banned: %(reason)s') % { 
     
    861863                                                'reason': reason } 
    862864                                self.print_conversation(s, 'info') 
    863                         elif statusCode == '303': # Someone changed his or her nick 
     865                        elif '303' in statusCode: # Someone changed his or her nick 
    864866                                if nick == self.nick: # We changed our nick 
    865867                                        self.nick = new_nick 
     
    903905                                c.show = show 
    904906                                c.status = status 
    905                         if nick == self.nick and statusCode != '303': # We became offline 
     907                        if nick == self.nick and '303' not in statusCode: # We became offline 
    906908                                self.got_disconnected() 
    907909                                self.parent_win.redraw_tab(self) 
     
    912914                                        status, jid) 
    913915                                newly_created = True 
    914                                 if statusCode == '201': # We just created the room 
     916                                if '201' in statusCode: # We just created the room 
    915917                                        gajim.connections[self.account].request_gc_config(self.room_jid) 
    916918                        else: 
     
    965967                self.parent_win.redraw_tab(self) 
    966968                if (time.time() - self.room_creation) > 30 and \ 
    967                                 nick != self.nick and statusCode != '303': 
     969                                nick != self.nick and '303' not in statusCode: 
    968970                        st = '' 
    969971                        print_status = None 
     
    980982                                nick_jid += ' (%s)' % simple_jid 
    981983                        if show == 'offline' and print_status in ('all', 'in_and_out') and \ 
    982                         statusCode != '307': 
     984                        '307' not in statusCode: 
    983985                                st = _('%s has left') % nick_jid 
    984986                                if reason: