This commit is contained in:
tiago.kayaya
2022-03-27 15:18:54 +01:00
parent 160015c878
commit ee496965e1
6 changed files with 30 additions and 28 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() {
+15 -20
View File
@@ -24,10 +24,10 @@ export class MessageService {
msg = ''
rid = ''
ts = {}
u = {
name: '',
username: '',
u = {
name: '',
username: '',
_id: ""
}
@@ -105,7 +105,7 @@ export class MessageService {
}
if(this.hasFile) {
if(this.file.type != 'application/webtrix') {
this.displayType = this.file.type.replace('application/','').toUpperCase()
}
@@ -129,7 +129,7 @@ export class MessageService {
if(!this.hasFile) {
const params = {roomId:this.rid, msg:this.msg, localReference: this.localReference}
await this.sendRequest(params)
} else {
@@ -143,7 +143,7 @@ export class MessageService {
this.uploadingFile = false
if(uploadSuccessfully || this.hasSendAttachment == false) {
if(uploadSuccessfully ) {
this.hasSendAttachment = true
this.errorUploadingAttachment = false
this.temporaryData = {}
@@ -169,7 +169,7 @@ export class MessageService {
return new Promise((resolve, reject)=>{
reject(false)
})
}
}
@@ -193,13 +193,8 @@ export class MessageService {
this.WsChatService.registerCallback({
type: 'reConnect',
funx: async ()=> {
this.WsChatService.send(params).then(({message, requestId}) => {
let ChatMessage = message.result
this.messageSend = true
this.redefinedMessage(ChatMessage)
})
this.sendRequest(params)
return true
}
})
@@ -209,7 +204,7 @@ export class MessageService {
async redefinedMessage(ChatMessage , update = true) {
ChatMessage = this.NfService.fix_updatedAt(ChatMessage)
const message = this.getChatObj()
ChatMessage = Object.assign(message, ChatMessage)
@@ -244,7 +239,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()
@@ -264,7 +259,7 @@ export class MessageService {
}
async delateDB() {
// alert('delete data')
const message = await MessageModel.get({_id: this._id})
await message.delete()
@@ -284,8 +279,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>
@@ -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)
@@ -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>
@@ -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>