mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
chat notification added
This commit is contained in:
@@ -27,6 +27,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ChatDebuggingPage } from 'src/app/shared/popover/chat-debugging/chat-debugging.page';
|
||||
import { EventTrigger } from 'src/app/services/eventTrigger.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -114,6 +115,7 @@ export class ChatPage implements OnInit {
|
||||
private storageservice: StorageService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private eventTriger: EventTrigger
|
||||
) {
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
@@ -127,6 +129,13 @@ export class ChatPage implements OnInit {
|
||||
|
||||
this.segment = 'Contactos'
|
||||
|
||||
this.eventTriger.getObservable().subscribe((event) => {
|
||||
if(event.notification == "recive") {
|
||||
this.onSegmentChange()
|
||||
}
|
||||
console.log(event)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user