receive message

This commit is contained in:
Peter Maquiran
2022-02-03 15:52:21 +01:00
parent e217962ae6
commit 47fd5e3895
3 changed files with 60 additions and 10 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ export class AuthService {
localStorage.setItem('userChat', JSON.stringify(responseChat));
this.storageService.store(AuthConnstants.AUTH, responseChat);
this.autologout(10000);
// this.autologout(10000);
return true;
+10 -9
View File
@@ -77,6 +77,11 @@ export class RoomService {
this.calDateDuration()
}
isSenderIsNotMe(ChatMessage) {
return SessionStore.user.RochetChatUser != ChatMessage.u.username
}
receiveMessage() {
this.WsChatService.updateRoomEventss(
@@ -84,7 +89,7 @@ export class RoomService {
"stream-room-messages",
(ChatMessage) => {
if(environment.chatOffline == false) {
if(environment.chatOffline == false || this.isSenderIsNotMe(ChatMessage)) {
ChatMessage = ChatMessage.fields.args[0]
ChatMessage = this.fix_updatedAt(ChatMessage)
console.log('recivemessage', ChatMessage)
@@ -99,14 +104,10 @@ export class RoomService {
this.scrollDown()
}, 100)
//this.sortService.sortDate(this.messages, '')
if(SessionStore.user.RochetChatUser != ChatMessage.u.username) {
this.NativeNotificationService.sendNotificationChat({
message: message.msg,
title: this.name
});
}
this.NativeNotificationService.sendNotificationChat({
message: message.msg,
title: this.name
});
this.addMessageDB(ChatMessage)