diff --git a/src/app/models/chatMethod.ts b/src/app/models/chatMethod.ts index 0cd7ea347..c813eb88d 100644 --- a/src/app/models/chatMethod.ts +++ b/src/app/models/chatMethod.ts @@ -80,6 +80,72 @@ export interface Message { urls: any[]; } + + + +export interface Lm { + $date: any; +} + + + + +export interface LastMessage { + _id: string; + rid: string; + msg: string; + ts: Ts; + u: U; + _updatedAt: UpdatedAt2; + mentions: any[]; + channels: any[]; + file: File; + attachments: Attachment[]; +} + +export interface CustomFields { +} + +export interface Update { + _id: string; + t: string; + usernames: string[]; + usersCount: number; + uids: string[]; + default: boolean; + ro: boolean; + sysMes: boolean; + _updatedAt: UpdatedAt; + lm: Lm; + lastMessage: LastMessage; + name: string; + fname: string; + u: U2; + customFields: CustomFields; +} + +export interface DeletedAt { + $date: any; +} + +export interface Remove { + _id: string; + _deletedAt: DeletedAt; +} + +export interface Result { + update: Update[]; + remove: Remove[]; +} + +export interface Rooms { + msg: string; + id: string; + result: Result; +} + + + export interface ChatMessage { msg: string; id: string; diff --git a/src/app/services/chat/ws-chat-methods.service.ts b/src/app/services/chat/ws-chat-methods.service.ts index 02ddbdb9a..70c5faf51 100644 --- a/src/app/services/chat/ws-chat-methods.service.ts +++ b/src/app/services/chat/ws-chat-methods.service.ts @@ -4,6 +4,7 @@ import { WsChatService } from 'src/app/services/chat/ws-chat.service'; import { MessageService } from 'src/app/services/chat/message.service' import { SessionStore } from 'src/app/store/session.service'; import { capitalizeTxt } from 'src/plugin/text' +import { Rooms, Update } from 'src/app/models/chatMethod'; @Injectable({ providedIn: 'root' @@ -35,10 +36,10 @@ export class WsChatMethodsService { this.loadingWholeList = true const rooms: any = await this.WsChatService.getRooms(); + + console.log("ROOMS" + JSON.stringify(rooms)) - console.log("ROOMS" + rooms) - - rooms.result.update.forEach((roomData:any) => { + rooms.result.update.forEach((roomData:Update) => { let room:RoomService; console.log(roomData); diff --git a/src/plugin/text.js b/src/plugin/text.js index c453d310b..4d25cc846 100644 --- a/src/plugin/text.js +++ b/src/plugin/text.js @@ -3,5 +3,5 @@ function capitalizeTxt(txt) { } module.exports = { - capitalizeTxt: capitalizeTxt + capitalizeTxt: capitalizeTxt } \ No newline at end of file