Skip to content

Commit

Permalink
Send attachment descriptions as separate text message
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-scorpio committed Jul 24, 2024
1 parent a79977f commit 623241c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/handlers/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,15 @@ export async function handle(rcMessage: RcMessage): Promise<void> {
rcMessage.file.name,
rcMessage.file.type
)
if (rcMessage.attachments[0].description) {
// send the description as a separate text message
const saved_id = rcMessage._id
rcMessage._id = rcMessage.file._id
rcMessage.msg = rcMessage.attachments[0].description
rcMessage.type = 'm.text'
await handleMessage(rcMessage, room_id, ts)
rcMessage._id = saved_id
}
rcMessage.msg = rcMessage.file.name
rcMessage.file.url = mxcurl
if (rcMessage.attachments[0].image_type) {
Expand Down

0 comments on commit 623241c

Please sign in to comment.