This commit is contained in:
Peter Maquiran
2022-02-04 00:57:46 +01:00
parent 3b6e519adb
commit 7ee2289ca0
3 changed files with 19 additions and 38 deletions
@@ -510,10 +510,9 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
"image_url": capturedImage
},
attachments: [{
//"title": this.capturedImageTitle ,
//"text": "description",
"title": capturedImageTitle ,
"text": "description",
"title_link_download": false,
//"image_url": this.capturedImage,
}]
})
@@ -635,18 +634,20 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
"image_url": imageData
},
attachments: [{
//"title": this.capturedImageTitle ,
//"text": "description",
"title": file.name ,
"text": "description",
"title_link_download": false,
"type": "application/img",
"guid": '',
"image_url": imageData
}]
})
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
message.file.guid = guid.path
updateMessage({
file: {
type: "application/img",
guid: guid.path,
image_url: imageData
}
})
this.AttachmentsService.downloadFile(guid.path).subscribe(async (event) => {
@@ -656,23 +657,6 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
} else if (event.type === HttpEventType.Response) {
var fileImage = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
console.log('add picture to chat',fileImage);
updateMessage({
file: {
type: "application/img",
guid: guid.path,
image_url: fileImage
},
attachments: [{
//"title": this.capturedImageTitle ,
//"text": "description",
"title_link_download": false,
"type": "application/img",
guid: guid.path,
"image_url": fileImage
}]
})
await this.storage.set(guid.path, fileImage).then(() => {
console.log('add picture to chat IMAGE SAVED')
message.getFileFromDb()
+4 -5
View File
@@ -533,10 +533,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
"image_url": capturedImage
},
attachments: [{
//"title": this.capturedImageTitle ,
//"text": "description",
"title": capturedImageTitle ,
"text": "description",
"title_link_download": false,
//"image_url": this.capturedImage,
}]
})
@@ -658,9 +657,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
"image_url": imageData
},
attachments: [{
"title": file.name,
"title": file.name ,
"text": "description",
"title_link_download": false,
"image_url": imageData,
}]
})
@@ -681,10 +681,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
"image_url": capturedImage
},
attachments: [{
//"title": this.capturedImageTitle ,
//"text": "description",
"title": capturedImageTitle ,
"text": "description",
"title_link_download": false,
//"image_url": this.capturedImage,
}]
})
@@ -806,10 +805,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
"image_url": imageData
},
attachments: [{
//"title": this.capturedImageTitle ,
//"text": "description",
"title": file.name ,
"text": "description",
"title_link_download": false,
//"image_url": this.capturedImage,
}]
})