Mood and Activity shown in tooltips. Caps set properly
This commit is contained in:
parent
149b0fcdef
commit
06f43c1e2a
|
@ -1511,7 +1511,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
''' Called when we receive <message/> with pubsub event. '''
|
||||
# TODO: Logging? (actually services where logging would be useful, should
|
||||
# TODO: allow to access archives remotely...)
|
||||
jid = helpers.get_jid_from_iq(msg)
|
||||
jid = helpers.get_full_jid_from_iq(msg)
|
||||
event = msg.getTag('event')
|
||||
|
||||
# XEP-0107: User Mood
|
||||
|
|
|
@ -18,7 +18,7 @@ import common.gajim
|
|||
|
||||
class Contact:
|
||||
'''Information concerning each contact'''
|
||||
def __init__(self, jid='', name='', groups=[], show='', status='', mood={}, activity={}, sub='',
|
||||
def __init__(self, jid='', name='', groups=[], show='', status='', sub='',
|
||||
ask='', resource='', priority=0, keyID='', our_chatstate=None,
|
||||
chatstate=None, last_status_time=None, msg_id = None, composing_jep = None):
|
||||
self.jid = jid
|
||||
|
@ -26,8 +26,8 @@ class Contact:
|
|||
self.groups = groups
|
||||
self.show = show
|
||||
self.status = status
|
||||
self.mood = mood
|
||||
self.activity = activity
|
||||
self.mood = dict()
|
||||
self.activity = dict()
|
||||
self.sub = sub
|
||||
self.ask = ask
|
||||
self.resource = resource
|
||||
|
@ -141,19 +141,17 @@ class Contacts:
|
|||
del self._gc_contacts[account]
|
||||
del self._metacontacts_tags[account]
|
||||
|
||||
def create_contact(self, jid='', name='', groups=[], show='', status='', mood={}, activity={},
|
||||
def create_contact(self, jid='', name='', groups=[], show='', status='',
|
||||
sub='', ask='', resource='', priority=0, keyID='', our_chatstate=None,
|
||||
chatstate=None, last_status_time=None, composing_jep=None):
|
||||
return Contact(jid, name, groups, show, status, mood,
|
||||
activity, sub, ask, resource,
|
||||
return Contact(jid, name, groups, show, status, sub, ask, resource,
|
||||
priority, keyID, our_chatstate, chatstate, last_status_time,
|
||||
composing_jep)
|
||||
|
||||
def copy_contact(self, contact):
|
||||
return self.create_contact(jid = contact.jid, name = contact.name,
|
||||
groups = contact.groups, show = contact.show, status =
|
||||
contact.status, mood = contact.mood, activity =
|
||||
contact.activity, sub = contact.sub, ask = contact.ask, resource = contact.resource,
|
||||
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,
|
||||
last_status_time = contact.last_status_time)
|
||||
|
|
|
@ -3,6 +3,7 @@ from common import gajim
|
|||
|
||||
def user_mood(items, name, jid):
|
||||
(user, resource) = gajim.get_room_and_nick_from_fjid(jid)
|
||||
print 'User: %s, Resource: %s' % (user, resource)
|
||||
contacts = gajim.contacts.get_contact(name, user, resource=resource)
|
||||
for item in items.getTags('item'):
|
||||
child = item.getTag('mood')
|
||||
|
|
Loading…
Reference in New Issue