diff --git a/src/app/pages/chat/group-messages/group-messages.page.html b/src/app/pages/chat/group-messages/group-messages.page.html index 1ae503504..4dbdffff9 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.html +++ b/src/app/pages/chat/group-messages/group-messages.page.html @@ -57,7 +57,7 @@ A conversa original mantêm-se como chat individual
-
+
{{msg.u.name ?? ""}} {{msg.duration}} @@ -78,7 +78,7 @@
-
-
+
{{msg.u.name ?? ""}} {{msg.duration}} diff --git a/src/app/pages/chat/group-messages/group-messages.page.ts b/src/app/pages/chat/group-messages/group-messages.page.ts index ea39e98c5..0adb06bfe 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.ts +++ b/src/app/pages/chat/group-messages/group-messages.page.ts @@ -90,7 +90,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { duration = 0; showAvatar = true; audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null - essionStore = SessionStore + sessionStore = SessionStore constructor( private menu: MenuController, private modalController: ModalController, diff --git a/src/app/pages/chat/messages/messages.page.html b/src/app/pages/chat/messages/messages.page.html index 6043f9066..5455fd501 100644 --- a/src/app/pages/chat/messages/messages.page.html +++ b/src/app/pages/chat/messages/messages.page.html @@ -50,7 +50,7 @@
-
{{msg.u.name}} diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 71ff2a69e..a2580e335 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -110,9 +110,6 @@ export class LoginPage implements OnInit { await this.authService.SetSession(attempt, this.userattempt); - console.log(this.p.userPermission(this.p.permissionList.Chat.access)); - - /* if(this.p.userPermission(this.p.permissionList.Chat.access)){*/ await this.authService.loginChat(attempt.ChatData.data); await this.authService.loginToChatWs(); diff --git a/src/app/services/chat/message.service.ts b/src/app/services/chat/message.service.ts index 74e846ae0..5b99ee3e0 100644 --- a/src/app/services/chat/message.service.ts +++ b/src/app/services/chat/message.service.ts @@ -75,7 +75,7 @@ export class MessageService { this.msg = msg || "" this.rid = rid this.ts = ts - this.u = u || { name: this.usernameToDisplayName(SessionStore.user.RochetChatUser), username: SessionStore.user.RochetChatUser, _id: ""} + this.u = u || { name: this.usernameToDisplayName(SessionStore.user.UserName), username: SessionStore.user.UserName, _id: ""} this.t = t this._id = _id this._updatedAt = _updatedAt || new Date().getTime() @@ -287,18 +287,18 @@ console.log(params) isSenderIsNotMe(ChatMessage) { - return SessionStore.user.RochetChatUser != ChatMessage.u.username + return SessionStore.user.UserName != ChatMessage.u.username } messageOwnerById(id) { - return SessionStore.user.RochetChatUser != this.u.username + return SessionStore.user.UserName != this.u.username } private getChatObj() { return { channels: this.channels, mentions: this.mentions, - //msg: this.AESEncrypt.encrypt(this.msg, SessionStore.user.RochetChatUser), + //msg: this.AESEncrypt.encrypt(this.msg, SessionStore.user.UserName), msg:this.msg, rid: this.rid, ts: this.ts, @@ -339,7 +339,7 @@ console.log(params) decryptMessage() { try { - // this.msg = this.AESEncrypt.decrypt(this.msg, SessionStore.user.RochetChatUser) + // this.msg = this.AESEncrypt.decrypt(this.msg, SessionStore.user.UserName) } catch (error) {} } diff --git a/src/app/services/chat/room.service.ts b/src/app/services/chat/room.service.ts index 2e2f88363..31fa9b1ee 100644 --- a/src/app/services/chat/room.service.ts +++ b/src/app/services/chat/room.service.ts @@ -161,7 +161,7 @@ export class RoomService { isSenderIsNotMe(ChatMessage) { - return SessionStore.user.RochetChatUser != ChatMessage.u.username + return SessionStore.user.UserName != ChatMessage.u.username } senderId(ChatMessage) { @@ -371,7 +371,7 @@ export class RoomService { if(this.messages[i]?._id == id ) { - if (SessionStore.user.RochetChatUser == this.messages[i]?.u?.username) { + if (SessionStore.user.UserName == this.messages[i]?.u?.username) { const allMemberThatIsOffline = this.getAllMemberThatIsOffline() DeleteMessageModel.create({ @@ -500,7 +500,7 @@ export class RoomService { } if(lastIsTyping != this.isTyping) { - this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.RochetChatUser, 'typing', this.isTyping) + this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping) } @@ -509,7 +509,7 @@ export class RoomService { } sendFalseTypingReadMessage(method,param: object) { - this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.RochetChatUser, 'typing', {method:method, params: param} as falseTypingMethod) + this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', {method:method, params: param} as falseTypingMethod) this.setTypingOff() } @@ -521,7 +521,7 @@ export class RoomService { if(this.isTyping == true) { this.isTyping = false - this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.RochetChatUser, 'typing', this.isTyping) + this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping) } } else { diff --git a/src/app/services/chat/ws-chat-methods.service.ts b/src/app/services/chat/ws-chat-methods.service.ts index 369085175..3b3fd50d5 100644 --- a/src/app/services/chat/ws-chat-methods.service.ts +++ b/src/app/services/chat/ws-chat-methods.service.ts @@ -184,7 +184,7 @@ export class WsChatMethodsService { const res = await this.chatService.getMembers(roomId).toPromise(); const members = res['members']; - const users = members.filter(data => data.username != this.sessionStore.user.RochetChatUser); + const users = members.filter(data => data.username != this.sessionStore.user.UserName); rooms.result.update[index]['members'] = users await this.prepareRoom(roomData); @@ -192,7 +192,7 @@ export class WsChatMethodsService { if (roomData.t === 'p') { const res = await this.chatService.getGroupMembers(roomId).toPromise() const members = res['members']; - const users = members.filter(data => data.username != this.sessionStore.user.RochetChatUser); + const users = members.filter(data => data.username != this.sessionStore.user.UserName); rooms.result.update[index]['members'] = users @@ -200,7 +200,7 @@ export class WsChatMethodsService { else { const res = await this.chatService.getChannelMembers(roomId).toPromise() const members = res['members']; - const users = members.filter(data => data.username != this.sessionStore.user.RochetChatUser); + const users = members.filter(data => data.username != this.sessionStore.user.UserName); rooms.result.update[index]['members'] = users @@ -366,7 +366,7 @@ export class WsChatMethodsService { getReceptorName(roomData) { try { - return roomData.usernames.find((e)=> e != SessionStore.user.RochetChatUser) + return roomData.usernames.find((e)=> e != SessionStore.user.UserName) } catch(e) { return '*' } @@ -476,7 +476,7 @@ export class WsChatMethodsService { if(this.isIndividual(roomData)) { const names: String[] = roomData.usernames const roomName = names.filter((name, index)=>{ - return name != SessionStore.user.RochetChatUser + return name != SessionStore.user.UserName })[0] const firstName = capitalizeTxt(roomName.split('.')[0]) @@ -507,7 +507,7 @@ export class WsChatMethodsService { let _res = await this.ChatService.getAllUsers().toPromise() - let users = _res['users'].filter(data => data.username != SessionStore.user.RochetChatUser); + let users = _res['users'].filter(data => data.username != SessionStore.user.UserName); users = users.sort((a,b) => { if(a.name < b.name) { diff --git a/src/app/shared/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html index c707ecbd8..4f88af07d 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -42,7 +42,7 @@
-
+
diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index cd7b7a49e..d02ea6ee5 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -36,7 +36,7 @@
-
+