[Tkabber-dev] r103 - trunk/plugins/receipts

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Apr 7 02:19:43 MSD 2008


Author: kostix
Date: 2008-04-07 02:19:42 +0400 (Mon, 07 Apr 2008)
New Revision: 103

Modified:
   trunk/plugins/receipts/TODO
   trunk/plugins/receipts/receipts.tcl
Log:
receipts/receipts.tcl: Register Message Receipts feature in disco info.

receipts/TODO: Tasks updated.


Modified: trunk/plugins/receipts/TODO
===================================================================
--- trunk/plugins/receipts/TODO	2008-04-06 21:34:08 UTC (rev 102)
+++ trunk/plugins/receipts/TODO	2008-04-06 22:19:42 UTC (rev 103)
@@ -10,7 +10,10 @@
 
 * Provide Customize options.
 
+* Provide for sending receipts along with normal messages.
+  It appears to require a patch to Tkabber.
 
+
 LOW
 
 * Honor peer's features, if available.

Modified: trunk/plugins/receipts/receipts.tcl
===================================================================
--- trunk/plugins/receipts/receipts.tcl	2008-04-06 21:34:08 UTC (rev 102)
+++ trunk/plugins/receipts/receipts.tcl	2008-04-06 22:19:42 UTC (rev 103)
@@ -20,6 +20,8 @@
 	[namespace current]::attach_confirmation_request
     hook::add draw_message_hook \
 	[namespace current]::mark_unconfirmed 5
+
+    disco::register_feature $::NS(receipts)
 }
 
 proc receipts::process_message \
@@ -52,14 +54,25 @@
 }
 
 proc receipts::process_receipt_response {connid from id type} {
-    if {![string equal $type chat]} return
+    variable requests
 
-    set chatid [chat::chatid $connid $from]
-    set cw [chat::chat_win $chatid]
+    switch -- $type {
+	chat {
+	    set chatid [chat::chatid $connid $from]
+	    set cw [chat::chat_win $chatid]
 
-    set name msgid_$id
-    if {[lsearch -exact [$cw image names] $name] >= 0} {
-	$cw image configure $name -image receipts/confirmed
+	    set name msgid_$id
+	    if {[lsearch -exact [$cw image names] $name] >= 0} {
+		$cw image configure $name -image receipts/confirmed
+	    }
+	}
+	normal {
+	    return
+	    # TODO real implementation
+	    upvar 0 requests($from,$id) request
+	    if {![info exists request]} break
+	    tk_messageBox -message "Confirmed <$from> <$id>"
+	}
     }
 }
 



More information about the Tkabber-dev mailing list