-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pasting an image from a browser to the chat window crashes on send #867
Labels
bug/fix
Quaternion doesn't work as expected
Comments
chmeeedalf
changed the title
Pasting an image to the chat window crashes on send
Pasting an image from a browser to the chat window crashes on send
May 4, 2023
chmeeedalf
added a commit
to chmeeedalf/Quaternion
that referenced
this issue
May 4, 2023
Copying an image from Firefox attaches some HTML to the image. Extracting the plain text from the HTML before the image results in empty data in the field, with no image, triggering an assertion failure on message send. This is a partial fix for issue quotient-im#867. Partial, because the resulting image does not appear in the chat window until relaunching, due to an error opening the temp file created by this.
This as-is was fixed by PR #868, will open a different issue for image uploads. |
Did you open that other issue? I don't seem to find it. |
Yeah, it's issue #869. |
Oh, thanks, this slipped through my fingers. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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&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
The text was updated successfully, but these errors were encountered: