[Tkabber-dev] r426 - trunk/plugins/juick

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Oct 22 19:00:38 MSD 2010


Author: Totktonada
Date: 2010-10-22 19:00:38 +0400 (Fri, 22 Oct 2010)
New Revision: 426

Modified:
   trunk/plugins/juick/juick.tcl
Log:
Remove delay_send. See http://juick.com/1002939.

Modified: trunk/plugins/juick/juick.tcl
===================================================================
--- trunk/plugins/juick/juick.tcl	2010-10-22 14:21:09 UTC (rev 425)
+++ trunk/plugins/juick/juick.tcl	2010-10-22 15:00:38 UTC (rev 426)
@@ -9,9 +9,6 @@
 option add *juick.citing		gray35		widgetDefault
 
 namespace eval juick {
-variable last_message_time 0
-variable last_private_time 0
-
 ::msgcat::mcload [file join [file dirname [info script]] msgs]
 
 if {![::plugins::is_registered juick]} {
@@ -34,7 +31,6 @@
     hook::add draw_message_hook [namespace current]::handle_message 21
     hook::add chat_window_click_hook [namespace current]::insert_from_window
     hook::add chat_win_popup_menu_hook [namespace current]::add_juick_things_menu 20
-    hook::add chat_send_message_hook [namespace current]::delay_send 11
 }
 
 proc unload {} {
@@ -42,7 +38,6 @@
     hook::remove draw_message_hook [namespace current]::handle_message 21
     hook::remove chat_window_click_hook [namespace current]::insert_from_window
     hook::remove chat_win_popup_menu_hook [namespace current]::add_juick_things_menu 20
-    hook::remove chat_send_message_hook [namespace current]::delay_send 11
 
     ::richtext::entity_state juick_numbers 0
     ::richtext::entity_state citing 0
@@ -72,38 +67,6 @@
     }
 }
 
-proc send_by_timeout {var_last_send_time run_cmd} {
-      upvar $var_last_send_time last_send_time
-
-      if {$last_send_time != 0} {
-         set wait_time [expr $last_send_time+10001-[clock clicks -milliseconds]]
-         if {$wait_time > 0} {
-            after $wait_time $run_cmd
-            return stop;
-         }
-      }
-
-      set last_send_time [clock clicks -milliseconds]
-      return;
-}
-
-proc delay_send {chatid user body type} {
-    variable last_message_time
-    variable last_private_time
-
-    if {[is_juick $chatid]} {
-       set run_cmd [list hook::run chat_send_message_hook $chatid $user $body $type]
-
-       if {[regexp {^#\d+(/\d+)?[ ]+[^ ]?.*} $body]} {
-          return [send_by_timeout last_message_time $run_cmd];
-       } elseif {[regexp {^PM @[^ ]+[ ]+[^ ]?.*} $body]} {
-          return [send_by_timeout last_private_time $run_cmd];
-       }
-    }
-
-    return;
-}
-
 proc ignore_server_messages {chatid from type body x} {
     if {[is_juick $chatid] && $from == ""} {
         return stop;



More information about the Tkabber-dev mailing list