quotient-im / Quaternion

A Qt-based IM client for Matrix
https://matrix.org/ecosystem/clients/quaternion/
GNU General Public License v3.0
637 stars 108 forks source link

Pasting an image from a browser to the chat window crashes on send #867

Closed chmeeedalf closed 1 year ago

chmeeedalf commented 1 year ago

Description

Copy&Pasting an image from Firefox looks to paste something in the textbox, but upon sending Quaternion crashes with an assert failure: ASSERT: "!plainText.isEmpty() && !htmlText.isEmpty()" in file /.../client/chatroomwidget.cpp, line 428

Steps to reproduce

Ideal behavior would be to convert the paste into an image upload, like Element does. However, not crashing, or even just outright rejecting an image paste, would also work.

Adding some printf debugging to ChatEdit::insertFromMimeData(), I see the following:

hasHtml: true hasImage: true

html: "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"><img class=\"avatar avatar-user\" src=\"https://avatars.githubusercontent.com/u/1408010?s=52&amp;v=4\" alt=\"@chmeeedalf\" width=\"26\" height=\"26\">" -- end

"html: " and " -- end" being added by me as delimiters.

Quaternion dumps logs to the standard output. If you can find the logs and identify any log snippets relevant to your issue, please include those here (please be careful to remove any personal or private data):

ASSERT: "!plainText.isEmpty() && !htmlText.isEmpty()" in file /.../client/chatroomwidget.cpp, line 428

Version information

chmeeedalf commented 1 year ago

This as-is was fixed by PR #868, will open a different issue for image uploads.

KitsuneRal commented 1 year ago

Did you open that other issue? I don't seem to find it.

chmeeedalf commented 1 year ago

Yeah, it's issue #869.

KitsuneRal commented 12 months ago

Oh, thanks, this slipped through my fingers.