UnigramDev/Unigram/develop • 5623245 • 1 files, +34/-5
Trim the namespace and class from native log lines
MSVC expands __FUNCTION__ to the fully qualified name, so every line logged from
Telegram.Native carried the same winrt::...::implementation:: prefix, followed by
a class the file name already gives:
[1786432732.490][AsyncMediaPlayer.cpp:376][winrt::Telegram::Native::Media::implementation::AsyncMediaPlayer::Close]
Keep only what follows the class, which is also what [CallerMemberName] passes in
from the managed side. Cutting at the last :: instead would have reduced a lambda
to a bare "operator ()", so the enclosing method is kept there.
The std::string temporary goes with it: to_hstring takes anything convertible to
string_view, and these names are well past the small string limit.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
UnigramDev/Unigram/develop • 1b3d6a9 • 4 files, +683/-1
Copy/paste in Telegram Android's rich HTML format
ProseMirror serialized its own render DOM to the clipboard (div.pm-pullquote,
span.pm-spoiler and friends), which Android's RichHtml.parse flattens to loose
paragraphs: every quote, list and table lost its structure in both directions.
Adds a clipboardSerializer/clipboardParser pair speaking the dialect Android
writes and reads, so a selection round-trips between the two clients. Three
deliberate deviations, all of which its parser accepts:
- checklist state is emitted (it reads data-checkbox/data-checked but never
writes them), as bare attributes since it tests for presence;
- a nested list is written inside the <li> that owns it, which is what its
parser expects — it writes them as a sibling of the <li> and then drops them
on the way back in;
- nodes it has no tag for (math, buttons, anchors, mentions) ride in data-*
attributes on a tag it degrades sensibly.
Media follows the same trade as its RichMediaClipboard: the HTML carries only
the file id, the attrs behind it live in an in-process registry until the next
copy, and an id we can't resolve is dropped rather than pasted broken.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
#unigram
Post #20629
43