aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/services
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-08-05 22:58:46 +0200
committeriNPUTmice <daniel@gultsch.de>2014-08-05 22:58:46 +0200
commitba63727f50c192e63e171bedca92d7003981800c (patch)
tree6b4956817a46266ec3de683bc6d7a4e46681a656 /src/eu/siacs/conversations/services
parent08755e56a5bf861c97eefd545f629ac67a804275 (diff)
fetch missing avatars from server
Diffstat (limited to 'src/eu/siacs/conversations/services')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java16
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);