improve chat remove loop

This commit is contained in:
Peter Maquiran
2022-01-11 15:43:09 +01:00
parent a8a1307bec
commit dcee5aa2f4
9 changed files with 96 additions and 84 deletions
-22
View File
@@ -99,28 +99,6 @@ export class HomePage implements OnInit {
console.log('loadHistory', message)
})
this.RocketChatClientService.getRooms().then((rooms: any)=>{
console.log('rooms', rooms)
rooms.result.update.forEach((room:any) => {
console.log('room', room)
this.RocketChatClientService.subscribe(room.lastMessage.rid).then((subscription)=>{
console.log('subscription', subscription)
})
});
});
this.RocketChatClientService.receiveLiveMessageFromRoom(
'fsMwcNdufWvdnChj7ya9nF9cX2HizxxWAM',
this.constructor.name,
(Chatmessage)=>{
console.log('chat', Chatmessage)
}
)
window['jj'] = ()=>{
//send message // roomId // Message
this.RocketChatClientService.send('fsMwcNdufWvdnChj7ya9nF9cX2HizxxWAM', 'Mensagem enviada programaticamente.'+ new Date().toISOString())