[kupfer: 6/22] plugin.pidgin: Make PidginContact.object unique for each contact



commit 88cdb3f69ddefbbdb104ff00682f1fc4c60203a6
Author: Chmouel Boudjnah <chmouel boudjnah rackspace co uk>
Date:   Tue Oct 27 22:00:40 2009 +0000

    plugin.pidgin: Make PidginContact.object unique for each contact
    
    Kupfer discards duplicates based on Leaf.__eq__ which by default
    considers the Leaves' names and objects. We store the unique tuple
    (account, jid) as represented object for PidginContact.

 kupfer/plugin/pidgin.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/kupfer/plugin/pidgin.py b/kupfer/plugin/pidgin.py
index 61166b0..0625c99 100644
--- a/kupfer/plugin/pidgin.py
+++ b/kupfer/plugin/pidgin.py
@@ -87,8 +87,11 @@ class SendMessage (Action):
 class PidginContact(Leaf):
 	""" Leaf represent single contact from Pidgin """
 
-	def __init__(self, jid, name, account, icon, protocol, availability, status_message):
-		Leaf.__init__(self, name or jid, name or jid)
+	def __init__(self, jid, name, account, icon, protocol, availability,
+		status_message):
+		obj = (account, jid)
+		Leaf.__init__(self, obj, name or jid)
+
 		if name:
 			self._description = "%s <%s>" % (name, jid)
 		else:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]