Changeset 1400 for HelpIM3

Show
Ignore:
Timestamp:
02/15/11 19:16:39 (15 months ago)
Author:
zeank
Message:

user_left:check if user left because of kick - set token invalid if
that's the case

refs #272

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • HelpIM3/branches/chatgroups/HelpIM/bot/bot.py

    r1375 r1400  
    713713        nUsers = len(self.room_state.users) -1 # -1 for not counting the bot itself 
    714714         
     715        mucStatus = stanza.xpath_eval('d:x/d:status', 
     716                                      {'d': 'http://jabber.org/protocol/muc#user'}) 
     717 
     718        if len(mucStatus) > 0: 
     719            curAttr = mucStatus[0].properties 
     720            while curAttr: 
     721                if curAttr.name == 'code' and curAttr.content == '307': 
     722                    """ this user must have been kicked. now we must make sure 
     723                    to delete his access token and change the password for 
     724                    this room 
     725                    """ 
     726                    log.debug("############") 
     727                    groupServices.setChatgroupMemberTokenInvalid( 
     728                        self.site, 
     729                        room.chat_id, 
     730                        user.nick) 
     731                    """ disabled resetting password as this would need to be done on xmpp level too and that's just too much work for now """ 
     732                    # password = unicode(newHash()) 
     733                    # room.setPassword(password) 
     734                    break 
     735                curAttr = curAttr.next 
     736         
    715737        cleanexit = stanza.get_status() 
    716738        if cleanexit is not None and cleanexit.strip() == u"Clean Exit":