mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-08-26 15:08:03 -04:00
chore: simple voice support
This commit is contained in:
@@ -321,6 +321,15 @@ export class Channel {
|
||||
?.messageMentionIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this is a 'voice chats v2' channel
|
||||
*
|
||||
* NB. subject to change as vc(2) goes to production
|
||||
*/
|
||||
get isVoice(): boolean {
|
||||
return this.#collection.getUnderlyingObject(this.id).voice;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL to the channel icon
|
||||
*/
|
||||
|
||||
@@ -29,6 +29,8 @@ export type HydratedChannel = {
|
||||
nsfw: boolean;
|
||||
|
||||
lastMessageId?: string;
|
||||
|
||||
voice: boolean;
|
||||
};
|
||||
|
||||
export const channelHydration: Hydrate<Merge<APIChannel>, HydratedChannel> = {
|
||||
@@ -60,6 +62,10 @@ export const channelHydration: Hydrate<Merge<APIChannel>, HydratedChannel> = {
|
||||
rolePermissions: (channel) => channel.role_permissions,
|
||||
nsfw: (channel) => channel.nsfw || false,
|
||||
lastMessageId: (channel) => channel.last_message_id!,
|
||||
voice: (channel) => {
|
||||
console.info(channel);
|
||||
return typeof (channel as never as { voice: object }).voice === "object";
|
||||
},
|
||||
},
|
||||
initialHydration: () => ({
|
||||
typingIds: new ReactiveSet(),
|
||||
|
||||
Reference in New Issue
Block a user