diff --git a/src/controllers/ConversationsController.ts b/src/controllers/ConversationsController.ts index 7ba8e57..6bb73ee 100644 --- a/src/controllers/ConversationsController.ts +++ b/src/controllers/ConversationsController.ts @@ -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) }; } diff --git a/src/helpers/CallsHelper.ts b/src/helpers/CallsHelper.ts index 2af369b..98b7eb8 100644 --- a/src/helpers/CallsHelper.ts +++ b/src/helpers/CallsHelper.ts @@ -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; + } + } \ No newline at end of file