diff --git a/connector/src/main.rs b/connector/src/main.rs index cff7e8a..032bf9b 100644 --- a/connector/src/main.rs +++ b/connector/src/main.rs @@ -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 = 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 = 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 = 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 = 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; diff --git a/gateway/src/ts3/connection.ts b/gateway/src/ts3/connection.ts index 55ed278..e59349a 100644 --- a/gateway/src/ts3/connection.ts +++ b/gateway/src/ts3/connection.ts @@ -42,6 +42,7 @@ export interface ClientInfo { export interface GroupEntry { id: number; name: string; + iconId: number; } export interface PermissionOverviewEntry { @@ -338,8 +339,8 @@ export class Ts3Connection { message: string; timestamp: string; } - | { type: "channelGroupList"; entries: { id: number; name: string }[] } - | { type: "serverGroupList"; entries: { id: number; name: string }[] } + | { type: "channelGroupList"; entries: GroupEntry[] } + | { type: "serverGroupList"; entries: GroupEntry[] } | { type: "permissionOverview"; entries: { name: string; description: string; value: number; negated: boolean; skip: boolean }[]; diff --git a/web/src/App.css b/web/src/App.css index d436766..6ce6af0 100644 --- a/web/src/App.css +++ b/web/src/App.css @@ -550,6 +550,13 @@ opacity: 0.85; } +.ts-group-icon { + width: 14px; + height: 14px; + object-fit: contain; + flex-shrink: 0; +} + .ts-poke-button { margin-left: auto; background: transparent; diff --git a/web/src/App.tsx b/web/src/App.tsx index 7199378..9219013 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -336,6 +336,7 @@ interface ClientInfo { interface GroupEntry { id: number; name: string; + iconId: number; } interface PermissionOverviewEntry { @@ -463,6 +464,9 @@ function ClientStatusIcons({ client }: { client: ClientInfo }) { {client.isChannelCommander && ⭐} {client.away && 💤} {(client.inputMuted || !client.inputHardwareEnabled) && 🔇} + {!client.inputMuted && client.inputHardwareEnabled && !client.hasTalkPower && ( + 🔒 + )} {client.outputMuted && 🔕} ); @@ -485,6 +489,8 @@ function ChannelTree({ parent, ownClientId, talkers, + serverGroups, + groupIconImages, selected, onSelectItem, onSwitchChannel, @@ -498,6 +504,8 @@ function ChannelTree({ parent: number; ownClientId: number | null; talkers: Set; + serverGroups: GroupEntry[] | null; + groupIconImages: Record; selected: SelectedItem | null; onSelectItem: (item: SelectedItem) => void; onSwitchChannel: (channelId: number) => void; @@ -510,6 +518,13 @@ function ChannelTree({ const children = channels.filter((c) => c.parent === parent).sort((a, b) => a.order - b.order); if (children.length === 0) return null; + const groupIconIds = (client: ClientInfo): number[] => + serverGroups + ? client.serverGroups + .map((gid) => serverGroups.find((g) => g.id === gid)?.iconId ?? 0) + .filter((iconId) => iconId !== 0) + : []; + return (
    {children.map((channel) => ( @@ -547,6 +562,12 @@ function ChannelTree({ ({c.awayMessage}) )} + {groupIconIds(c).map((iconId) => { + const base64 = groupIconImages[`/icon_${iconId}`]; + return base64 ? ( + + ) : null; + })} {c.id !== ownClientId && (