[Tkabber-dev] r2079 - in trunk/tkabber-plugins: . otr

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Jan 22 22:08:47 MSK 2014


Author: sergei
Date: 2014-01-22 22:08:47 +0400 (Wed, 22 Jan 2014)
New Revision: 2079

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/otr/otr.tcl
Log:
	* otr/otr.tcl: Dont filter groupchat, error and headline stanzas.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2014-01-22 17:50:38 UTC (rev 2078)
+++ trunk/tkabber-plugins/ChangeLog	2014-01-22 18:08:47 UTC (rev 2079)
@@ -5,6 +5,8 @@
 	  shared secret or manual verification. Provisionally implemented
 	  a dialog where user can edit auth info.
 
+	* otr/otr.tcl: Dont filter groupchat, error and headline stanzas.
+
 2014-01-21  Sergei Golovan <sgolovan at nes.ru>
 
 	* otr/tclotr/key.tcl, otr/tclotr/pkgIndex.tcl: Added a new subpackage

Modified: trunk/tkabber-plugins/otr/otr.tcl
===================================================================
--- trunk/tkabber-plugins/otr/otr.tcl	2014-01-22 17:50:38 UTC (rev 2078)
+++ trunk/tkabber-plugins/otr/otr.tcl	2014-01-22 18:08:47 UTC (rev 2079)
@@ -864,6 +864,10 @@
     variable ns
     variable ctx
 
+    # Work only in chats and normal messages
+
+    if {$type ne "chat" && $type ne "normal"} return
+
     # We can't distinguish between bodyless message and message with empty
     # body, so be it
 
@@ -933,7 +937,7 @@
     return
 }
 
-hook::add rewrite_message_hook [namespace current]::otr::rewrite_message_body 40
+hook::add rewrite_message_hook [namespace current]::otr::rewrite_message_body 80
 
 ###############################################################################
 
@@ -959,10 +963,14 @@
      {vxlib vto vid vtype vsubject vbody verr vthread vx} {
     upvar 2 $vxlib xlib
     upvar 2 $vto to
+    upvar 2 $vtype type
     upvar 2 $vbody body
     upvar 2 $vx x
     variable ctx
 
+    if {[info exists type] &&
+	($type eq "groupchat" || $type eq "error" || $type eq "headline")} return
+
     if {![info exists body]} return
 
     once_only $xlib $to



More information about the Tkabber-dev mailing list