aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/xmpp
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-08-03 20:28:13 +0200
committeriNPUTmice <daniel@gultsch.de>2014-08-03 20:28:13 +0200
commitdaab16bdef2f24f57d117efaa0144c578c883a6b (patch)
treefbea06de6eecf760161b95fe13b149c118acdef5 /src/eu/siacs/conversations/xmpp
parent88d1bd356c9408df6f12829dcd427b92af1e3969 (diff)
activity for future avatar publications. not working yet
Diffstat (limited to 'src/eu/siacs/conversations/xmpp')
-rw-r--r--src/eu/siacs/conversations/xmpp/pep/Avatar.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/xmpp/pep/Avatar.java b/src/eu/siacs/conversations/xmpp/pep/Avatar.java
new file mode 100644
index 00000000..196c876c
--- /dev/null
+++ b/src/eu/siacs/conversations/xmpp/pep/Avatar.java
@@ -0,0 +1,23 @@
+package eu.siacs.conversations.xmpp.pep;
+
+import android.util.Base64;
+
+public class Avatar {
+ public String type;
+ public String sha1sum;
+ public String image;
+ public byte[] getImageAsBytes() {
+ return Base64.decode(image, Base64.DEFAULT);
+ }
+ public String getFilename() {
+ if (type==null) {
+ return sha1sum;
+ } else if (type.equalsIgnoreCase("image/webp")) {
+ return sha1sum+".webp";
+ } else if (type.equalsIgnoreCase("image/png")) {
+ return sha1sum+".png";
+ } else {
+ return sha1sum;
+ }
+ }
+}