|
|
|
@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
import { ConversationModel } from '../../../js/models/conversations';
|
|
|
|
|
|
|
|
|
|
|
|
interface OpenGroupParams {
|
|
|
|
interface OpenGroupParams {
|
|
|
|
server: string;
|
|
|
|
server: string;
|
|
|
|
channel: number;
|
|
|
|
channel: number;
|
|
|
|
@ -144,7 +146,9 @@ export class OpenGroup {
|
|
|
|
* @param server The server URL
|
|
|
|
* @param server The server URL
|
|
|
|
* @returns BackBone conversation model corresponding to the server if it exists, otherwise `undefined`
|
|
|
|
* @returns BackBone conversation model corresponding to the server if it exists, otherwise `undefined`
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static async getConversation(server: string): Promise<any> {
|
|
|
|
public static async getConversation(
|
|
|
|
|
|
|
|
server: string
|
|
|
|
|
|
|
|
): Promise<ConversationModel | undefined> {
|
|
|
|
if (!OpenGroup.validate(server)) {
|
|
|
|
if (!OpenGroup.validate(server)) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -161,17 +165,6 @@ export class OpenGroup {
|
|
|
|
return serverInfo.channels[0].conversation;
|
|
|
|
return serverInfo.channels[0].conversation;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Get the conversation model of a server from conversation ID
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param conversationId The server's conversation ID
|
|
|
|
|
|
|
|
* @returns BackBone conversation model corresponding to the server if it exists, otherwise `undefined`
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public static getConversationByCID(conversationId: string): any {
|
|
|
|
|
|
|
|
const { ConversationController } = window;
|
|
|
|
|
|
|
|
return ConversationController.get(conversationId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Check if the server exists.
|
|
|
|
* Check if the server exists.
|
|
|
|
* This does not compare against your conversations with the server.
|
|
|
|
* This does not compare against your conversations with the server.
|
|
|
|
|