diff options
Diffstat (limited to 'libdino/src/service/avatar_manager.vala')
-rw-r--r-- | libdino/src/service/avatar_manager.vala | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/libdino/src/service/avatar_manager.vala b/libdino/src/service/avatar_manager.vala index 032bd576..1c0a3b51 100644 --- a/libdino/src/service/avatar_manager.vala +++ b/libdino/src/service/avatar_manager.vala @@ -7,7 +7,8 @@ using Dino.Entities; namespace Dino { public class AvatarManager : StreamInteractionModule, Object { - public const string id = "avatar_manager"; + public static ModuleIdentity<AvatarManager> IDENTITY = new ModuleIdentity<AvatarManager>("avatar_manager"); + public string id { get { return IDENTITY.id; } } public signal void received_avatar(Pixbuf avatar, Jid jid, Account account); @@ -46,7 +47,7 @@ public class AvatarManager : StreamInteractionModule, Object { public Pixbuf? get_avatar(Account account, Jid jid) { Jid jid_ = jid; - if (!MucManager.get_instance(stream_interactor).is_groupchat_occupant(jid, account)) { + if (!stream_interactor.get_module(MucManager.IDENTITY).is_groupchat_occupant(jid, account)) { jid_ = jid.bare_jid; } string? user_avatars_id = user_avatars[jid_]; @@ -61,7 +62,6 @@ public class AvatarManager : StreamInteractionModule, Object { } public void publish(Account account, string file) { - print(file + "\n"); try { Pixbuf pixbuf = new Pixbuf.from_file(file); if (pixbuf.width >= pixbuf.height && pixbuf.width > MAX_PIXEL) { @@ -83,14 +83,6 @@ public class AvatarManager : StreamInteractionModule, Object { } } - public static AvatarManager? get_instance(StreamInteractor stream_interaction) { - return (AvatarManager) stream_interaction.get_module(id); - } - - internal string get_id() { - return id; - } - private void on_account_added(Account account) { stream_interactor.module_manager.get_module(account, Xep.UserAvatars.Module.IDENTITY).received_avatar.connect((stream, jid, id) => on_user_avatar_received(account, new Jid(jid), id) |