aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/avatar_generator.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-03-19 12:55:36 +0100
committerfiaxh <git@mx.ax.lt>2017-03-20 22:28:27 +0100
commitdb57a973534f099af2b150f1a1307d1948553d9f (patch)
tree238ae1d4e53412a33e3febd07318dfd38b0eb2f8 /main/src/ui/avatar_generator.vala
parent233f2b35d033cd20d1ac648bf2d723bcb7a918fc (diff)
downloaddino-db57a973534f099af2b150f1a1307d1948553d9f.tar.gz
dino-db57a973534f099af2b150f1a1307d1948553d9f.zip
Add typed identity to manager modules and stream flags
Diffstat (limited to 'main/src/ui/avatar_generator.vala')
-rw-r--r--main/src/ui/avatar_generator.vala12
1 files changed, 6 insertions, 6 deletions
diff --git a/main/src/ui/avatar_generator.vala b/main/src/ui/avatar_generator.vala
index b668444c..eb87a3e2 100644
--- a/main/src/ui/avatar_generator.vala
+++ b/main/src/ui/avatar_generator.vala
@@ -31,7 +31,7 @@ public class AvatarGenerator {
}
public Pixbuf draw_message(StreamInteractor stream_interactor, Message message) {
- Jid? real_jid = MucManager.get_instance(stream_interactor).get_message_real_jid(message);
+ Jid? real_jid = stream_interactor.get_module(MucManager.IDENTITY).get_message_real_jid(message);
return draw_jid(stream_interactor, real_jid != null ? real_jid : message.from, message.account);
}
@@ -73,7 +73,7 @@ public class AvatarGenerator {
}
private Pixbuf draw_tile(Jid jid, Account account, int width, int height) {
- if (MucManager.get_instance(stream_interactor).is_groupchat(jid, account)) {
+ if (stream_interactor.get_module(MucManager.IDENTITY).is_groupchat(jid, account)) {
return draw_groupchat_tile(jid, account, width, height);
} else {
return draw_chat_tile(jid, account, width, height);
@@ -81,13 +81,13 @@ public class AvatarGenerator {
}
private Pixbuf draw_chat_tile(Jid jid, Account account, int width, int height) {
- if (MucManager.get_instance(stream_interactor).is_groupchat_occupant(jid, account)) {
- Jid? real_jid = MucManager.get_instance(stream_interactor).get_real_jid(jid, account);
+ if (stream_interactor.get_module(MucManager.IDENTITY).is_groupchat_occupant(jid, account)) {
+ Jid? real_jid = stream_interactor.get_module(MucManager.IDENTITY).get_real_jid(jid, account);
if (real_jid != null) {
return draw_tile(real_jid, account, width, height);
}
}
- Pixbuf? avatar = AvatarManager.get_instance(stream_interactor).get_avatar(account, jid);
+ Pixbuf? avatar = stream_interactor.get_module(AvatarManager.IDENTITY).get_avatar(account, jid);
if (avatar != null) {
double desired_ratio = (double) width / height;
double avatar_ratio = (double) avatar.width / avatar.height;
@@ -109,7 +109,7 @@ public class AvatarGenerator {
}
private Pixbuf draw_groupchat_tile(Jid jid, Account account, int width, int height) {
- ArrayList<Jid>? occupants = MucManager.get_instance(stream_interactor).get_other_occupants(jid, account);
+ ArrayList<Jid>? occupants = stream_interactor.get_module(MucManager.IDENTITY).get_other_occupants(jid, account);
if (stateless || occupants == null || occupants.size == 0) {
return draw_chat_tile(jid, account, width, height);
}