aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/avatar_manager.vala
diff options
context:
space:
mode:
Diffstat (limited to 'libdino/src/service/avatar_manager.vala')
-rw-r--r--libdino/src/service/avatar_manager.vala34
1 files changed, 0 insertions, 34 deletions
diff --git a/libdino/src/service/avatar_manager.vala b/libdino/src/service/avatar_manager.vala
index 4d86588f..b308aa2b 100644
--- a/libdino/src/service/avatar_manager.vala
+++ b/libdino/src/service/avatar_manager.vala
@@ -45,28 +45,6 @@ public class AvatarManager : StreamInteractionModule, Object {
});
}
- private async Pixbuf? get_avatar_by_hash(string hash) {
- if (cached_pixbuf.has_key(hash)) {
- return cached_pixbuf[hash];
- }
- if (pending_pixbuf.has_key(hash)) {
- pending_pixbuf[hash].add(new SourceFuncWrapper(get_avatar_by_hash.callback));
- yield;
- return cached_pixbuf[hash];
- }
- pending_pixbuf[hash] = new ArrayList<SourceFuncWrapper>();
- Pixbuf? image = yield get_image(hash);
- if (image != null) {
- cached_pixbuf[hash] = image;
- } else {
- db.avatar.delete().with(db.avatar.hash, "=", hash).perform();
- }
- foreach (SourceFuncWrapper sfw in pending_pixbuf[hash]) {
- sfw.sfun();
- }
- return image;
- }
-
private string? get_avatar_hash(Account account, Jid jid_) {
Jid jid = jid_;
if (!stream_interactor.get_module(MucManager.IDENTITY).is_groupchat_occupant(jid_, account)) {
@@ -86,18 +64,6 @@ public class AvatarManager : StreamInteractionModule, Object {
return hash != null && cached_pixbuf.has_key(hash);
}
- public async bool has_avatar_stored(Account account, Jid jid) {
- string? hash = get_avatar_hash(account, jid);
- if (hash == null) return false;
- if (cached_pixbuf.has_key(hash)) return true;
- try {
- if ((yield File.new_for_path(Path.build_filename(folder, hash)).query_info_async(FileAttribute.STANDARD_NAME, FileQueryInfoFlags.NONE)) != null) return true;
- } catch (IOError ignored) {
- return false;
- }
- return false;
- }
-
public bool has_avatar(Account account, Jid jid) {
return get_avatar_hash(account, jid) != null;
}