-
Notifications
You must be signed in to change notification settings - Fork 109
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
Correctly format notification text for reply in a thread #2568 #2569
base: develop
Are you sure you want to change the base?
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2569 +/- ##
===========================================
+ Coverage 73.14% 73.15% +0.01%
===========================================
Files 1408 1408
Lines 34095 34112 +17
Branches 6617 6623 +6
===========================================
+ Hits 24939 24955 +16
Misses 5699 5699
- Partials 3457 3458 +1 ☔ View full report in Codecov by Sentry. |
@@ -29,50 +32,87 @@ import org.jsoup.select.NodeVisitor | |||
* Converts the HTML string in [TextMessageType.formatted] to a plain text representation by parsing it and removing all formatting. | |||
* If the message is not formatted or the format is not [MessageFormat.HTML], the [TextMessageType.body] is returned instead. | |||
*/ | |||
fun TextMessageType.toPlainText() = formatted?.toPlainText() ?: body | |||
fun TextMessageType.toPlainText(stringProvider: StringProvider? = null) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to always pass a non-null StringProvider
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it, but it's quite painful since this method is used in data class constructor, and other place where we do not have a stringProvider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually my bad, it's only he case for Document.toPlainText
. I will give it a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I have tried it and it's adding lots of noise (Let me know if you want to see the code). Since there is no added value, I think we can keep the parameter optional. Do you agree @jmartinesp ?
I'm not too sure about the current implementation: wouldn't it be better to add the |
Quality Gate passedIssues Measures |
Oh, it's not happening because the HTML somehow doesn't contain the i.e. this is what I see in the debugger:
And this is the formatted body from the view source code screen:
|
Yes, I guess the SDK is doing some cleanup for us. |
So how about we do it in some different way? We could create something to detect if a message contains this Alternatively, if we do want to have this as part of the |
Yes the current rendering is broken, see #2568 I did not test with the mention though. |
To be clear, by 'current rendering' I meant with this branch, not with the code in EDIT: yes, I can confirm it looks ok and was looking at the notifications from the wrong app... |
Type of change
Content
Ensure
PlainTextNodeVisitor
correctly formatmx-reply
content.Motivation and context
Fixes #2568
Screenshots / GIFs
Tests
Tested devices
Checklist