aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service
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 /libdino/src/service
parentb0dde02bc9e5ff29025ff5fc70fd46d56df5d2ec (diff)
downloaddino-a960740c3e88a16d5c7e10ff8594475d95894721.tar.gz
dino-a960740c3e88a16d5c7e10ff8594475d95894721.zip
Ensure image data is kept until avatars are written to file
Diffstat (limited to 'libdino/src/service')
-rw-r--r--libdino/src/service/avatar_storage.vala4
1 files changed, 2 insertions, 2 deletions
diff --git a/libdino/src/service/avatar_storage.vala b/libdino/src/service/avatar_storage.vala
index f40414d1..b924ca27 100644
--- a/libdino/src/service/avatar_storage.vala
+++ b/libdino/src/service/avatar_storage.vala
@@ -12,12 +12,12 @@ public class AvatarStorage : Xep.PixbufStorage, Object {
DirUtils.create_with_parents(folder, 0700);
}
- public void store(string id, uint8[] data) {
+ public void store(string id, Bytes data) {
File file = File.new_for_path(Path.build_filename(folder, id));
try {
if (file.query_exists()) file.delete(); //TODO y?
DataOutputStream fos = new DataOutputStream(file.create(FileCreateFlags.REPLACE_DESTINATION));
- fos.write_async.begin(data);
+ fos.write_bytes_async.begin(data);
} catch (Error e) {
// Ignore: we failed in storing, so we refuse to display later...
}