1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-12-27 22:18:52 +00:00

Add check for video calls

This commit is contained in:
Pierre HUBERT 2020-04-10 11:08:18 +02:00
parent 0a778811af
commit 76105957a0
2 changed files with 12 additions and 1 deletions

View File

@ -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)
};
}

View File

@ -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;
}
}