/[tcldrop]/tcldrop/modules/irc/irc.tcl
ViewVC logotype

Diff of /tcldrop/modules/irc/irc.tcl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by Papillon, Thu May 22 21:29:50 2003 UTC revision 1.14 by fireegl, Fri May 23 00:48:35 2003 UTC
# Line 368  proc ::tcldrop::irc::TOPIC {from key arg Line 368  proc ::tcldrop::irc::TOPIC {from key arg
368          }          }
369  }  }
370    
   
371  bind raw - NICK ::tcldrop::irc::NICK 99  bind raw - NICK ::tcldrop::irc::NICK 99
372  # Proc by Papillon@EFNet  # Proc by Papillon@EFNet
373  # FixMe: Untested and unmodified.  # FixMe: Untested and unmodified.
# Line 383  proc ::tcldrop::irc::NICK {from key arg} Line 382  proc ::tcldrop::irc::NICK {from key arg}
382          set nick [string range $arg 1 end]          set nick [string range $arg 1 end]
383          set handle [finduser $uhost]          set handle [finduser $uhost]
384    
         ## Note: this seems like a "clumsy" way of doing it... any better way?  
         #Updating nick-info  
         variable Nicks  
         array set nickinfo $Nicks([string tolower $oldnick])  
         array set nickinfo [list nick $nick]  
         set Nicks([string tolower $nick]) [array get nickinfo]  
         array unset Nicks [string tolower $oldnick]  
         variable ChannelNicks  
         foreach x [array names ChannelNicks [string tolower "*,$oldnick"]] {  
                 array set channick $ChannelNicks($x)  
                 array set channick [list nick $nick]  
                 set ChannelNicks($x) [array get channick]  
                 array unset ChannelNicks [string tolower "*,$oldnick"]  
         }  
   
385          # Call all the nick binds:          # Call all the nick binds:
386          putlog "Nick change: $oldnick -> $nick"          putlog "Nick change: $oldnick -> $nick"
387          foreach b [binds nick] {          foreach b [binds nick] {
388                  foreach {type flags mask count proc} $b {}                  foreach {type flags mask count proc} $b {}
389                  foreach channel [channels] {                  foreach channel [channels] {
390                          if {[string match -nocase $mask "$channel $nick"] && [matchattr $handle $flags $channel]} {                          if {[string match -nocase $mask "$channel $nick"] && [botonchan $channel] && ([onchan $oldnick $channel] || [onchan $nick $channel]) && [matchattr $handle $flags $channel]} {
391                                  if {[catch { $proc $oldnick $uhost $handle $channel $nick} err]} {                                  if {[catch { $proc $oldnick $uhost $handle $channel $nick} err]} {
392                                          putlog "Error in $proc: $err"                                          putlog "Error in $proc: $err"
393                                          puterrlog "$::errorInfo"                                          puterrlog "$::errorInfo"
# Line 413  proc ::tcldrop::irc::NICK {from key arg} Line 397  proc ::tcldrop::irc::NICK {from key arg}
397          }          }
398  }  }
399    
400    bind nick - * ::tcldrop::irc::nick 0
401    proc ::tcldrop::irc::nick {nick uhost handle channel newnick} {
402            set lowernick [string tolower $nick]
403            set lowernewnick [string tolower $newnick]
404            set lowerchannel [string tolower $channel]
405            variable Nicks
406            if {[info exists Nicks($lowernick)]} {
407                    array set nickinfo $Nicks($lowernick)
408                    array set nickinfo [list nick $newnick]
409                    set Nicks($lowernewnick) [array get nickinfo]
410                    array unset Nicks $lowernick
411            }
412            variable ChannelNicks
413            if {[info exists ChannelNicks($lowerchannel,$lowernick)]} {
414                    array set channick $ChannelNicks($lowerchannel,$lowernick)
415                    array set channick [list nick $newnick]
416                    set ChannelNicks($lowerchannel,$lowernewnick) [array get channick]
417                    array unset ChannelNicks $lowerchannel,$lowernick
418            }
419    }
420    
421  # Proc by Papillon@EFNet  # Proc by Papillon@EFNet
422  bind raw - QUIT ::tcldrop::irc::SIGN 99  bind raw - QUIT ::tcldrop::irc::SIGN 99
# Line 688  proc ::tcldrop::irc::PRIVMSG {from key a Line 692  proc ::tcldrop::irc::PRIVMSG {from key a
692          }          }
693  }  }
694    
   
   
   
695  #  onchan <nickname> [channel]  #  onchan <nickname> [channel]
696  #    Returns: 1 if someone by that nickname is on the specified channel (or  #    Returns: 1 if someone by that nickname is on the specified channel (or
697  #      any channel if none is specified); 0 otherwise  #      any channel if none is specified); 0 otherwise

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26