Changeset 12

Show
Ignore:
Timestamp:
01/30/04 20:34:46 (5 years ago)
Author:
jajcus
Message:

- strip 'target' from numerics

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/jjigw.py

    r11 r12  
    5151    return evil_characters_re.sub(" ",s) 
    5252 
     53numeric_re=re.compile(r"\d\d\d") 
    5354channel_re=re.compile(r"^[&#+!][^\000 \007 ,:\r\n]{1,49}$") 
    5455nick_re=re.compile(r"^[a-zA-Z\x5b-\x60\x7b-\x7d\[\]\\`_^{|}][a-zA-Z\x5b-\x60\x7b-\x7d\[\]\\`_^{|}0-9-]{0,8}$") 
     
    142143 
    143144    def whoreply(self,params): 
    144         if params[5]!=self.nick: 
    145             return 
    146         if len(params)!=8
    147             return 
    148         target,channel,user,host,server,nick,flags,rest=params 
     145        if params[4]!=self.nick: 
     146            return 
     147        if len(params)!=7
     148            return 
     149        channel,user,host,server,nick,flags,rest=params 
    149150        fullname=rest.split(None,1)[1] 
    150151        self.debug("Channel: %r" % (channel,)) 
     
    649650            params.append(split[0]) 
    650651            split=split[1:] 
     652        if command and numeric_re.match(command): 
     653            params=params[1:] 
    651654        self.debug("Prefix: %r Command: %r params: %r" % (prefix,command,params)) 
    652655        self.lock.release() 
     
    710713    def irc_cmd_352(self,prefix,command,params): 
    711714        self.debug("WHO reply received") 
    712         if len(params)<8
     715        if len(params)<7
    713716            self.debug("too short - ignoring") 
    714717            return 
    715         user=self.get_user(params[5]) 
     718        user=self.get_user(params[4]) 
    716719        self.debug("Got user %r" % (user.nick,)) 
    717720        user.whoreply(params)