integrate FileModel with ChatModel
This commit is contained in:
@@ -7,6 +7,7 @@ import { decryptString, encryptString } from "./Utility/crypto";
|
||||
import ChatListModel from "./chatListModel";
|
||||
import { Color } from "../ViewModel/colors";
|
||||
import ConnectionModel from "./connectionModel";
|
||||
import FileModel from "./fileModel";
|
||||
import SettingsModel from "./settingsModel";
|
||||
import { checkIsValidObject } from "./Utility/typeSafety";
|
||||
import { v4 } from "uuid";
|
||||
@@ -17,6 +18,8 @@ export default class ChatModel {
|
||||
settingsModel: SettingsModel;
|
||||
chatListModel: ChatListModel;
|
||||
|
||||
fileModel: FileModel;
|
||||
|
||||
// data
|
||||
id: string;
|
||||
info: ChatInfo;
|
||||
@@ -210,6 +213,8 @@ export default class ChatModel {
|
||||
this.subscribe();
|
||||
|
||||
connectionModel.setMessageSentHandler(this.handleMessageSent);
|
||||
|
||||
this.fileModel = new FileModel(this);
|
||||
}
|
||||
|
||||
// utility
|
||||
@@ -280,4 +285,4 @@ export interface ChatMessage {
|
||||
status?: ChatMessageStatus;
|
||||
|
||||
stringifiedFile?: string;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user