diff options
Diffstat (limited to 'src/eu/siacs/conversations/services')
-rw-r--r-- | src/eu/siacs/conversations/services/XmppConnectionService.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 8c964517..71f2cfc2 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -1231,6 +1231,22 @@ public class XmppConnectionService extends Service { } } + public void fetchAvatar(Account account, final Avatar avatar) { + IqPacket packet = this.mIqGenerator.retrieveAvatar(avatar); + sendIqPacket(account, packet, new OnIqPacketReceived() { + + @Override + public void onIqPacketReceived(Account account, IqPacket result) { + avatar.image = mIqParser.avatarData(result); + if (avatar.image!=null) { + getFileBackend().save(avatar); + Contact contact = account.getRoster().getContact(avatar.owner); + contact.setAvatar(avatar.getFilename()); + } + } + }); + } + public void deleteContactOnServer(Contact contact) { contact.resetOption(Contact.Options.PREEMPTIVE_GRANT); contact.resetOption(Contact.Options.DIRTY_PUSH); |