From daab16bdef2f24f57d117efaa0144c578c883a6b Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Sun, 3 Aug 2014 20:28:13 +0200 Subject: activity for future avatar publications. not working yet --- .../siacs/conversations/services/XmppConnectionService.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/eu/siacs/conversations/services') diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 3f9b3bfb..4ba0954f 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -53,6 +53,7 @@ import eu.siacs.conversations.xmpp.XmppConnection; import eu.siacs.conversations.xmpp.jingle.JingleConnectionManager; import eu.siacs.conversations.xmpp.jingle.OnJinglePacketReceived; import eu.siacs.conversations.xmpp.jingle.stanzas.JinglePacket; +import eu.siacs.conversations.xmpp.pep.Avatar; import eu.siacs.conversations.xmpp.stanzas.IqPacket; import eu.siacs.conversations.xmpp.stanzas.MessagePacket; import eu.siacs.conversations.xmpp.stanzas.PresencePacket; @@ -64,6 +65,7 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.database.ContentObserver; +import android.graphics.Bitmap; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.Uri; @@ -1183,6 +1185,17 @@ public class XmppConnectionService extends Service { } } + + public void pushAvatar(Account account, Uri image) { + Avatar avatar = getFileBackend().getPepAvatar(image, 192, Bitmap.CompressFormat.WEBP); + if (avatar!=null) { + Log.d(LOGTAG,avatar.sha1sum); + Log.d(LOGTAG,avatar.image); + avatar.type = "image/webp"; + getFileBackend().save(avatar); + } + } + public void deleteContactOnServer(Contact contact) { contact.resetOption(Contact.Options.PREEMPTIVE_GRANT); contact.resetOption(Contact.Options.DIRTY_PUSH); -- cgit v1.2.3