chat notification added

This commit is contained in:
Eudes Inácio
2023-02-02 18:24:26 +01:00
parent cc9c5a9cf5
commit f7791805f3
11 changed files with 121 additions and 39 deletions
+14 -5
View File
@@ -382,15 +382,24 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
sendMessage(msg) {
let lastMsg = msg.pop();
console.log(msg)
console.log(lastMsg._id,lastMsg.msg,lastMsg.msg)
this.ChatSystemService.getDmRoom(this.roomId).send({}).then(() => {
console.log(this.members)
this.notificationService.ChatSendMessageNotification(this.members[1].username,this.members[1].name,lastMsg.msg,this.roomId)
})
}
/* sendMessage(msg) {
let lastMsg = msg.pop();
console.log(msg)
console.log(lastMsg._id,lastMsg.u.username,lastMsg.msg)
this.ChatSystemService.getDmRoom(this.roomId).send({}).then(() => {
if(lastMsg.u.username == this.members[1].username) {
this.notificationService.ChatSendMessageNotification(this.members[0].username,this.members[1].name,lastMsg.msg,this.roomId)
} else if (msg.u.username == this.members[0].username) {
this.notificationService.ChatSendMessageNotification(this.members[1].username,this.members[1].name,lastMsg.msg,this.roomId)
}
})
} */
base64toBlob(base64Data, contentType) {
contentType = contentType || '';
var sliceSize = 1024;