Add separate default file names for audio/video

This commit is contained in:
Tulir Asokan
2017-11-27 23:14:17 +02:00
parent 0a09816003
commit ca88182867
+9 -1
View File
@@ -166,7 +166,15 @@ class Portal {
} else if (evt.document) {
// TODO handle stickers better
const file = await this.copyTelegramFile(evt.source, sender, evt.document)
file.name = evt.caption || "Uploaded document"
if (evt.caption) {
file.name = evt.caption
} else if (evt.matrixtype === "m.audio") {
file.name = "Uploaded audio"
} else if (evt.matrixtype === "m.video") {
file.name = "Uploaded video"
} else {
file.name = "Uploaded document"
}
sender.sendFile(this.roomID, file)
} else if (evt.geo) {
sender.sendLocation(this.roomID, evt.geo)