diff options
Diffstat (limited to 'main/src/ui/avatar_image.vala')
-rw-r--r-- | main/src/ui/avatar_image.vala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/main/src/ui/avatar_image.vala b/main/src/ui/avatar_image.vala index 81aa3ce1..f7731373 100644 --- a/main/src/ui/avatar_image.vala +++ b/main/src/ui/avatar_image.vala @@ -9,6 +9,7 @@ public class AvatarImage : Misc { public int height { get; set; default = 35; } public int width { get; set; default = 35; } public bool allow_gray { get; set; default = true; } + public bool force_gray { get; set; default = false; } public StreamInteractor? stream_interactor { get; set; } public AvatarManager? avatar_manager { owned get { return stream_interactor == null ? null : stream_interactor.get_module(AvatarManager.IDENTITY); } } public MucManager? muc_manager { owned get { return stream_interactor == null ? null : stream_interactor.get_module(MucManager.IDENTITY); } } @@ -78,14 +79,14 @@ public class AvatarImage : Misc { string user_color = Util.get_avatar_hex_color(stream_interactor, account, conversation.counterpart, conversation); if (avatar_manager.has_avatar_cached(account, conversation.counterpart)) { drawer = new AvatarDrawer().tile(avatar_manager.get_cached_avatar(account, conversation.counterpart), "#", user_color); - if (allow_gray && (!is_self_online() || !is_counterpart_online())) drawer.grayscale(); + if (force_gray || allow_gray && (!is_self_online() || !is_counterpart_online())) drawer.grayscale(); } else { Gee.List<Jid>? occupants = muc_manager.get_other_offline_members(conversation.counterpart, account); if (muc_manager.is_private_room(account, conversation.counterpart) && occupants != null && occupants.size > 0) { jids = occupants.to_array(); } else { drawer = new AvatarDrawer().tile(null, "#", user_color); - if (allow_gray && (!is_self_online() || !is_counterpart_online())) drawer.grayscale(); + if (force_gray || allow_gray && (!is_self_online() || !is_counterpart_online())) drawer.grayscale(); } try_load_avatar_async(conversation.counterpart); } @@ -116,7 +117,7 @@ public class AvatarImage : Misc { if (jids.length > 4) { drawer.plus(); } - if (allow_gray && (!is_self_online() || !is_counterpart_online())) drawer.grayscale(); + if (force_gray || allow_gray && (!is_self_online() || !is_counterpart_online())) drawer.grayscale(); } |