-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Add reactions to export chat history #28252
Add reactions to export chat history #28252
Conversation
70ae55f
to
1f98df3
Compare
Nice! I'll try to look into that after the current release (that I'm building now). |
@BohdanTkachenko Please update to the latest code that should take care of paid reactions (star reactions), |
1f98df3
to
19c06a7
Compare
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.
And so on.
The code style of this repository demands to use auto a = Type()
instead of Type a
.
@@ -1803,38 +1812,52 @@ Data::FileOrigin ApiWrap::currentFileMessageOrigin() const { | |||
return result; | |||
} | |||
|
|||
bool ApiWrap::renderCustomEmoji(QByteArray *data) { |
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.
QByteArray *data
Can’t say I like that.
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.
Changed it to return an optional value instead and avoid passing data by pointer directly. Does it look better now?
Co-authored-by: 23rd <23rd@vivaldi.net>
Co-authored-by: 23rd <23rd@vivaldi.net>
Co-authored-by: 23rd <23rd@vivaldi.net>
Co-authored-by: 23rd <23rd@vivaldi.net>
Co-authored-by: 23rd <23rd@vivaldi.net>
Co-authored-by: 23rd <23rd@vivaldi.net>
Co-authored-by: 23rd <23rd@vivaldi.net>
Also avoid passing a pointer to change data. Instead will return an optional value.
I checked in Chrome and Firefox and in both it renders properly. I mean it still a bit ugly because I don't know what to do with custom emojis, but it renders them horizontally. Would you mind sharing a bit more info about the issue? Like what OS and browser. Also, can you please try to reproduce it in some public channel, so I can reproduce it later on my machine. Also maybe you can share a snippet of generated HTML so I can take a look? |
I just fixed the rendering for paid reactions and also I decided to put waving hand emoji (👋) instead of Here is what I have right now (tested on https://t.me/durov channel): |
I have tested the latest code and the issue seems to had gone away. |
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.
Not sure about 👋 for custom emoji, but still it seems to be work.
Don’t forget to rebase. |
you an merge rebasing. :) |
Thanks for the hard work! |
This should allow to export reactions in both JSON and HTML exports. Fixes #27971
Tested in a local environment.
Current limitations in HTML output:
Example JSON message with reactions:
Example generated HTML:
As you can see, custom emojis embedded into
text_entries
were properly serialized as a path to an image. I tried to follow the same code for serializing custom emojis in reactions, but somehow it is still different. I am definitely missing something, but cannot yet figure out exactly what.