mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
merge
This commit is contained in:
@@ -1136,7 +1136,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
modal.present();
|
||||
} else {
|
||||
this.downloadFileFromBrowser("file", str)
|
||||
this.downloadFileFromBrowser(msg.attachments[0].name, str)
|
||||
this.downloadFileFromBrowser(msg.attachments[0].title, str)
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -1153,7 +1153,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
});
|
||||
modal.present();
|
||||
} else {
|
||||
this.openFile(str, msg.attachments[0].name, msg.file.type);
|
||||
this.openFile(str, msg.attachments[0].title, msg.file.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,32 +42,13 @@ export class ContactsPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
// this.chatService.refreshtoken();
|
||||
this.loadUsers();
|
||||
// this.loadUsers();
|
||||
|
||||
}
|
||||
onChange(event){
|
||||
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){
|
||||
if(recordIndex == 0){
|
||||
@@ -92,14 +73,13 @@ export class ContactsPage implements OnInit {
|
||||
|
||||
clicked() {}
|
||||
|
||||
createRoom(username:string){
|
||||
createRoom(username:string) {
|
||||
let body = {
|
||||
username: username,
|
||||
}
|
||||
this.chatService.createRoom(body).subscribe(async(res) => {
|
||||
|
||||
this.room = res['room'];
|
||||
|
||||
await this.ChatSystemService.getAllRooms();
|
||||
this.getDirectMessage(this.room._id);
|
||||
});
|
||||
@@ -107,15 +87,8 @@ export class ContactsPage implements OnInit {
|
||||
|
||||
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){
|
||||
@@ -133,11 +106,4 @@ export class ContactsPage implements OnInit {
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
async openMessages(username:string){
|
||||
|
||||
let dm:any;
|
||||
this.createRoom(username);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1067,9 +1067,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
} else {
|
||||
|
||||
this.downloadFileFromBrowser("file", str)
|
||||
this.downloadFileFromBrowser(msg.attachments[0].name, str)
|
||||
this.downloadFileFromBrowser(msg.attachments[0].title, str)
|
||||
|
||||
this.downloadFileFromBrowser(msg.attachments[0].name, str)
|
||||
this.downloadFileFromBrowser(msg.attachments[0].title, str)
|
||||
|
||||
}
|
||||
|
||||
@@ -1087,7 +1087,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
});
|
||||
modal.present();
|
||||
} else {
|
||||
this.openFile(str, msg.attachments[0].name, msg.file.type);
|
||||
this.openFile(str, msg.attachments[0].title, msg.file.type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -654,6 +654,8 @@ export class ChatSystemService {
|
||||
|
||||
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)
|
||||
|
||||
for(let UserUpdate of users) {
|
||||
|
||||
@@ -290,7 +290,7 @@ export class MessageService {
|
||||
clearTimeout(this.functionTimer);
|
||||
|
||||
this.redefinedMessage(ChatMessage)
|
||||
console.log()
|
||||
// console.log()
|
||||
}
|
||||
).catch((error) => {
|
||||
clearTimeout(this.functionTimer);
|
||||
|
||||
@@ -1112,7 +1112,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
this.downloadFileFromBrowser("file", str)
|
||||
}
|
||||
} else {
|
||||
this.openFile(str, msg.attachments[0].name, msg.file.type);
|
||||
this.openFile(str, msg.attachments[0].title, msg.file.type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1057,11 +1057,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.downloadFileMsg(msg)
|
||||
|
||||
} else {
|
||||
var str = msg.attachments[0].image_url;
|
||||
|
||||
var str = msg.attachments[0].image_url
|
||||
str = str.substring(1, ((str.length) - 1));
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
|
||||
console.log('hello')
|
||||
|
||||
console.log(msg)
|
||||
if (msg.file.type == "application/img") {
|
||||
const modal = await this.modalController.create({
|
||||
@@ -1081,11 +1084,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
|
||||
} else {
|
||||
this.openFile(str, msg.attachments[0].name, msg.file.type);
|
||||
this.openFile(str, msg.attachments[0].title, msg.file.type);
|
||||
// this.downloadFileFromBrowser("file", str)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user