Export chat (from room info page)
This commit is contained in:
parent
dd48bedfb5
commit
95555a23e4
16 changed files with 18905 additions and 657 deletions
|
|
@ -22,7 +22,7 @@ var _browserCanRecordAudioF = function () {
|
|||
var _browserCanRecordAudio = _browserCanRecordAudioF();
|
||||
|
||||
class Util {
|
||||
getAttachment(matrixClient, event, progressCallback) {
|
||||
getAttachment(matrixClient, event, progressCallback, asBlob = false) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const content = event.getContent();
|
||||
if (content.url != null) {
|
||||
|
|
@ -53,7 +53,11 @@ class Util {
|
|||
return this.decryptIfNeeded(file, response);
|
||||
})
|
||||
.then(bytes => {
|
||||
resolve(URL.createObjectURL(new Blob([bytes.buffer], { type: file.mimetype })));
|
||||
if (asBlob) {
|
||||
resolve(new Blob([bytes.buffer], { type: file.mimetype }));
|
||||
} else {
|
||||
resolve(URL.createObjectURL(new Blob([bytes.buffer], { type: file.mimetype })));
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log("Download error: ", err);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue