Show
Ignore:
Timestamp:
07/03/08 23:43:28 (5 months ago)
Author:
asterix
Message:

keep caps info when we create a contact instance from groupchat_contact instance

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/contacts.py

    r9843 r9879  
    2727        '''Information concerning each contact''' 
    2828        def __init__(self, jid='', name='', groups=[], show='', status='', sub='', 
    29         ask='', resource='', priority=0, keyID='', our_chatstate=None, 
    30         chatstate=None, last_status_time=None, msg_id = None, composing_xep = None, 
    31         mood={}, tune={}, activity={}): 
     29        ask='', resource='', priority=0, keyID='', caps_node=None, 
     30        caps_hash_method=None, caps_hash=None, our_chatstate=None, chatstate=None, 
     31        last_status_time=None, msg_id = None, composing_xep = None,     mood={}, tune={}, 
     32        activity={}): 
    3233                self.jid = jid 
    3334                self.name = name 
     
    4445                # Capabilities; filled by caps.py/ConnectionCaps object 
    4546                # every time it gets these from presence stanzas 
    46                 self.caps_node = None 
    47                 self.caps_hash_method = None 
    48                 self.caps_hash = None 
     47                self.caps_node = caps_node 
     48                self.caps_hash_method = caps_hash_method 
     49                self.caps_hash = caps_hash 
    4950 
    5051                # please read xep-85 http://www.xmpp.org/extensions/xep-0085.html 
     
    534535                '''Create a Contact instance from a GC_Contact instance''' 
    535536                jid = gc_contact.get_full_jid() 
    536                 return Contact(jid = jid, resource = '', name = gc_contact.name, 
    537                         groups = [], show = gc_contact.show, status = gc_contact.status, 
    538                         sub = 'none') 
     537                return Contact(jid=jid, resource='', name=gc_contact.name, groups=[], 
     538                        show=gc_contact.show, status=gc_contact.status, sub='none', 
     539                        caps_node=gc_contact.caps_node, 
     540                        caps_hash_method=gc_contact.caps_hash_method, 
     541                        caps_hash=gc_contact.caps_hash) 
    539542 
    540543        def create_gc_contact(self, room_jid='', name='', show='', status='',