11import { batch } from "solid-js" ;
22
3+ import { ReactiveMap } from "@solid-primitives/map" ;
34import type { ReactiveSet } from "@solid-primitives/set" ;
45import type {
56 Channel as APIChannel ,
@@ -29,7 +30,6 @@ import type { Message } from "./Message.js";
2930import type { Server } from "./Server.js" ;
3031import type { ServerMember } from "./ServerMember.js" ;
3132import type { User } from "./User.js" ;
32- import { ReactiveMap } from "@solid-primitives/map" ;
3333import { VoiceParticipant } from "./VoiceParticipant.js" ;
3434
3535/**
@@ -317,8 +317,7 @@ export class Channel {
317317 * Get mentions in this channel for user.
318318 */
319319 get mentions ( ) : ReactiveSet < string > | undefined {
320- if ( this . type === "SavedMessages" )
321- return undefined ;
320+ if ( this . type === "SavedMessages" ) return undefined ;
322321
323322 return this . #collection. client . channelUnreads . get ( this . id )
324323 ?. messageMentionIds ;
@@ -330,7 +329,11 @@ export class Channel {
330329 * NB. subject to change as vc(2) goes to production
331330 */
332331 get isVoice ( ) : boolean {
333- return typeof this . #collection. getUnderlyingObject ( this . id ) . voice === 'object' ;
332+ return (
333+ this . type === "DirectMessage" ||
334+ this . type === "Group" ||
335+ typeof this . #collection. getUnderlyingObject ( this . id ) . voice === "object"
336+ ) ;
334337 }
335338
336339 /**
@@ -797,18 +800,26 @@ export class Channel {
797800
798801 /**
799802 * Join a call
800- * @param node Target node
803+ * @param node Target node
801804 * @param forceDisconnect Whether to disconnect existing call
802805 * @param recipients Ring targets
803806 * @returns LiveKit URL and Token
804807 */
805- async joinCall ( node ?: string , forceDisconnect = true , recipients ?: ( User | string ) [ ] ) {
808+ async joinCall (
809+ node ?: string ,
810+ forceDisconnect = true ,
811+ recipients ?: ( User | string ) [ ] ,
812+ ) {
806813 return await this . #collection. client . api . post (
807- `/channels/${ this . id as '' } /join_call` , {
808- node,
809- recipients : recipients ?. map ( entry => typeof entry === 'string' ? entry : entry . id ) ,
810- force_disconnect : forceDisconnect
811- } ) ;
814+ `/channels/${ this . id as "" } /join_call` ,
815+ {
816+ node,
817+ recipients : recipients ?. map ( ( entry ) =>
818+ typeof entry === "string" ? entry : entry . id ,
819+ ) ,
820+ force_disconnect : forceDisconnect ,
821+ } ,
822+ ) ;
812823 }
813824
814825 /**
0 commit comments