32 lines
939 B
JavaScript
32 lines
939 B
JavaScript
export const roomType = {
|
|
ROOM: 0,
|
|
CHANNEL: 1,
|
|
GROUP: 2,
|
|
DM: 3,
|
|
THREAD: 4,
|
|
};
|
|
|
|
export default class Room {
|
|
constructor(room, thread) {
|
|
this.id = room.id;
|
|
this.user = room.user;
|
|
this.userId = room.userId;
|
|
this.roomName = room.roomName;
|
|
this.mailboxId = room.mailboxId;
|
|
this.unseen = room.unseen;
|
|
// this.type = room.type;
|
|
|
|
this.messages = [];
|
|
this.messagesFetched = false;
|
|
|
|
if (!thread) {
|
|
this.threads = [
|
|
// new Room({id:12, user: this.user, roomName: "thread 1", mailbboxId:this.mailboxId}, true),
|
|
// new Room({id:12, user: this.user, roomName: "thread 1", mailbboxId:this.mailboxId}, true),
|
|
// new Room({id:12, user: this.user, roomName: "thread 1", mailbboxId:this.mailboxId}, true),
|
|
];
|
|
} else {
|
|
this.threads = [];
|
|
}
|
|
}
|
|
} |