This commit is contained in:
eta 2020-06-19 12:55:48 +01:00
parent 26620cf36b
commit 6c0e61f2a5

View file

@ -774,7 +774,7 @@ MEDIA-TYPE is one of (:image :video :audio :document)."
(multiple-value-bind (body status-code)
(drakma:http-request put-url
:additional-headers headers
:content-length (file-length file-data)
:content-length (length decrypted-file)
:content-type mime-type
:method :put
:content decrypted-file)
@ -794,6 +794,7 @@ MEDIA-TYPE is one of (:image :video :audio :document)."
(format *debug-io* "~&using path ~A~%" path)
(cl-qrencode:encode-png-stream text stream)
(catcher
(let ((content-length (file-length stream)))
(attach
(request-http-upload-slot comp (component-upload-component-name comp)
"qrcode.png"
@ -806,7 +807,7 @@ MEDIA-TYPE is one of (:image :video :audio :document)."
(drakma:http-request put-url
:additional-headers headers
:content-type "image/png"
:content-length (file-length stream)
:content-length content-length
:method :put
:content path)
(unless (and (>= status-code 200) (< status-code 300))
@ -822,7 +823,7 @@ MEDIA-TYPE is one of (:image :video :audio :document)."
(cxml:attribute "xmlns" +oob-ns+)
(cxml:with-element "url"
(cxml:text get-url))))
(admin-msg comp jid "(Code expired? Be faster next time. Get a new one with `connect`.)")))))))
(admin-msg comp jid "(Code expired? Be faster next time. Get a new one with `connect`.)"))))))))
(t (e)
(admin-msg comp jid (format nil "Failed to upload QR code!~%Report the following error to the bridge admin: `~A`" e)))))))