Implement add contacts to group-chat

This commit is contained in:
tiago.kayaya
2021-01-22 15:28:52 +01:00
parent f3c15e603a
commit 1d4a292956
6 changed files with 77 additions and 16 deletions
@@ -45,6 +45,9 @@ export class GroupMessagesPage implements OnInit {
this.getGroupContacts();
this.loadGroupMessages()
}
close(){
this.modalController.dismiss();
}
getGroupContacts(){
//If group is private call getGroupMembers
if(this.room.t === 'p'){
@@ -67,7 +70,8 @@ export class GroupMessagesPage implements OnInit {
if(this.room.t === 'p'){
this.chatService.getPrivateGroupMessages(this.room._id).subscribe(res=>{
console.log(res);
this.messages = res['messages'].reverse();
let msgOnly = res['messages'].filter(data => data.t != 'au');
this.messages = msgOnly.reverse();
});
}
//Otherwise call getChannelMembers for públic groups
@@ -148,6 +152,7 @@ export class GroupMessagesPage implements OnInit {
return await popover.present();
}
async addContacts(){
this.close();
const modal = await this.modalController.create({
component: GroupContactsPage,
componentProps: {