This commit is contained in:
Peter Maquiran
2022-03-27 15:33:00 +01:00
7 changed files with 41 additions and 34 deletions
@@ -102,7 +102,10 @@
<div class="message">
<div *ngIf="msg.attachments" class="message-attachments">
<div *ngFor="let file of msg.attachments">
<div *ngIf="msg.file.type == 'application/img'" (click)="openPreview(msg)">
<div *ngIf="msg.file.type == 'application/img' && !msg.attachments[0].image_url">
NOT UPLOADED
</div>
<div *ngIf="msg.file.type == 'application/img' && msg.attachments[0].image_url" (click)="openPreview(msg)">
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image" >
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
</div>
@@ -276,7 +276,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
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;
@@ -293,7 +293,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
})
}
})
}
startRecording() {
+13 -13
View File
@@ -24,10 +24,10 @@ export class MessageService {
msg = ''
rid = ''
ts = {}
u = {
name: '',
username: '',
u = {
name: '',
username: '',
_id: ""
}
@@ -88,10 +88,10 @@ export class MessageService {
} else {
this.attachments = attachments
}
this.viewed = [...new Set([...viewed,...this.viewed])];
this.received = [...new Set([...received,...this.received])];
if(!this.ts) {
this.offline = true
this.messageSend = false
@@ -131,7 +131,7 @@ export class MessageService {
if(!this.hasFile) {
const params = {roomId:this.rid, msg:this.msg, localReference: this.localReference}
await this.sendRequest(params)
} else {
@@ -171,7 +171,7 @@ export class MessageService {
return new Promise((resolve, reject)=>{
reject(false)
})
}
}
@@ -206,7 +206,7 @@ export class MessageService {
async redefinedMessage(ChatMessage , update = true) {
ChatMessage = this.NfService.fix_updatedAt(ChatMessage)
const message = this.getChatObj()
ChatMessage = Object.assign(message, ChatMessage)
@@ -241,7 +241,7 @@ export class MessageService {
title_link_download: this.attachments[0].title_link_download,
ts: this.attachments[0].ts
}
console.log(this.attachments)
// save the changes to the storage
this.save()
@@ -261,7 +261,7 @@ export class MessageService {
}
async delateDB() {
// alert('delete data')
const message = await MessageModel.get({_id: this._id})
await message.delete()
@@ -281,8 +281,8 @@ export class MessageService {
return {
channels: this.channels,
mentions: this.mentions,
//msg: this.AESEncrypt.encrypt(this.msg, SessionStore.user.RochetChatUser),
msg:this.msg,
//msg: this.AESEncrypt.encrypt(this.msg, SessionStore.user.RochetChatUser),
msg:this.msg,
rid: this.rid,
ts: this.ts,
u: this.u,
@@ -76,7 +76,11 @@
<div class="message">
<div *ngIf="msg.attachments" class="message-attachments">
<div *ngFor="let file of msg.attachments">
<div *ngIf="msg.file.type == 'application/img'" (click)="openPreview(msg)">
<div *ngIf="msg.file.type == 'application/img' && !msg.attachments[0].image_url">
NOT UPLOADED
</div>
<div *ngIf="msg.file.type == 'application/img' &&
msg.attachments[0].image_url" (click)="openPreview(msg)">
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image">
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
</div>
@@ -124,8 +128,8 @@
<ion-label class="info-meeting-medium"><ion-icon></ion-icon><ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}</ion-label><br />
</div>
</div>
<div *ngIf="msg.t == 'r'" class="info-text">
<ion-label>Alterou o nome do grupo para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
@@ -214,9 +218,9 @@
<ion-fab-button title="Nova Reunião" (click)="bookMeeting()" color="light">
<ion-icon name="calendar"></ion-icon>
</ion-fab-button>
<ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
<!-- <ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
<ion-icon name="document"></ion-icon>
</ion-fab-button>
</ion-fab-button> -->
<ion-fab-button title="Anexar Fotografia" (click)="addImage()" color="light">
<ion-icon name="image"></ion-icon>
</ion-fab-button>
@@ -278,7 +278,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
this.storage.get('fileName').then((fileName) => {
this.lastAudioRecorded = fileName;
})
this.storage.get('recordData').then((recordData) => {
console.log(recordData);
if(recordData?.value?.recordDataBase64.includes('data:audio')){
@@ -290,7 +290,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
});
} catch (error) {}
}
startRecording() {
@@ -454,7 +454,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
}
//Converting base64 to blob
const encodedData = btoa(this.audioRecorded);
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
@@ -49,12 +49,12 @@
<span class="time">{{msg.duration}}</span>
</div>
<div class="d-flex justify-space-between">
<ion-label *ngIf="msg.delate == false" class="flex-0">{{msg.msg}} </ion-label>
<ion-label *ngIf="msg.delate == false" class="flex-0">{{msg.msg}} </ion-label>
<ion-label *ngIf="msg.delate == true" class="flex-0">Apagou a mensagem</ion-label>
<ion-label class="float-status-all float-status" >
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
@@ -84,7 +84,6 @@
<div *ngIf="msg.file.type == 'application/img'" (click)="openPreview(msg)" dfsdvsvs>
<img src={{msg.attachments[0].image_url}} alt="image">
<ion-label class="float-status-all float-status" >
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
@@ -127,7 +126,7 @@
<span *ngIf="msg.file.type != 'application/webtrix' && msg.file.type != 'application/audio'">{{msg.displayType}}</span>
</ion-label>
<ion-label class="float-status-all float-status" >
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
@@ -144,6 +143,7 @@
<ion-label *ngIf="msg.delate == true" class="info-meeting-small">Apagou a mensagem</ion-label><br />
<ion-label *ngIf="msg.delate == false" class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
<button *ngIf="msg.delate == false" (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal">
<ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label>
@@ -163,7 +163,7 @@
</div>
</div>
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
<ion-fab-button *ngIf="scrollToBottomBtn" (click)="scrollToBottomClicked()" color="light" size="small">
<ion-icon name="chevron-down"></ion-icon>
@@ -174,7 +174,7 @@
<ion-footer (click)="wsChatMethodsService.getDmRoom(roomId).sendReadMessage()">
<div class="typing" *ngIf="wsChatMethodsService.getDmRoom(roomId).otherUserType == true" >
<ngx-letters-avatar *ngIf="showAvatar"
[avatarName]= "wsChatMethodsService.getDmRoom(roomId).name"
@@ -198,9 +198,9 @@
<ion-fab-button title="Nova Reunião" (click)="bookMeeting()" color="light">
<ion-icon name="calendar"></ion-icon>
</ion-fab-button>
<ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
<!-- <ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
<ion-icon name="document"></ion-icon>
</ion-fab-button>
</ion-fab-button> -->
<ion-fab-button title="Anexar Fotografia" (click)="addImage()" color="light">
<ion-icon name="image"></ion-icon>
</ion-fab-button>
@@ -7,7 +7,7 @@
</div>
<div class="buttons">
<button (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
<button (click)="addFile()" class="btn-ok" shape="round" >Anexar Documento</button>
<!-- <button (click)="addFile()" class="btn-ok" shape="round" >Anexar Documento</button> -->
<button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Gestão Documental</button>
<div class="solid"></div>