aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/avatar_image.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2021-11-04 17:35:11 +0100
committerfiaxh <git@lightrise.org>2021-11-10 11:05:34 +0100
commit3dc4d7f1558bb574eb99dade9a05727604e2e2ca (patch)
treea936dede1f2f41a27d7931ee7f668ef85deaa93b /main/src/ui/avatar_image.vala
parent26d10d1dcb95f11b65611473c9840e13683cb5ec (diff)
downloaddino-3dc4d7f1558bb574eb99dade9a05727604e2e2ca.tar.gz
dino-3dc4d7f1558bb574eb99dade9a05727604e2e2ca.zip
Add (disabled) multi-party call UI
Diffstat (limited to 'main/src/ui/avatar_image.vala')
-rw-r--r--main/src/ui/avatar_image.vala7
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();
}