/[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.18 by fireegl, Wed Jun 4 21:02:38 2003 UTC revision 1.19 by fireegl, Mon Jun 30 06:25:05 2003 UTC
# Line 684  proc ::tcldrop::irc::PRIVMSG {from key a Line 684  proc ::tcldrop::irc::PRIVMSG {from key a
684                  set args [string trimleft [join [lrange $ltext 1 end]]]                  set args [string trimleft [join [lrange $ltext 1 end]]]
685                  if {[isbotnick $dest]} {                  if {[isbotnick $dest]} {
686                          # All MSG binds are called:                          # All MSG binds are called:
687                            putlog "callmsg:"
688                            putlog "nick: $nick"
689                            putlog "uhost: $uhost"
690                            putlog "handle: $handle"
691                            putlog "command: $command"
692                            putlog "args: $args"
693                          if {![::tcldrop::irc::callmsg $nick $uhost $handle $command $args]} {                          if {![::tcldrop::irc::callmsg $nick $uhost $handle $command $args]} {
694                                  # If callmsg returned 0, do the MSGM binds:                                  # If callmsg returned 0, do the MSGM binds:
695                                  ::tcldrop::irc::callmsgm $nick $uhost $handle $text                                  ::tcldrop::irc::callmsgm $nick $uhost $handle $text
# Line 972  proc ::tcldrop::irc::getchanmode {channe Line 978  proc ::tcldrop::irc::getchanmode {channe
978  #    Returns: nothing  #    Returns: nothing
979  # Proc by Papillon@EFNet  # Proc by Papillon@EFNet
980  proc ::tcldrop::irc::pushmode {channel mode {arg {}}} {  proc ::tcldrop::irc::pushmode {channel mode {arg {}}} {
981          # FixMe: Do this right!   =(          if {[botonchan $channel]} {
982          #        It should store all the modes.                  putserv "MODE $channel $mode $arg"
983          if {![botonchan $channel] || ($arg != {} && ![onchan $arg $channel]} { return }                  # FixMe: We're returning here, because the rest of this code is broken (not to mention ugly)!
984          variable PushModes                  return 0
985          set element [string tolower $channel,$mode]                  variable PushModes
986          if {[info exists PushModes($element)] } {                  set element [string tolower $channel,$mode]
987                  array set modestodo $PushModes($element)                  if {[info exists PushModes($element)] } {
988                  if {$arg != {}} { set arg [join "$modestodo(victim) $arg"] }                          array set modestodo $PushModes($element)
989          }                          if {$arg != {}} { set arg [join "$modestodo(victim) $arg"] }
990          array set modestodo [list mode $mode victim $arg]                  }
991          set PushModes($element) [array get modestodo]                  array set modestodo [list mode $mode victim $arg]
992          after idle [list flushmode $channel]                  set PushModes($element) [array get modestodo]
993                    after idle [list flushmode $channel]
994            }
995  }  }
996    
997  #  flushmode <channel>  #  flushmode <channel>
# Line 1081  proc ::tcldrop::irc::issomething {nick c Line 1089  proc ::tcldrop::irc::issomething {nick c
1089          }          }
1090          return [info exists found]          return [info exists found]
1091  }  }
1092    
1093    ### MSG Commands:
1094    # Note, these may best be put into their own file (irc-msg.tcl)
1095    namespace eval ::tcldrop::irc::msg {}
1096    
1097    bind msg o|o op ::tcldrop::irc::msg::op
1098    proc ::tcldrop::irc::msg::op {nick host hand text} {
1099            set pass [lindex [split $text] 0]
1100            set chan [lindex $text end]
1101            if {![passwdok $hand -] && [passwdok $hand $pass]} {
1102                    if {$chan != {}} { lappend channels $chan } else { set channels [channels] }
1103                    foreach c $channels { if {[matchattr $hand o|o $c]} { pushmode $c +o $nick } }
1104            }
1105    }

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

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