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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Feb 18 19:59:54 MSK 2010


Author: ancestor
Date: 2010-02-18 19:59:54 +0300 (Thu, 18 Feb 2010)
New Revision: 296

Modified:
   trunk/plugins/bmucx/bmucx.tcl
Log:
1) Fixed get our_jid bug in bmucx.tcl.

Modified: trunk/plugins/bmucx/bmucx.tcl
===================================================================
--- trunk/plugins/bmucx/bmucx.tcl	2010-02-17 23:51:05 UTC (rev 295)
+++ trunk/plugins/bmucx/bmucx.tcl	2010-02-18 16:59:54 UTC (rev 296)
@@ -123,13 +123,11 @@
 proc bmucx::block_user_priv {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]} {
+		set my_jid [::chat::our_jid $chatid]
 
-		if {$from == $jid} {return 0}
+		if {$from == $my_jid || $from == $jid} {return 0}
 
 		if {[info exists ::blockvar_priv($jid)] && $::blockvar_priv($jid)} {
 			if {[catch {set role [::muc::get_role $xlib $from]}]} {return 0}
@@ -152,14 +150,12 @@
 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}
+		set my_jid [::chat::our_jid $chatid]
 
+		if {$from == $my_jid || $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"} {
@@ -180,17 +176,13 @@
 
 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]} {
-		set res stop
-		return $res
-		#return stop	
+		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]} {
-		set res stop
-		return $res
-		#return stop	
+		return stop	
 	}
 }
 



More information about the Tkabber-dev mailing list