mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-03 01:42:50 +08:00
Add server group icon badges and a 'no talk power' status icon
Group icons were entirely missing from the data model - GroupEntry only carried id/name. Added icon_id (from ServerGroup/ChannelGroup's Icon field) through connector -> gateway -> frontend, matching the same channel-0 icon_<id> file convention already used for server icons (#77), reusing that dialog's fetch/cache/render plumbing (serverIconImages, iconDataUrl). Client rows now render a small badge per server group with a non-zero icon, positioned after the name/status icons (i.e. on the right), instead of not existing at all. Also added a 🔒 status icon for clients who aren't muted but still can't talk due to insufficient talk power in a moderated channel (previously no icon indicated this state at all).
This commit is contained in:
1 parent
6e343c4d4c
commit
b7ef6f78e7
6 files changed
+76
-14
No files matched your search
@@ -368,6 +368,7 @@ struct PermissionCatalogEntry {
|
||||
struct GroupEntry {
|
||||
id: u64,
|
||||
name: String,
|
||||
icon_id: u32,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Clone)]
|
||||
@@ -1970,7 +1971,7 @@ async fn run(args: Args) -> Result<()> {
|
||||
let mut entries: Vec<GroupEntry> = state
|
||||
.channel_groups
|
||||
.values()
|
||||
.map(|g| GroupEntry { id: g.id.0, name: g.name.clone() })
|
||||
.map(|g| GroupEntry { id: g.id.0, name: g.name.clone(), icon_id: g.icon.0 })
|
||||
.collect();
|
||||
entries.sort_by_key(|g| g.id);
|
||||
emit(&Event::ChannelGroupList { entries });
|
||||
@@ -1980,7 +1981,7 @@ async fn run(args: Args) -> Result<()> {
|
||||
let mut entries: Vec<GroupEntry> = state
|
||||
.server_groups
|
||||
.values()
|
||||
.map(|g| GroupEntry { id: g.id.0, name: g.name.clone() })
|
||||
.map(|g| GroupEntry { id: g.id.0, name: g.name.clone(), icon_id: g.icon.0 })
|
||||
.collect();
|
||||
entries.sort_by_key(|g| g.id);
|
||||
emit(&Event::ServerGroupList { entries });
|
||||
@@ -2110,7 +2111,7 @@ async fn run(args: Args) -> Result<()> {
|
||||
if let InMessage::ChannelGroupList(list) = &msg {
|
||||
let entries: Vec<GroupEntry> = list
|
||||
.iter()
|
||||
.map(|part| GroupEntry { id: part.channel_group.0, name: part.name.clone() })
|
||||
.map(|part| GroupEntry { id: part.channel_group.0, name: part.name.clone(), icon_id: part.icon.0 })
|
||||
.collect();
|
||||
emit(&Event::ChannelGroupList { entries });
|
||||
pending_channel_group_list = false;
|
||||
@@ -2120,7 +2121,7 @@ async fn run(args: Args) -> Result<()> {
|
||||
if let InMessage::ServerGroupList(list) = &msg {
|
||||
let entries: Vec<GroupEntry> = list
|
||||
.iter()
|
||||
.map(|part| GroupEntry { id: part.server_group_id.0, name: part.name.clone() })
|
||||
.map(|part| GroupEntry { id: part.server_group_id.0, name: part.name.clone(), icon_id: part.icon.0 })
|
||||
.collect();
|
||||
emit(&Event::ServerGroupList { entries });
|
||||
pending_server_group_list = false;
|
||||
|
||||
Reference in new issue
Block a user