[kupfer] pidgin: Adjust repr_key to be persistent



commit b6e347fbdaea95566f43fad39cc873d01b65cf2c
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Wed Jan 20 01:13:57 2010 +0100

    pidgin: Adjust repr_key to be persistent
    
    We can't use the account number in the repr_key since it changes
    between invocations of Pidgin for the same contact.

 kupfer/plugin/pidgin.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/plugin/pidgin.py b/kupfer/plugin/pidgin.py
index 680de0e..5ab6d13 100644
--- a/kupfer/plugin/pidgin.py
+++ b/kupfer/plugin/pidgin.py
@@ -164,9 +164,11 @@ class PidginContact(ContactLeaf):
 		self.account = account
 		self.jid = jid
 		self.icon = icon
+		self.protocol = protocol
 
 	def repr_key(self):
-		return "%s, %s" % (self.object[PIDGIN_ACCOUNT], self.object[PIDGIN_JID])
+		# the repr key should be persistent and hopefully unique
+		return "%s, %s" % (self.protocol, self.object[PIDGIN_JID])
 
 	def get_description(self):
 		return self._description



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