mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 05:19:22 +00:00
Add check for video calls
This commit is contained in:
parent
0a778811af
commit
76105957a0
@ -371,7 +371,8 @@ export class ConversationsController {
|
||||
following: c.following ? 1 : 0,
|
||||
saw_last_message: c.sawLastMessage ? 1 : 0,
|
||||
members: [...c.members],
|
||||
can_have_call: CallsHelper.CanHaveCall(c)
|
||||
can_have_call: CallsHelper.CanHaveCall(c),
|
||||
can_have_video_call: CallsHelper.CanHaveVideoCAll(c)
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -21,4 +21,14 @@ export class CallsHelper {
|
||||
&& conf().rtc_relay.maxUsersPerCalls >= conv.members.size) === true
|
||||
}
|
||||
|
||||
/**
|
||||
* Check out whether a given conversation is allowed to make video
|
||||
* calls or not
|
||||
*
|
||||
* @param conv Target conversation
|
||||
*/
|
||||
public static CanHaveVideoCAll(conv: Conversation) : boolean {
|
||||
return this.CanHaveCall(conv) && conf().rtc_relay.allowVideo;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user