This commit is contained in:
Peter Maquiran
2022-02-02 20:18:45 +01:00
17 changed files with 101 additions and 53 deletions
@@ -156,11 +156,11 @@ export class WsChatMethodsService {
/**
* @description when a new room is create, needs to subtribe in order to receive updates
* @param id
* @param roomData
* @param id
* @param roomData
*/
subscribeToRoomUpdate(id, roomData) {
this.defaultSubtribe(id)
this.prepareRoom(roomData);
@@ -185,10 +185,10 @@ export class WsChatMethodsService {
})
}
/**
* @description create a representation of an room in these instance this.dm, this.group ...
* @param roomData
* @description create a representation of an room in these instance this.dm, this.group ...
* @param roomData
*/
prepareRoom(roomData) {
let room:RoomService;
@@ -237,12 +237,12 @@ export class WsChatMethodsService {
* @param id user ID
*/
private getUserStatus(id?:string) {
this.WsChatService.getUserStatus((d) => {
const username = d.fields.args[0][1]
const statusNum = d.fields.args[0][2]
const statusText = this.statusNumberToText(statusNum)
const user = this.getUserByName(username)
@@ -261,8 +261,8 @@ export class WsChatMethodsService {
/**
* @description convert rocketchat statues num to readable string
* @param text
* @returns
* @param text
* @returns
*/
statusNumberToText(text) {
if(text == '0') {
@@ -278,7 +278,7 @@ export class WsChatMethodsService {
return "busy"
}
}
deleteMessage(id?) {
return this.WsChatService.deleteMessage(id);
@@ -362,5 +362,9 @@ export class WsChatMethodsService {
this.users = user
}
getUserOfRoom(roomId){
return this.WsChatService.getUserOfRoom(roomId);
}
}