[Tkabber-dev] r295 - trunk/plugins/bmucx

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Feb 18 02:51:05 MSK 2010


Author: ancestor
Date: 2010-02-18 02:51:05 +0300 (Thu, 18 Feb 2010)
New Revision: 295

Modified:
   trunk/plugins/bmucx/bmucx.tcl
Log:
1) Fixed captcha blocking bug in bmucx.tcl.

Modified: trunk/plugins/bmucx/bmucx.tcl
===================================================================
--- trunk/plugins/bmucx/bmucx.tcl	2010-02-17 17:59:20 UTC (rev 294)
+++ trunk/plugins/bmucx/bmucx.tcl	2010-02-17 23:51:05 UTC (rev 295)
@@ -121,9 +121,16 @@
 ########################################################################################
 
 proc bmucx::block_user_priv {xlib from} {
-	set jid [::xmpp::jid::stripResource $from]
+	set jid [::xmpp::jid::stripResource $from]	
 	set chatid [chat::chatid $xlib $jid]
+	set my_jid [::chat::our_jid $chatid]
+
+	if {$from == $my_jid} {return 0}
+
 	if {[chat::is_groupchat $chatid]} {
+
+		if {$from == $jid} {return 0}
+
 		if {[info exists ::blockvar_priv($jid)] && $::blockvar_priv($jid)} {
 			if {[catch {set role [::muc::get_role $xlib $from]}]} {return 0}
 			if {$role == "moderator"} {
@@ -145,7 +152,14 @@
 proc bmucx::block_user {xlib from} {
 	set jid [::xmpp::jid::stripResource $from]
 	set chatid [chat::chatid $xlib $jid]
+	set my_jid [::chat::our_jid $chatid]
+
+	if {$from == $my_jid} {return 0}
+
 	if {[chat::is_groupchat $chatid]} {
+		
+		if {$from == $jid} {return 0}
+
 		if {[info exists ::blockvar($jid)] && $::blockvar($jid)} {
 			if {[catch {set role [::muc::get_role $xlib $from]}]} {return 0}
 			if {$role == "moderator"} {
@@ -166,13 +180,17 @@
 
 proc bmucx::block_pub_messages {xlib from id type is_subject subject body err thread priority x} {
 	if {$type == "groupchat" && [[namespace current]::block_user $xlib $from]} {
-		return stop	
+		set res stop
+		return $res
+		#return stop	
 	}
 }
 
 proc bmucx::block_priv_messages {xlib from id type is_subject subject body err thread priority x} {
 	if {$type != "groupchat" && [[namespace current]::block_user_priv $xlib $from]} {
-		return stop	
+		set res stop
+		return $res
+		#return stop	
 	}
 }
 



More information about the Tkabber-dev mailing list