[Tkabber-dev] r1946 - in trunk/tkabber: . plugins/general

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Oct 25 19:30:03 MSD 2010


Author: sergei
Date: 2010-10-25 19:30:02 +0400 (Mon, 25 Oct 2010)
New Revision: 1946

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/iq.tcl
   trunk/tkabber/plugins/general/bob.tcl
Log:
	* iq.tcl: Added client_iq_hook for all incoming IQ stanzas.
	* plugins/general/bob.tcl: Find and cache BOB elements in incoming IQ
	  stanzas.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2010-10-14 14:08:42 UTC (rev 1945)
+++ trunk/tkabber/ChangeLog	2010-10-25 15:30:02 UTC (rev 1946)
@@ -1,3 +1,9 @@
+2010-10-25  Sergei Golovan  <sgolovan at nes.ru>
+
+	* iq.tcl: Added client_iq_hook for all incoming IQ stanzas.
+	* plugins/general/bob.tcl: Find and cache BOB elements in incoming IQ
+	  stanzas.
+
 2010-10-14  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/chat/popupmenu.tcl: Switched "search in Google" shortcut to

Modified: trunk/tkabber/iq.tcl
===================================================================
--- trunk/tkabber/iq.tcl	2010-10-14 14:08:42 UTC (rev 1945)
+++ trunk/tkabber/iq.tcl	2010-10-25 15:30:02 UTC (rev 1946)
@@ -21,10 +21,10 @@
 proc client:iq {xlib from type queries args} {
     debugmsg iq "$xlib $from $type $queries $args"
 
-    eval [list ::iq::process $xlib $from $type $queries] $args
+    eval {hook::run client_iq_hook $xlib $from $type $queries} $args
 }
 
-proc ::iq::process {xlib from type queries args} {
+proc ::iq::show_iq_in_status {xlib from type queries args} {
     variable options
 
     if {$type != "set" && $type != "get"} return
@@ -46,5 +46,7 @@
     }
 }
 
+hook::add client_iq_hook ::iq::show_iq_in_status
+
 plugins::load [file join plugins iq]
 

Modified: trunk/tkabber/plugins/general/bob.tcl
===================================================================
--- trunk/tkabber/plugins/general/bob.tcl	2010-10-14 14:08:42 UTC (rev 1945)
+++ trunk/tkabber/plugins/general/bob.tcl	2010-10-25 15:30:02 UTC (rev 1946)
@@ -5,6 +5,7 @@
 namespace eval bob {
     hook::add process_message_hook [namespace current]::find_bob_in_message 1
     hook::add client_presence_hook [namespace current]::find_bob_in_presence 1
+    hook::add client_iq_hook [namespace current]::find_bob_in_iq 1
 }
 
 proc bob::find_bob_in_message {xlib from id type is_subject
@@ -16,3 +17,12 @@
     ::xmpp::bob::cache $x
 }
 
+proc bob::find_bob_in_iq {xlib from type queries args} {
+    if {[string equal $type error]} return
+
+    foreach xml $queries {
+	::xmpp::xml::split $xml tag xmlns attrs cdata subels
+	::xmpp::bob::cache $subels
+    }
+}
+



More information about the Tkabber-dev mailing list