[Telepathy-commits] [telepathy-pinocchio/master] resolve a different problem with channel.contact_list.{ContactList, Group} member naming

Travis Reitter travis.reitter at collabora.co.uk
Wed Aug 20 10:36:18 PDT 2008


---
 pinocchio/channel/contact_list.py |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/pinocchio/channel/contact_list.py b/pinocchio/channel/contact_list.py
index 6a049ee..6a621ed 100644
--- a/pinocchio/channel/contact_list.py
+++ b/pinocchio/channel/contact_list.py
@@ -35,7 +35,7 @@ class ContactList(tp.server.ChannelTypeContactList,
                                                   channel_handle_obj)
         tp.server.ChannelInterfaceGroup.__init__(self)
 
-        self.connection = connection
+        self.parent_connection = connection
         self.account_id = account_id
         contacts_disk = pin.server.StoredContactList(connection,
                                                      channel_handle_obj)
@@ -71,19 +71,19 @@ class ContactList(tp.server.ChannelTypeContactList,
         handle_type = tp.constants.HANDLE_TYPE_CONTACT
 
         for handle_id in contacts:
-            if (handle_type, handle_id) not in self.connection._handles:
+            if (handle_type, handle_id) not in self.parent_connection._handles:
                 raise tp.errors.InvalidHandle('unknown contact handle %d' % \
                                               handle_id)
 
-        conn_handles = self.connection._handles
+        conn_handles = self.parent_connection._handles
         handle_objs = set([conn_handles[tp.constants.HANDLE_TYPE_CONTACT, x]
                            for x in contacts])
 
         self.MembersChanged(message, handle_objs, (), (), (),
-                            self.connection._self_handle,
+                            self.parent_connection._self_handle,
                             tp.constants.CHANNEL_GROUP_CHANGE_REASON_NONE)
 
-        self.connection.save()
+        self.parent_connection.save()
 
     def RemoveMembers(self, contacts, message):
         """Remove list of contacts from this group.
@@ -111,18 +111,18 @@ class ContactList(tp.server.ChannelTypeContactList,
         handle_type = tp.constants.HANDLE_TYPE_CONTACT
 
         for handle_id in contacts:
-            if (handle_type, handle_id) not in self.connection._handles:
+            if (handle_type, handle_id) not in self.parent_connection._handles:
                 raise tp.errors.InvalidHandle('unknown contact handle %d' % \
                                               handle_id)
 
-        conn_handles = self.connection._handles
+        conn_handles = self.parent_connection._handles
         handle_objs = set([conn_handles[tp.constants.HANDLE_TYPE_CONTACT, x]
                            for x in contacts])
 
         self.MembersChanged(message, (), handle_objs, (), (),
-                            self.connection._self_handle, reason)
+                            self.parent_connection._self_handle, reason)
 
-        self.connection.save()
+        self.parent_connection.save()
 
 class Group(tp.server.ChannelTypeContactList, tp.server.ChannelInterfaceGroup):
     """
@@ -136,7 +136,7 @@ class Group(tp.server.ChannelTypeContactList, tp.server.ChannelInterfaceGroup):
                                                   channel_handle_obj)
         tp.server.ChannelInterfaceGroup.__init__(self)
 
-        self.connection = connection
+        self.parent_connection = connection
         self.account_id = account_id
 
         contacts_disk = pin.server.StoredGroup(connection, channel_handle_obj)
@@ -173,19 +173,19 @@ class Group(tp.server.ChannelTypeContactList, tp.server.ChannelInterfaceGroup):
         handle_type = tp.constants.HANDLE_TYPE_CONTACT
 
         for handle_id in contacts:
-            if (handle_type, handle_id) not in self.connection._handles:
+            if (handle_type, handle_id) not in self.parent_connection._handles:
                 raise tp.errors.InvalidHandle('unknown contact handle %d' % \
                                               handle_id)
 
-        conn_handles = self.connection._handles
+        conn_handles = self.parent_connection._handles
         handle_objs = set([conn_handles[tp.constants.HANDLE_TYPE_CONTACT, x]
                            for x in contacts])
 
         self.MembersChanged(message, handle_objs, (), (), (),
-                            self.connection._self_handle,
+                            self.parent_connection._self_handle,
                             tp.constants.CHANNEL_GROUP_CHANGE_REASON_NONE)
 
-        self.connection.save()
+        self.parent_connection.save()
 
     def RemoveMembers(self, contacts, message):
         """Remove list of contacts from this group.
@@ -213,15 +213,15 @@ class Group(tp.server.ChannelTypeContactList, tp.server.ChannelInterfaceGroup):
         handle_type = tp.constants.HANDLE_TYPE_CONTACT
 
         for handle_id in contacts:
-            if (handle_type, handle_id) not in self.connection._handles:
+            if (handle_type, handle_id) not in self.parent_connection._handles:
                 raise tp.errors.InvalidHandle('unknown contact handle %d' % \
                                               handle_id)
 
-        conn_handles = self.connection._handles
+        conn_handles = self.parent_connection._handles
         handle_objs = set([conn_handles[tp.constants.HANDLE_TYPE_CONTACT, x]
                            for x in contacts])
 
         self.MembersChanged(message, (), handle_objs, (), (),
-                            self.connection._self_handle, reason)
+                            self.parent_connection._self_handle, reason)
 
-        self.connection.save()
+        self.parent_connection.save()
-- 
1.5.6.3



More information about the Telepathy-commits mailing list