mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
bridgev2/commands: add file info for QR codes
This commit is contained in:
parent
bc79822eab
commit
5779871f1b
1 changed files with 10 additions and 5 deletions
|
|
@ -251,14 +251,19 @@ func sendQR(ce *Event, qr string, prevEventID *id.EventID) error {
|
|||
return fmt.Errorf("failed to upload image: %w", err)
|
||||
}
|
||||
content := &event.MessageEventContent{
|
||||
MsgType: event.MsgImage,
|
||||
FileName: "qr.png",
|
||||
URL: qrMXC,
|
||||
File: qrFile,
|
||||
|
||||
MsgType: event.MsgImage,
|
||||
FileName: "qr.png",
|
||||
URL: qrMXC,
|
||||
File: qrFile,
|
||||
Body: qr,
|
||||
Format: event.FormatHTML,
|
||||
FormattedBody: fmt.Sprintf("<pre><code>%s</code></pre>", html.EscapeString(qr)),
|
||||
Info: &event.FileInfo{
|
||||
MimeType: "image/png",
|
||||
Width: qrSizePx,
|
||||
Height: qrSizePx,
|
||||
Size: len(qrData),
|
||||
},
|
||||
}
|
||||
if *prevEventID != "" {
|
||||
content.SetEdit(*prevEventID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue