From 944449009dfa4d66c96e7568f9798f21ffbb0392 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 21 Dec 2005 10:28:42 +0000 Subject: [PATCH] new functions in Contacts instance --- src/common/contacts.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/common/contacts.py b/src/common/contacts.py index e49bc6a38..a2e7b54b8 100644 --- a/src/common/contacts.py +++ b/src/common/contacts.py @@ -81,6 +81,13 @@ class Contacts: chatstate=None): return Contact(jid, name, groups, show, status, sub, ask, resource, priority, keyID, our_chatstate, chatstate) + + def copy_contact(self, contact): + return self.create_contact(jid = contact.jid, name = contact.name, + groups = contact.groups, show = contact.show, status = contact.status, + sub = contact.sub, ask = contact.ask, resource = contact.resource, + priority = contact.priority, keyID = contact.keyID, + our_chatstate = contact.our_chatstate, chatstate = contact.chatstate) def add_contact(self, account, contact): # No such account before ? @@ -109,6 +116,10 @@ class Contacts: if not len(self._contacts[account][contact.jid]): self._contacts[account].remove(contact.jid) + def create_gc_contact(self, room_jid='', nick='', show='', status='', + role='', affiliation='', jid=''): + return GC_Contact(room_jid, nick, show, status, role, affiliation, jid) + def add_gc_contact(self, account, gc_contact): # No such account before ? if not self._gc_contacts.has_key(account):