nitro/apps/frontend/src/api/friends/MessengerThreadChatGroup.ts

35 lines
749 B
TypeScript
Raw Normal View History

2023-03-17 00:22:55 +01:00
import {MessengerGroupType} from "./MessengerGroupType";
import {MessengerThreadChat} from "./MessengerThreadChat";
2023-03-16 23:54:48 +01:00
2023-03-17 00:22:55 +01:00
export class MessengerThreadChatGroup {
private _userId: number;
private _chats: MessengerThreadChat[];
private _type: number;
2023-03-16 23:54:48 +01:00
2023-03-17 00:22:55 +01:00
constructor(userId: number, type = MessengerGroupType.PRIVATE_CHAT) {
this._userId = userId;
this._chats = [];
this._type = type;
}
2023-03-16 23:54:48 +01:00
2023-03-17 00:22:55 +01:00
public addChat(message: MessengerThreadChat): void {
this._chats.push(message);
}
2023-03-16 23:54:48 +01:00
2023-03-17 00:22:55 +01:00
public get userId(): number {
return this._userId;
}
2023-03-16 23:54:48 +01:00
2023-03-17 00:22:55 +01:00
public get chats(): MessengerThreadChat[] {
return this._chats;
}
2023-03-16 23:54:48 +01:00
2023-03-17 00:22:55 +01:00
public get type(): number {
return this._type;
}
2023-03-16 23:54:48 +01:00
2023-03-17 00:22:55 +01:00
public set type(type: number) {
this._type = type;
}
2023-03-16 23:54:48 +01:00
}