aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0054_vcard
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2019-04-18 22:37:21 +0200
committerfiaxh <git@lightrise.org>2019-04-24 23:38:07 +0200
commita960740c3e88a16d5c7e10ff8594475d95894721 (patch)
treedf36cf52737187a4a6ee01fa34cc5cfc65704124 /xmpp-vala/src/module/xep/0054_vcard
parentb0dde02bc9e5ff29025ff5fc70fd46d56df5d2ec (diff)
downloaddino-a960740c3e88a16d5c7e10ff8594475d95894721.tar.gz
dino-a960740c3e88a16d5c7e10ff8594475d95894721.zip
Ensure image data is kept until avatars are written to file
Diffstat (limited to 'xmpp-vala/src/module/xep/0054_vcard')
-rw-r--r--xmpp-vala/src/module/xep/0054_vcard/module.vala4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmpp-vala/src/module/xep/0054_vcard/module.vala b/xmpp-vala/src/module/xep/0054_vcard/module.vala
index 96e412ac..2cebea2f 100644
--- a/xmpp-vala/src/module/xep/0054_vcard/module.vala
+++ b/xmpp-vala/src/module/xep/0054_vcard/module.vala
@@ -55,8 +55,8 @@ public class Module : XmppStreamModule {
if (iq.is_error()) return;
string? res = iq.stanza.get_deep_string_content(@"$NS_URI:vCard", "PHOTO", "BINVAL");
if (res == null) return;
- uint8[] content = Base64.decode(res);
- string sha1 = Checksum.compute_for_data(ChecksumType.SHA1, content);
+ Bytes content = new Bytes.take(Base64.decode(res));
+ string sha1 = Checksum.compute_for_bytes(ChecksumType.SHA1, content);
storage.store(sha1, content);
stream.get_module(IDENTITY).received_avatar(stream, iq.from, sha1);
}