diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts
index a7843735c..820f2ebab 100644
--- a/src/app/shared/chat/group-messages/group-messages.page.ts
+++ b/src/app/shared/chat/group-messages/group-messages.page.ts
@@ -39,6 +39,7 @@ import { DomSanitizer } from '@angular/platform-browser';
import { AlertController, NavParams } from '@ionic/angular';
import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
+import { SessionStore } from 'src/app/store/session.service';
/*
@@ -104,6 +105,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
duration = 0;
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
+ sessionStore = SessionStore
constructor(
public wsChatMethodsService: WsChatMethodsService,
@@ -287,11 +289,11 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
})
this.storage.get('recordData').then((recordData) => {
- console.log(recordData);
+
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
}
- else {
+ else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
}
});
@@ -334,7 +336,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
this.recording = false;
if (result.value && result.value.recordDataBase64) {
const recordData = result.value.recordDataBase64;
- //console.log(recordData);
+ //
const fileName = new Date().getTime() + ".mp3";
//Save file
this.storage.set('fileName', fileName);
@@ -462,12 +464,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
const roomId = this.roomId
let audioFile;
this.storage.get('recordData').then((recordData) => {
- console.log(recordData);
+
audioFile = recordData;
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = recordData?.value?.recordDataBase64;
}
- else {
+ else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
}
diff --git a/src/app/shared/chat/messages/contacts/contacts.page.ts b/src/app/shared/chat/messages/contacts/contacts.page.ts
index 8ca65d560..6dfd88e75 100644
--- a/src/app/shared/chat/messages/contacts/contacts.page.ts
+++ b/src/app/shared/chat/messages/contacts/contacts.page.ts
@@ -7,6 +7,7 @@ import { GroupMessagesPage } from '../../group-messages/group-messages.page';
import { MessagesPage } from '../messages.page';
import { ThemeService } from 'src/app/services/theme.service'
import { WsChatMethodsService} from 'src/app/services/chat/ws-chat-methods.service'
+import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-contacts',
@@ -24,6 +25,7 @@ export class ContactsPage implements OnInit {
textSearch:string;
room:any;
dm:any;
+ sessionStore = SessionStore
@Output() openMessage:EventEmitter
= new EventEmitter();
@@ -71,8 +73,8 @@ export class ContactsPage implements OnInit {
};
this.chatService.getAllUsers().subscribe((res:any)=>{
console.log(res.users);
- //this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username);
- this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username);
+ //this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
+ this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
this.users = this.contacts.sort((a,b) => {
if(a.name < b.name){
return -1;
diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html
index b8f21d049..cd7b7a49e 100644
--- a/src/app/shared/chat/messages/messages.page.html
+++ b/src/app/shared/chat/messages/messages.page.html
@@ -36,7 +36,7 @@
-
+
@@ -65,7 +65,7 @@
-
diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts
index b08467e10..6ba153488 100644
--- a/src/app/shared/chat/messages/messages.page.ts
+++ b/src/app/shared/chat/messages/messages.page.ts
@@ -38,6 +38,7 @@ import { DomSanitizer } from '@angular/platform-browser';
import { AlertController, Platform, NavParams } from '@ionic/angular';
import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
+import { SessionStore } from 'src/app/store/session.service';
const IMAGE_DIR = 'stored-images';
@@ -95,6 +96,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
duration = 0;
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
+ sessionStore = SessionStore
constructor(
public popoverController: PopoverController,
@@ -281,11 +283,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
})
this.storage.get('recordData').then((recordData) => {
- console.log(recordData);
+
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
}
- else {
+ else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
}
});
@@ -293,11 +295,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.storage.get('recordData').then((recordData) => {
- console.log(recordData);
- if (recordData.value.recordDataBase64.includes('data:audio')) {
+
+ if (recordData?.value?.recordDataBase64?.includes('data:audio')) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData.value.recordDataBase64);
}
- else {
+ else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`);
}
});
@@ -337,7 +339,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.recording = false;
if (result.value && result.value.recordDataBase64) {
const recordData = result.value.recordDataBase64;
- //console.log(recordData);
+ //
const fileName = new Date().getTime() + ".mp3";
//Save file
this.storage.set('fileName', fileName);
@@ -406,10 +408,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
const roomId = this.roomId
let audioFile;
this.storage.get('recordData').then((recordData) => {
- console.log(recordData);
+
audioFile = recordData;
- if (recordData.value.recordDataBase64.includes('data:audio')) {
+ if (recordData?.value?.recordDataBase64?.includes('data:audio')) {
this.audioRecorded = recordData.value.recordDataBase64;
}
else {
@@ -543,7 +545,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
//this.showLoader = true;
this.chatService.getMembers(this.roomId).subscribe(res => {
this.members = res['members'];
- this.dmUsers = res['members'].filter(data => data.username != this.loggedUser.me.username)
+ this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.RochetChatUser)
this.showLoader = false;
});
}
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index e1c6e905b..5f8a0d1c3 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -23,10 +23,10 @@ export const environment = {
production: false,
//apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/',
- //apiChatUrl: 'https://gabinetedigitalchat.dyndns.info/api/v1/',
- //apiWsChatUrl: 'wss://gabinetedigitalchat.dyndns.info/websocket',
- apiChatUrl: 'https://www.tabularium.pt/api/v1/',
- apiWsChatUrl: 'wss://www.tabularium.pt/websocket',
+ apiChatUrl: 'https://gabinetedigitalchat.dyndns.info/api/v1/',
+ apiWsChatUrl: 'wss://gabinetedigitalchat.dyndns.info/websocket',
+ //apiChatUrl: 'https://www.tabularium.pt/api/v1/',
+ //apiWsChatUrl: 'wss://www.tabularium.pt/websocket',
/* apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/', */
domain: 'gabinetedigital.local', //gabinetedigital.local
defaultuser: 'paulo.pinto@gabinetedigital.local',//paulo.pinto paulo.pinto@gabinetedigital.local