tcldrop-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tcldrop/CVS] tcldrop/modules/server server.tcl


From: Philip Moore
Subject: [Tcldrop/CVS] tcldrop/modules/server server.tcl
Date: Thu, 20 Nov 2003 20:37:27 -0500

CVSROOT:        /cvsroot/tcldrop
Module name:    tcldrop
Branch:         
Changes by:     Philip Moore <address@hidden>   03/11/20 20:37:27

Modified files:
        modules/server : server.tcl 

Log message:
        Added support for the double-mode, double-server, and double-help 
settings.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/tcldrop/tcldrop/modules/server/server.tcl.diff?tr1=1.9&tr2=1.10&r1=text&r2=text

Patches:
Index: tcldrop/modules/server/server.tcl
diff -u tcldrop/modules/server/server.tcl:1.9 
tcldrop/modules/server/server.tcl:1.10
--- tcldrop/modules/server/server.tcl:1.9       Fri Nov 14 10:58:48 2003
+++ tcldrop/modules/server/server.tcl   Thu Nov 20 20:37:27 2003
@@ -1,6 +1,6 @@
 # server.tcl --
 #
-# $Id: server.tcl,v 1.9 2003/11/14 15:58:48 fireegl Exp $
+# $Id: server.tcl,v 1.10 2003/11/21 01:37:27 fireegl Exp $
 #
 # Copyright (C) 2003 FireEgl (Philip Moore) <address@hidden>
 #
@@ -27,7 +27,7 @@
 
 namespace eval ::tcldrop::server {
        variable version {0.2}
-       variable rcsid {$Id: server.tcl,v 1.9 2003/11/14 15:58:48 fireegl Exp $}
+       variable rcsid {$Id: server.tcl,v 1.10 2003/11/21 01:37:27 fireegl Exp 
$}
        # Provide the server module:
        package provide tcldrop::server $version
        # Initialize variables:
@@ -323,7 +323,7 @@
        } elseif {$queue == 0} {
                # What?!  We didn't wait long enough!?  How is that possible! =P
                # Anyways, let's wait out the rest of the time, plus a little 
bit more and try again..
-               after [expr $SentData(penalty) - $waited + 99] [list 
::tcldrop::server::Queue 0]
+               after [expr {$SentData(penalty) - $waited + 99}] [list 
::tcldrop::server::Queue 0]
        }
 }
 
@@ -342,14 +342,20 @@
 # $queue must be mode, serv, help, or a integer from 1-99.
 # $option can be -normal or -next (Like in Eggdrop).
 proc ::tcldrop::server::putqueue {queue text {option {-normal}}} {
+       variable QueueAliases
        if {[info exists QueueAliases($queue)]} {
-               set queue $QueueAliases($queue)
+               set priority $QueueAliases($queue)
        }
+       variable Queue
        # Unlike Eggdrop, we deal with people sending multiple lines at once..
        foreach line [split $text \n] {
                if {$line != {}} {
-                       putloglev v * "\[!$queue\] $line"
-                       Queue $queue $line $option
+                       if {[info exists "::double-$queue"] && ![set 
"::double-$queue"] && [lsearch -exact $Queue($priority) $line] != -1} {
+                               putloglev d * "msg already queued. skipping: 
$line"
+                       } else {
+                               putloglev v * "\[!$queue\] $line"
+                               Queue $priority $line $option
+                       }
                }
        }
 }
@@ -360,7 +366,7 @@
 }
 
 proc ::tcldrop::server::putserv {text {option {-normal}}} {
-       putqueue serv $text $option
+       putqueue server $text $option
 }
 
 proc ::tcldrop::server::puthelp {text {option {-normal}}} {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]