1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-23 18:11:40 +00:00

Check if a conversation can be the source for a call

This commit is contained in:
2020-04-10 11:05:30 +02:00
parent d1235f4f8c
commit 0a778811af
5 changed files with 41 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import { UserHelper } from "../helpers/UserHelper";
import { removeHTMLNodes } from "../utils/StringUtils";
import { ConversationMessage } from "../entities/ConversationMessage";
import { UnreadConversation } from "../entities/UnreadConversation";
import { CallsHelper } from "../helpers/CallsHelper";
/**
* Conversations controller
@ -369,7 +370,8 @@ export class ConversationsController {
name: c.name.length > 0 ? c.name : false,
following: c.following ? 1 : 0,
saw_last_message: c.sawLastMessage ? 1 : 0,
members: [...c.members]
members: [...c.members],
can_have_call: CallsHelper.CanHaveCall(c)
};
}

View File

@ -73,6 +73,13 @@ export class RTCRelayController {
})
}
/**
* Check out wheter a relay is currently connected to the API
*/
public static get IsConnected() : boolean {
return this.currWs && this.currWs.readyState == ws.OPEN;
}
/**
* Method called when a websocket connection is closed
*/