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

Diff of /tcldrop/modules/dcc.tcl

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

revision 1.18 by fireegl, Mon Nov 17 22:55:36 2003 UTC revision 1.19 by fireegl, Tue Nov 18 02:58:31 2003 UTC
# Line 115  proc ::tcldrop::dcc::setchan {idx {chann Line 115  proc ::tcldrop::dcc::setchan {idx {chann
115  #      console modes, or nothing if that user isn't currently on the partyline  #      console modes, or nothing if that user isn't currently on the partyline
116  #    Module: core  #    Module: core
117  proc ::tcldrop::dcc::console {idx {channel {}} {modes {}}} {  proc ::tcldrop::dcc::console {idx {channel {}} {modes {}}} {
118          if {"$channel$modes" == {}} {          if {$idx == 0} {
119                  # Return their current console channel and modes.                  # The default console.
120                  # FixMe: If we don't have any set, then get it from the userfile.                  set changed 0
121                  # FixMe: Or, if they don't have any console data in the userfile,                  set console [list - $::console - 1 0 0]
122                  #        set it to sane defaults.          } elseif {![catch { ::tcldrop::idx::GetInfo $idx console } console]} {
123                  if {$idx == 0} {                  # The current idx's console settings.
124                          # Return the default console:                  set changed 0
125                          return [list - $::console - 1 0 0]          } elseif {![catch { getuser [idx2hand $idx] console } console] && $console != {}} {
126                  } elseif {![catch { ::tcldrop::idx::GetInfo $idx console } console]} {                  # The console settings from the userfile.
127                          # Return the currently active console:                  set changed 1
128                          return $console          } elseif {![valididx $idx]} {
129                  } elseif {![catch { getuser [idx2hand $idx] console } console] && $console != {}} {                  return -code error {Invalid idx.}
130                          ::tcldrop::idx::ChInfo $idx [list console $console]          } else {
131                          # Return the console settings from the userfile:                  # The default console:
132                          return $console                  set changed 1
133                  } else {                  set console [list - $::console - 1 0 0]
                         # Return the default console:  
                         return [list - $::console - 1 0 0]  
                 }  
134          }          }
135          # Eggdrop treats $channel the same as $modes, and vice versa, so we'll do the same...          # Eggdrop treats $channel the same as $modes, and vice versa, so we'll do the same...
136          foreach whatever [list $channel $modes] {          foreach whatever [list $channel $modes] {
# Line 141  proc ::tcldrop::dcc::console {idx {chann Line 138  proc ::tcldrop::dcc::console {idx {chann
138                  if {[validchan $whatever]} {                  if {[validchan $whatever]} {
139                          # They want to change their IRC console channel.                          # They want to change their IRC console channel.
140                          if {[matchattr [idx2hand $idx] vfomn|vfomn $whatever]} {                          if {[matchattr [idx2hand $idx] vfomn|vfomn $whatever]} {
141                                  # FixMe: So change it.                                  set changed 1
142                                    set console [lreplace $console 0 0 $whatever]
143                          }                          }
144                  } else {                  } else {
145                          # FixMe: They want to change their modes.                          set changed 1
146                            set console [lreplace $console 1 1 [::tcldrop::MergeFlags $whatever [lindex $console 1]]]
147                  }                  }
148          }          }
149            # Set the new console settings to the idx:
150            if {$changed} { ::tcldrop::idx::ChInfo $idx [list console $console] }
151            return $console
152  }  }
153    
154  #  echo <idx> [status]  #  echo <idx> [status]

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