update groupchat contacts avatar when they change it, and send our presence to groupchat when we change our vcard
This commit is contained in:
parent
0a7e840756
commit
2a5e41e06a
|
@ -895,7 +895,6 @@ class ConnectionVcard:
|
||||||
return
|
return
|
||||||
if self.awaiting_answers[id][0] == VCARD_PUBLISHED:
|
if self.awaiting_answers[id][0] == VCARD_PUBLISHED:
|
||||||
if iq_obj.getType() == 'result':
|
if iq_obj.getType() == 'result':
|
||||||
self.dispatch('VCARD_PUBLISHED', ())
|
|
||||||
vcard_iq = self.awaiting_answers[id][1]
|
vcard_iq = self.awaiting_answers[id][1]
|
||||||
# Save vcard to HD
|
# Save vcard to HD
|
||||||
if vcard_iq.getTag('PHOTO') and vcard_iq.getTag('PHOTO').getTag('SHA'):
|
if vcard_iq.getTag('PHOTO') and vcard_iq.getTag('PHOTO').getTag('SHA'):
|
||||||
|
@ -918,6 +917,7 @@ class ConnectionVcard:
|
||||||
show = sshow, status = self.status)
|
show = sshow, status = self.status)
|
||||||
p = self.add_sha(p)
|
p = self.add_sha(p)
|
||||||
self.connection.send(p)
|
self.connection.send(p)
|
||||||
|
self.dispatch('VCARD_PUBLISHED', ())
|
||||||
elif iq_obj.getType() == 'error':
|
elif iq_obj.getType() == 'error':
|
||||||
self.dispatch('VCARD_NOT_PUBLISHED', ())
|
self.dispatch('VCARD_NOT_PUBLISHED', ())
|
||||||
elif self.awaiting_answers[id][0] == VCARD_ARRIVED:
|
elif self.awaiting_answers[id][0] == VCARD_ARRIVED:
|
||||||
|
@ -1415,6 +1415,13 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco)
|
||||||
if gajim.config.get('log_contact_status_changes') and self.name\
|
if gajim.config.get('log_contact_status_changes') and self.name\
|
||||||
not in no_log_for and jid_stripped not in no_log_for:
|
not in no_log_for and jid_stripped not in no_log_for:
|
||||||
gajim.logger.write('gcstatus', who, status, show)
|
gajim.logger.write('gcstatus', who, status, show)
|
||||||
|
if avatar_sha:
|
||||||
|
if self.vcard_shas.has_key(who):
|
||||||
|
if avatar_sha != self.vcard_shas[who]:
|
||||||
|
# avatar has been updated
|
||||||
|
self.request_vcard(who, True)
|
||||||
|
else:
|
||||||
|
self.vcard_shas[who] = avatar_sha
|
||||||
self.dispatch('GC_NOTIFY', (jid_stripped, show, status, resource,
|
self.dispatch('GC_NOTIFY', (jid_stripped, show, status, resource,
|
||||||
prs.getRole(), prs.getAffiliation(), prs.getJid(),
|
prs.getRole(), prs.getAffiliation(), prs.getJid(),
|
||||||
prs.getReason(), prs.getActor(), prs.getStatusCode(),
|
prs.getReason(), prs.getActor(), prs.getStatusCode(),
|
||||||
|
|
|
@ -1293,6 +1293,12 @@ class Interface:
|
||||||
|
|
||||||
def handle_event_vcard_published(self, account, array):
|
def handle_event_vcard_published(self, account, array):
|
||||||
dialogs.InformationDialog(_('vCard publication succeeded'), _('Your personal information has been published successfully.'))
|
dialogs.InformationDialog(_('vCard publication succeeded'), _('Your personal information has been published successfully.'))
|
||||||
|
for gc_control in self.msg_win_mgr.get_controls(message_control.TYPE_GC):
|
||||||
|
if gc_control.account == account:
|
||||||
|
show = gajim.SHOW_LIST[gajim.connections[account].connected]
|
||||||
|
status = gajim.connections[account].status
|
||||||
|
gajim.connections[account].send_gc_status(gc_control.nick,
|
||||||
|
gc_control.room_jid, show, status)
|
||||||
|
|
||||||
def handle_event_vcard_not_published(self, account, array):
|
def handle_event_vcard_not_published(self, account, array):
|
||||||
dialogs.InformationDialog(_('vCard publication failed'), _('There was an error while publishing your personal information, try again later.'))
|
dialogs.InformationDialog(_('vCard publication failed'), _('There was an error while publishing your personal information, try again later.'))
|
||||||
|
|
Loading…
Reference in New Issue