Remove relevant console log,

This commit is contained in:
Eudes Inácio
2022-04-28 09:32:27 +01:00
parent 3021e8b0e1
commit 2826cea9df
153 changed files with 1001 additions and 1132 deletions
+39 -39
View File
@@ -137,7 +137,7 @@ export class ChatPage implements OnInit {
this.authService.userData$.subscribe((res: any) => {
this.loggedUser = res;
console.log(this.loggedUser);
});
this.hideRefreshButton();
@@ -168,7 +168,7 @@ export class ChatPage implements OnInit {
ngOnDestroy() {
this.setStatus('offline');
this.dataService.set("newGroup", false);
console.log('On Destroy')
}
setStatus(status: string) {
@@ -177,7 +177,7 @@ export class ChatPage implements OnInit {
status: status,
}
this.chatService.setUserStatus(body).subscribe(res => {
console.log(res);
})
}
@@ -210,7 +210,7 @@ export class ChatPage implements OnInit {
this.showGroupContacts = false;
this.showNewEvent = false;
this.showAttendees = false;
console.log('All components closed!');
}
showEmptyContainer() {
@@ -241,7 +241,7 @@ export class ChatPage implements OnInit {
}
}
openContactsPage() {
console.log('OK');
this.idSelected = '';
this.closeAllDesktopComponents();
@@ -249,7 +249,7 @@ export class ChatPage implements OnInit {
this.selectContact();
}
else {
console.log('here');
this.showContacts = true;
}
}
@@ -283,7 +283,7 @@ export class ChatPage implements OnInit {
this.closeAllDesktopComponents();
this.showEmptyComponent = false;
this.roomId = rid;
console.log(this.roomId);
this.showGroupMessages = true;
}
}
@@ -299,7 +299,7 @@ export class ChatPage implements OnInit {
this.groupRoomId = data.roomId;
this.closeAllDesktopComponents();
if (window.innerWidth < 701) {
console.log('Mobile');
}
else {
this.showNewEvent = true;
@@ -355,7 +355,7 @@ export class ChatPage implements OnInit {
let params = new HttpParams();
params = params.set("types", "c");
this.chatService.customsRooms(params).subscribe(res => {
//console.log(res);
//
});
}
@@ -369,9 +369,9 @@ export class ChatPage implements OnInit {
var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA;
});
//console.log('DIRECTMESSAGE FROM DB', this.userDirectMessages);
//
//console.log('ROOMS FROM DB', rooms)
//
})
this.storageservice.get('chatusers').then((users) => {
@@ -379,7 +379,7 @@ export class ChatPage implements OnInit {
})
} else {
this.sqlservice.getAllChatRoom().then((rooms: any) => {
//console.log('ROOMS FROM DB', rooms)
//
let roomsArray = [];
rooms.forEach(element => {
let roomListDB = {
@@ -399,16 +399,16 @@ export class ChatPage implements OnInit {
var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA;
});
//console.log('DIRECTMESSAGE FROM DB', this.userDirectMessages);
//
//console.log('ROOMS FROM DB', rooms)
//
})
this.sqlservice.getAllChatUsers().then((userslist: any) => {
//console.log('USERS FOM DB 1', userslist)
//
let chatusersArray = [];
userslist.forEach(element => {
console.log('USERS FOM DB 2', element)
let userListDB = {
_id: element.Id,
name: element.Name,
@@ -436,7 +436,7 @@ export class ChatPage implements OnInit {
_updatedAt: element._updatedAt
}
//console.log(' Web TRANSFORM ROOM LIST', roomList)
//
roomsArray.push(roomList)
});
@@ -453,7 +453,7 @@ export class ChatPage implements OnInit {
updatedat: element._updatedAt
}
//console.log('TRANSFORM ROOM LIST', roomList)
//
this.sqlservice.addChatListRoom(roomList);
});
}
@@ -463,26 +463,26 @@ export class ChatPage implements OnInit {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
let usersArray = [];
users.forEach(element => {
//console.log('TRANSFORM USER CHAT 1', element)
//
let chatusers = {
_id: element._id,
name: element.name,
username: element.username
}
//console.log('TRANSFORM USER CHAT 2', chatusers)
//
usersArray.push(chatusers);
});
await this.storageservice.remove('chatusers');
await this.storageservice.store('chatusers',usersArray);
} else {
users.forEach(element => {
//console.log('TRANSFORM USER CHAT 1', element)
//
let chatusers = {
id: element._id,
name: element.name,
username: element.username
}
//console.log('TRANSFORM USER CHAT 2', chatusers)
//
this.sqlservice.addChatListUsers(chatusers);
});
}
@@ -499,12 +499,12 @@ export class ChatPage implements OnInit {
async getChatMembers() {
//return await this.chatService.getMembers(roomId).toPromise();
this.chatService.getAllUsers().subscribe(res => {
//console.log('chatusers', res);
//
this.transformDataUserList(res['users'])
/* if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.dmUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username);
//console.log(this.dmUsers);
//
}*/
});
@@ -520,7 +520,7 @@ export class ChatPage implements OnInit {
return dateB - dateA;
});
console.log('GROUPS FROM DB', k)
this.allGroups = rooms.sort((a, b) => {
@@ -530,7 +530,7 @@ export class ChatPage implements OnInit {
});
//console.log('GROUPS FROM DB', this.allGroups)
//
})
this.storageservice.get('chatusers').then((users) => {
@@ -559,15 +559,15 @@ export class ChatPage implements OnInit {
var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA;
});
//console.log('Group FROM DB', this.allGroups);
//
})
/* this.sqlservice.getAllChatUsers().then((userslist: any) => {
console.log('USERS FOM DB 1', userslist)
let chatusersArray = [];
userslist.forEach(element => {
console.log('USERS FOM DB 2', element)
let userListDB = {
_id: element.Id,
name: element.Name,
@@ -598,7 +598,7 @@ export class ChatPage implements OnInit {
_updatedAt: element._updatedAt
}
console.log(' Web TRANSFORM ROOM LIST', roomList)
groupsArray.push(roomList)
});
@@ -617,7 +617,7 @@ export class ChatPage implements OnInit {
updatedat: element._updatedAt
}
console.log('TRANSFORM ROOM LIST', roomList)
this.sqlservice.addChatListRoom(roomList);
});
}
@@ -626,7 +626,7 @@ export class ChatPage implements OnInit {
async getGroups(event?) {
this.result = this.chatService.getAllPrivateGroups().subscribe(async (res: any) => {
//console.log(res);
//
this.showLoader = false;
if (res.groups != 200) {
@@ -634,7 +634,7 @@ export class ChatPage implements OnInit {
this.getGroupsDB();
this.privateGroups = res.groups;
console.log('Chat list group' , res);
/* this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
this.publicGroups = res.channels; */
//let all = this.privateGroups.concat(this.publicGroups);
@@ -643,10 +643,10 @@ export class ChatPage implements OnInit {
var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA;
}); */
//console.log(this.allGroups);
//
/* }); */
if (this.route.url != "/home/chat") {
//console.log("Timer message stop")
//
}
else {
//Check if modal is opened
@@ -699,7 +699,7 @@ export class ChatPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res.data);
this.modalController.dismiss(res.data);
});
}
@@ -707,7 +707,7 @@ export class ChatPage implements OnInit {
async openMessagesModal(roomId: any) {
this.closeAllDesktopComponents();
//console.log(roomId);
//
const modal = await this.modalController.create({
component: MessagesPage,
@@ -722,7 +722,7 @@ export class ChatPage implements OnInit {
async openGroupMessagesModal(roomId: any) {
console.log(roomId);
const modal = await this.modalController.create({
component: GroupMessagesPage,
@@ -737,7 +737,7 @@ export class ChatPage implements OnInit {
// this.crop.crop('path/to/image.jpg', {quality: 75})
// .then(
// newImage => console.log('new image path is: ' + newImage),
// newImage =>
// error => console.error('Error cropping image', error)
// );
@@ -34,7 +34,7 @@ export class EditGroupPage implements OnInit {
getRoomInfo(){
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
this.room = room['room'];
console.log(this.room);
this.groupName = this.room.name.split('-').join(' ');
});
}
@@ -55,7 +55,7 @@ export class EditGroupPage implements OnInit {
});
}
else{
console.log("Invalid name!");
}
}
_ionChange(event){
@@ -72,13 +72,13 @@ export class EditGroupPage implements OnInit {
text: 'Ok',
cssClass: 'btn-cancel',
handler:(value:any)=>{
console.log('button done pressed');
this.selectedDuration = [
value.days.value,
value.hours.value,
value.minutes.value,
]
console.log(this.selectedDuration);
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
if(value.days.value > 0){
if(value.days.value == 1){
@@ -58,8 +58,8 @@ export class GroupContactsPage implements OnInit {
ngOnInit() {
this.loadUsers();
this.getMembers();
console.log(this.groupName);
console.log(this.isGroupCreated);
}
loadUsers(){
@@ -82,7 +82,7 @@ export class GroupContactsPage implements OnInit {
}
return 0;
});
console.log(this.users);
this.showLoader = false;
});
@@ -124,16 +124,16 @@ export class GroupContactsPage implements OnInit {
"roomId": this.room._id,
"userId": data._id,
}
console.log(body);
if(this.room.t == "p"){
this.chatService.removeGroupMember(body).subscribe(res=>{
console.log(res);
this.getMembers();
});
}
else if(this.room.t == "c"){
this.chatService.removeChannelMember(body).subscribe(res=>{
console.log(res);
this.getMembers();
});
}
@@ -154,7 +154,7 @@ export class GroupContactsPage implements OnInit {
this.textSearch = event.detail.value;
}
clicked(){
console.log('clicked');
}
selectedContact(user:any){
@@ -164,11 +164,11 @@ export class GroupContactsPage implements OnInit {
}
addContacts(room:any){
console.log(room);
this.selectedUserList = this.users.filter(function(contact) {
return contact.isChecked == true;
});
console.log( this.selectedUserList);
this.selectedUserList.forEach(user=>{
let body ={
"roomId":room._id,
@@ -176,7 +176,7 @@ export class GroupContactsPage implements OnInit {
}
this.chatService.addUserToGroup(body).subscribe(res=>{
console.log(res['success']);
});
});
}
@@ -191,7 +191,7 @@ export class GroupContactsPage implements OnInit {
async openGroupMessages(roomId:any){
this.close();
console.log(roomId);
const modal = await this.modalController.create({
component: GroupMessagesPage,
componentProps: {
@@ -132,7 +132,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
ngOnInit() {
console.log(this.roomId);
this.loggedUser = this.loggedUserChat;
this.getRoomInfo();
this.scrollToBottom();
@@ -142,7 +142,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.getRoomMessageDB(this.roomId);
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
console.log('MEMBER', value)
})
VoiceRecorder.requestAudioRecordingPermission();
//this.loadFiles();
@@ -154,7 +154,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
status: status,
}
// this.chatService.setUserStatus(body).subscribe(res => {
// console.log(res);
//
// })
}
@@ -221,19 +221,19 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
path: fileName,
directory: Directory.Data
})
//console.log(audioFile);
//
const base64sound = audioFile.data;
//Converting base64 to blob
const base64 = await fetch(base64sound);
//console.log(base64);
//
const base64Response = await fetch(`data:audio/ogg;base64,${base64sound}`);
//console.log(base64Response);
//
this.audioRecorded = base64Response.url;
console.log(this.audioRecorded);
}
@@ -261,13 +261,13 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
stopRecording() {
this.deleteRecording();
this.allowTyping = false;
console.log('Stop');
if (!this.recording) {
return;
}
this.recording = false;
VoiceRecorder.stopRecording().then(async (result: RecordingData) => {
console.log('==================================', result);
this.recording = false;
if (result.value && result.value.recordDataBase64) {
@@ -277,7 +277,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Save file
await this.storage.set('fileName', fileName)
this.storage.set('recordData', result).then(() => {
console.log('Audio recorded saved', result);
setTimeout(async () => {
this.loadFiles();
@@ -337,7 +337,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res);
});
}
@@ -375,10 +375,10 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
async getChatMembers() {
this.chatService.getAllUsers().subscribe(res => {
console.log(res);
this.allUsers = res['users'].filter(data => data.username != SessionStore.user.UserName);
console.log(this.allUsers);
});
}
@@ -402,7 +402,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//If group is private call getGroupMembers
if (this.room.t === 'p') {
this.chatService.getGroupMembers(this.roomId).subscribe(res => {
console.log(res);
this.members = res['members'];
this.showLoader = false;
});
@@ -410,7 +410,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Otherwise call getChannelMembers for públic groups
else {
this.chatService.getChannelMembers(this.roomId).subscribe(res => {
console.log(res);
this.members = res['members'];
this.showLoader = false;
});
@@ -475,7 +475,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Converting base64 to blob
const encodedData = btoa(this.audioRecorded);
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
console.log(blob)
const formData = new FormData();
formData.append("blobFile", blob);
@@ -510,11 +510,11 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
await modal.present();
modal.onDidDismiss().then(res => {
if (res.data == 'leave') {
console.log('saiu do grupo');
//this.wsChatMethodsService.subscribeToRoomUpdate(this.roomId, this.room);
}
else if (res.data == 'cancel') {
console.log('cancel');
}
else if (res.data == 'edit') {
this.editGroup(this.roomId);
@@ -593,7 +593,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
IsRequired: "true",
}
});
console.log(this.attendees);
this.popoverController.dismiss();
if (window.innerWidth <= 1024) {
const modal = await this.modalController.create({
@@ -700,16 +700,16 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
const file: any = await this.fileService.getFileFromDevice(types);
console.log('Add file', JSON.stringify(await this.getBase64(file)))
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
const blob = this.base64toBlob(encodedData, file.type)
console.log('Add Blob file', blob)
const formData = new FormData();
formData.append('blobFile', blob);
console.log(formData)
this.wsChatMethodsService.getGroupRoom(roomId).send({
file: {
@@ -726,7 +726,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
} else {
console.log('File type invalid')
}
}
@@ -745,14 +745,14 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
resolve(reader.result)
};
reader.onerror = function (error) {
console.log('Error: ', error);
};
});
}
async openChatOptions(ev?: any) {
console.log(this.members);
const roomId = this.roomId;
const popover = await this.popoverController.create({
@@ -768,7 +768,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await popover.present();
await popover.onDidDismiss().then(async (res) => {
console.log(res['data']);
if (res['data'] == 'meeting') {
this.bookMeeting();
}
@@ -790,7 +790,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async addContacts() {
console.log(this.members);
const modal = await this.modalController.create({
component: GroupContactsPage,
@@ -821,7 +821,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res.data);
this.getRoomInfo();
//this.modalController.dismiss(res.data);
});
@@ -833,18 +833,18 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
buttons: [{
text: 'Sair do grupo',
handler: () => {
console.log('Delete clicked');
}
}, {
text: 'Alterar nome do grupo1',
handler: () => {
console.log('Alterar nome do grupo');
this.openChangeGroupName()
}
}, {
text: 'Apagar o grupo',
handler: () => {
console.log('Play clicked');
}
},
]
@@ -857,11 +857,11 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
} else {
this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
console.log('ALL MSG DBBB', msg)
let chatmsgArray = [];
let array = []
msg.forEach(element => {
console.log('CHANNEL ELEMENT', element.channels)
let msgChat = {
_id: element.Id,
@@ -881,7 +881,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
// this.messages = chatmsgArray;
console.log('GROUP CHAT MSG FROM DB', chatmsgArray)
})
}
}
@@ -939,18 +939,18 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//this.loadMessages()
let msgOnly = res['messages'].filter(data => data.t != 'au');
//this.messages = msgOnly.reverse();
// console.log('MOBILE MSG ROCKET',this.messages);
//
this.transformDataMSG(msgOnly.reverse());
this.getRoomMessageDB(this.roomId);
// Reconnect in one second
if (this.route.url != "/home/chat") {
console.log("Timer message stop")
} else {
//Check if modal is opened
if (document.querySelector('.isGroupChatOpened')) {
await new Promise(resolve => setTimeout(resolve, 5000));
await this.serverLongPull();
console.log('Timer message running')
}
}
@@ -1040,18 +1040,18 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
} else {
pathFile = this.file.externalRootDirectory
}
console.log(pdfString)
console.log(pathFile)
console.log(contentFile)
this.file
.writeFile(pathFile, fileName, contentFile, { replace: true })
.then(success => {
this.fileOpener
.open(pathFile + fileName, 'application/pdf')
.then(() => console.log('File is opened'))
.catch(e => console.log('Error opening file', e));
.then(() => console.log())
.catch(e => console.error(e))
})
.catch(e => console.log('Error writing file', e))
.catch(e => console.error(e))
}
downloadFileMsg(msg: MessageService) {
@@ -1103,7 +1103,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async audioPreview(msg) {
console.log(msg);
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
this.downloadFileMsg(msg)
} else { }
@@ -55,7 +55,7 @@ export class ContactsPage implements OnInit {
headers: this.headers,
};
this.chatService.getAllUsers().subscribe((res:any)=>{
console.log('All users',res.users);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
this.users = this.contacts.sort((a,b) => {
if(a.name < b.name){
@@ -92,7 +92,7 @@ export class ContactsPage implements OnInit {
}
clicked(){
console.log('clicked');
}
createRoom(username:string){
@@ -100,29 +100,29 @@ export class ContactsPage implements OnInit {
username: username,
}
this.chatService.createRoom(body).subscribe(res => {
console.log(res);
this.room = res['room'];
console.log(this.room._id);
this.getDirectMessage(this.room._id);
this.WsChatMethodsService.getAllRooms()
});
}
getDirectMessage(roomId:any){
console.log(roomId);
this.chatService.getAllDirectMessages().subscribe(res=>{
let result = res['ims'].filter(data => data._id == roomId);
console.log(result[0]);
this.dm = result[0];
console.log(this.dm);
this.openModal(this.dm._id);
});
}
async openModal(roomId:any){
this.close();
console.log(roomId);
const modal = await this.modalController.create({
component: MessagesPage,
@@ -143,7 +143,7 @@ export class ContactsPage implements OnInit {
this.createRoom(username);
//Get direct messages (dm)
/* this.getDirectMessage(this.room._id); */
console.log(this.dm);
/* const modal = await this.modalController.create({
+33 -33
View File
@@ -134,7 +134,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
) {
this.loggedUser = authService.ValidatedUserChat['data'];
this.roomId = this.navParams.get('roomId');
console.log('ROOM ID', this.roomId)
window.onresize = (event) => {
if (window.innerWidth > 701) {
@@ -142,7 +142,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
}
console.log(this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({}));
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({})
this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
@@ -157,7 +157,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
ngOnInit() {
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
console.log('MEMBER', value)
})
//this.loadFiles();
VoiceRecorder.requestAudioRecordingPermission();
@@ -254,13 +254,13 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
stopRecording() {
this.deleteRecording();
this.allowTyping = false;
console.log('Stop');
if (!this.recording) {
return;
}
this.recording = false;
VoiceRecorder.stopRecording().then(async (result: RecordingData) => {
console.log(result);
this.recording = false;
if (result.value && result.value.recordDataBase64) {
const recordData = result.value.recordDataBase64;
@@ -269,7 +269,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Save file
this.storage.set('fileName', fileName);
this.storage.set('recordData', result).then(() => {
console.log('Audio recorded saved');
})
}
})
@@ -354,7 +354,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res);
});
}
@@ -422,12 +422,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
}
console.log(this.audioRecorded);
//Converting base64 to blob
const encodedData = btoa(this.audioRecorded);
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
console.log(blob)
const formData = new FormData();
formData.append("blobFile", blob);
@@ -450,7 +450,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
viewDocument(file: any, url?: string) {
console.log()
if (file.type == "application/webtrix") {
this.openViewDocumentModal(file);
}
@@ -462,7 +462,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
/* playSound(url?:any){
alert('here')
console.log(url);
//this.audioDownloaded = this.sanitiser.bypassSecurityTrustResourceUrl(url);
this.audioDownloaded = url;
} */
@@ -601,7 +601,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
IsRequired: "true",
}
});
console.log(this.attendees);
this.popoverController.dismiss();
if (window.innerWidth <= 1024) {
const modal = await this.modalController.create({
@@ -635,7 +635,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const blob = await base64.blob();
const formData = new FormData();
formData.append("blobFile", blob);
console.log('ALL IMAGE', formData)
this.wsChatMethodsService.getDmRoom(roomId).send({
file: {
@@ -715,9 +715,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
resultType: CameraResultType.Base64,
source: CameraSource.Photos
});
console.log('ADDFILECHAT', file)
//const imageData = await this.fileToBase64Service.convert(file)
//console.log('ADDFILECHAT', imageData)
//
const response = await fetch('data:image/jpeg;base64,' + file.base64String!);
const blob = await response.blob();
@@ -752,17 +752,17 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const file: any = await this.fileService.getFileFromDevice(types);
console.log('Add file', JSON.stringify(await this.getBase64(file)))
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
const blob = this.base64toBlob(encodedData, file.type)
console.log('Add Blob file', blob)
const formData = new FormData();
formData.append('blobFile', blob);
console.log(formData)
this.wsChatMethodsService.getDmRoom(roomId).send({
file: {
@@ -778,7 +778,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
temporaryData: formData
});
} else {
console.log('File type invalid')
}
@@ -793,7 +793,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
resolve(reader.result)
};
reader.onerror = function (error) {
console.log('Error: ', error);
};
});
@@ -801,7 +801,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async openChatOptions(ev?: any) {
const roomId = this.roomId
console.log('MOBILE CHAT OPTION', this.members);
const popover = await this.popoverController.create({
component: ChatOptionsPopoverPage,
@@ -816,7 +816,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await popover.present();
popover.onDidDismiss().then(async (res) => {
console.log(res['data']);
if (res['data'] == 'meeting') {
this.bookMeeting();
}
@@ -843,11 +843,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
} else {
this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
console.log('ALL MSG DBBB', msg)
let chatmsgArray = [];
let array = []
msg.forEach(element => {
console.log('CHANNEL ELEMENT', element.channels)
let msgChat = {
_id: element.Id,
@@ -867,7 +867,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
console.log('CHAT MSG FROM DB', chatmsgArray)
})
}
}
@@ -958,18 +958,18 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
// } else {
// pathFile = this.file.externalRootDirectory
// }
// console.log(pdfString)
// console.log(pathFile)
// console.log(contentFile)
//
//
//
// this.file
// .writeFile(pathFile, fileName, contentFile, { replace: true })
// .then(success => {
// this.fileOpener
// .open(pathFile + fileName, type)
// .then(() => console.log('File is opened'))
// .catch(e => console.log('Error opening file', e));
// .then(() =>
// .catch(e =>
// })
// .catch(e => console.log('Error writing file', e))
// .catch(e =>
}
downloadFileFromBrowser(fileName: string, data: any): void {
@@ -982,7 +982,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async openPreview(msg) {
console.log(msg);
if(msg.file.type === "application/webtrix") {
this.viewDocument(msg.file, msg.attachments.image_url)
@@ -1021,7 +1021,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async audioPreview(msg) {
console.log(msg);
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
this.downloadFileMsg(msg)
} else { }
@@ -86,8 +86,8 @@ export class ContactsPage implements OnInit {
}
return 0;
});
console.log(res);
console.log(this.users);
}); */
this.users = this.contacts.sort((a,b) => {
if(a.first < b.first){
@@ -135,7 +135,7 @@ export class ContactsPage implements OnInit {
}
clicked(){
console.log('clicked');
}
async groupMessages(){
@@ -44,7 +44,7 @@ export class NewGroupPage implements OnInit {
}
ngOnInit() {
console.log(this.documents);
}
_ionChange(event){
@@ -62,7 +62,7 @@ export class NewGroupPage implements OnInit {
}
async createGroup(){
console.log('NEW GROUP', SessionStore.user.UserName)
let name = this.groupName.split(' ').join('-');
//Take out all special characters in string
name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
@@ -75,11 +75,11 @@ export class NewGroupPage implements OnInit {
"countDownDate":this.thedate
}
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
console.log(res);
}
else{
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
console.log(res);
}
this.isGroupCreated = true;
@@ -94,7 +94,7 @@ export class NewGroupPage implements OnInit {
this.close();
let name = this.groupName.split(' ').join('-');
console.log(name);
const modal = await this.modalController.create({
component: GroupContactsPage,
@@ -130,7 +130,7 @@ export class NewGroupPage implements OnInit {
text: 'Ok',
cssClass: 'btn-cancel',
handler:(value:any)=>{
console.log('button done pressed');
let now = new Date();
this.thedate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds());
@@ -139,7 +139,7 @@ export class NewGroupPage implements OnInit {
value.hours.value,
value.minutes.value,
]
console.log(this.selectedDuration);
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
if(value.days.value > 0){
if(value.days.value == 1){