mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix create chat
This commit is contained in:
@@ -42,32 +42,13 @@ export class ContactsPage implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
// this.chatService.refreshtoken();
|
// this.chatService.refreshtoken();
|
||||||
this.loadUsers();
|
// this.loadUsers();
|
||||||
|
|
||||||
}
|
}
|
||||||
onChange(event){
|
onChange(event){
|
||||||
this.textSearch = event.detail.value;
|
this.textSearch = event.detail.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadUsers(){
|
|
||||||
|
|
||||||
this.chatService.getAllUsers().subscribe((res:any) => {
|
|
||||||
|
|
||||||
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
|
|
||||||
this.users = this.contacts.sort((a,b) => {
|
|
||||||
if(a.name < b.name){
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if(a.name > b.name){
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
this.showLoader = false;
|
|
||||||
}, (error) =>{
|
|
||||||
// this.chatService.refreshtoken();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
separateLetter(record, recordIndex, records){
|
separateLetter(record, recordIndex, records){
|
||||||
if(recordIndex == 0){
|
if(recordIndex == 0){
|
||||||
@@ -92,14 +73,13 @@ export class ContactsPage implements OnInit {
|
|||||||
|
|
||||||
clicked() {}
|
clicked() {}
|
||||||
|
|
||||||
createRoom(username:string){
|
createRoom(username:string) {
|
||||||
let body = {
|
let body = {
|
||||||
username: username,
|
username: username,
|
||||||
}
|
}
|
||||||
this.chatService.createRoom(body).subscribe(async(res) => {
|
this.chatService.createRoom(body).subscribe(async(res) => {
|
||||||
|
|
||||||
this.room = res['room'];
|
this.room = res['room'];
|
||||||
|
|
||||||
await this.ChatSystemService.getAllRooms();
|
await this.ChatSystemService.getAllRooms();
|
||||||
this.getDirectMessage(this.room._id);
|
this.getDirectMessage(this.room._id);
|
||||||
});
|
});
|
||||||
@@ -107,15 +87,8 @@ export class ContactsPage implements OnInit {
|
|||||||
|
|
||||||
getDirectMessage(roomId:any) {
|
getDirectMessage(roomId:any) {
|
||||||
|
|
||||||
|
this.openModal(roomId);
|
||||||
|
|
||||||
this.chatService.getAllDirectMessages().subscribe(res=>{
|
|
||||||
let result = res['ims'].filter(data => data._id == roomId);
|
|
||||||
|
|
||||||
|
|
||||||
this.dm = result[0];
|
|
||||||
|
|
||||||
this.openModal(this.dm._id);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async openModal(roomId:any){
|
async openModal(roomId:any){
|
||||||
@@ -133,11 +106,4 @@ export class ContactsPage implements OnInit {
|
|||||||
modal.onDidDismiss();
|
modal.onDidDismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
async openMessages(username:string){
|
|
||||||
|
|
||||||
let dm:any;
|
|
||||||
this.createRoom(username);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -654,6 +654,8 @@ export class ChatSystemService {
|
|||||||
|
|
||||||
let users: chatUser[] = _res['users'].filter(data => data.username != SessionStore.user.UserName);
|
let users: chatUser[] = _res['users'].filter(data => data.username != SessionStore.user.UserName);
|
||||||
|
|
||||||
|
users = users.filter((data) => !(data.name == 'Rocket.Cat' || data.name == 'Administrator'))
|
||||||
|
|
||||||
const userIds = this.users.map((user) => user._id)
|
const userIds = this.users.map((user) => user._id)
|
||||||
|
|
||||||
for(let UserUpdate of users) {
|
for(let UserUpdate of users) {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
export let versionData = {
|
export let versionData = {
|
||||||
"shortSHA": "6f99c792d",
|
"shortSHA": "e1ac8583f",
|
||||||
"SHA": "6f99c792dcb13965ba29278b58b374766f4fa8a4",
|
"SHA": "e1ac8583f3a9a64ce0bc0162d4d2b8c70bc552a5",
|
||||||
"branch": "no_bug_movemente",
|
"branch": "no_bug_movemente",
|
||||||
"lastCommitAuthor": "'Peter Maquiran'",
|
"lastCommitAuthor": "'Peter Maquiran'",
|
||||||
"lastCommitTime": "'Wed Mar 22 15:31:01 2023 +0100'",
|
"lastCommitTime": "'Tue Mar 28 16:11:59 2023 +0100'",
|
||||||
"lastCommitMessage": "fix sayings",
|
"lastCommitMessage": "change reference",
|
||||||
"lastCommitNumber": "4884",
|
"lastCommitNumber": "4885",
|
||||||
"change": "",
|
"change": "",
|
||||||
"changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: config.xml\n\tmodified: src/app/pages/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/pages/chat/messages/messages.page.ts\n\tmodified: src/app/services/chat/message.service.ts\n\tmodified: src/app/shared/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/shared/chat/messages/messages.page.ts",
|
"changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/chat/messages/contacts/contacts.page.ts\n\tmodified: src/app/services/chat/chat-system.service.ts",
|
||||||
"changeAuthor": "peter.maquiran"
|
"changeAuthor": "peter.maquiran"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user