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

Diff of /tcldrop/modules/users/users.tcl

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

revision 1.3 by Papillon, Tue May 20 09:16:28 2003 UTC revision 1.4 by fireegl, Tue May 20 13:22:32 2003 UTC
# Line 63  proc ::tcldrop::users::finduser {nuhost} Line 63  proc ::tcldrop::users::finduser {nuhost}
63    
64  # Checks $handle for $flags, $channel is optional.  # Checks $handle for $flags, $channel is optional.
65  proc ::tcldrop::users::matchattr {handle flags {channel {}}} {  proc ::tcldrop::users::matchattr {handle flags {channel {}}} {
66          switch -- $flags {          if {![validuser $handle]} {
67                  {-} - {-|-} - {*} - {*|*} - {|} - {+} - {} { return 1 }                  # Return 0 since the user is unknown to the bot.
68                  {default} {                  return 0
69                          if {![validuser $handle]} {          } else {
70                                  # Return 0 since the user is unknown to the bot                  switch -- $flags {
71                                  return                          {-} - {-|-} - {*} - {*|*} - {|} - {+} - {} { return 1 }
72                          } elseif {[::tcldrop::CheckFlags [lindex [split $flags {|}] 0] [getuser $handle flags]] == 1} {                          {default} {
73                                  # Return 1 since we matched one of their global flags.                                  if {[::tcldrop::CheckFlags [lindex [split $flags {|}] 0] [getuser $handle flags]] == 1} {
74                                  return 1                                          # Return 1 since we matched one of their global flags.
75                          } elseif {$channel != {} && [::tcldrop::CheckFlags [lindex [split $flags {|}] end] [getuser $handle flags $channel]] == 1} {                                          return 1
76                                  # Return 1 since we matched one of their channel flags.                                  } elseif {$channel != {} && [::tcldrop::CheckFlags [lindex [split $flags {|}] end] [getuser $handle flags $channel]] == 1} {
77                                  return 1                                          # Return 1 since we matched one of their channel flags.
78                          } else {                                          return 1
79                                    } else {
80                                  # Return 0 since there was no match.                                  # Return 0 since there was no match.
81                                  return 0                                  return 0
82                                    }
83                          }                          }
84                  }                  }
85          }          }
# Line 334  proc ::tcldrop::users::adduser {handle { Line 336  proc ::tcldrop::users::adduser {handle {
336                          if {![info exists retval]} { set retval $val }                          if {![info exists retval]} { set retval $val }
337                  }                  }
338          }          }
339          # Return the $retval, or return 0 which means we didn't call any binds (failure).          # Return the $retval, or return 0 which indicates a failure.
340          if {[info exists retval]} { set retval } else { set retval 0 }          if {[info exists retval]} { set retval } else { set retval 0 }
341  }  }
342    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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