handleEntities code uses simple modification offset which does not
allow to detect whether the offset is placed before or after
the element in already modified string.
This works fine is most cases as Telegram server always sort the
elements by offset, in ascending order.
However, this is not the case when the modification, for example bold
text, is applied to the URL. In this case, the offset of URL and
bold entity is equal, which raises the issue.
This commit introduces additional hack for this case, stripping
any entities which intersect with URL.
Clear all existing IRC event handler registrations before registering
new handlers in case we are connecting via a BNC and are seeing
a reconnect.
Fixes#1564
Sorta regression introduced by 9a8ce9b17e
which changes the way we get replies of matrix.
This causes issues like https://github.com/42wim/matterbridge/issues/1780
We "fix" this by mimicking the old behaviour when "PreserveThreading" is
disabled.
* Send multiple images/video/documents as media group
* Fix media caption quotting
* Fix errors handling
* Refactor parent id detection
* Try to reduce cognitive complexity of code
* Remove unused conditional
* Mumble: Implement a workaround to signal Opus support without pulling in the CGO gopus dependency.
* mumble: lowercase error messages
* mumble: Add link to #1750 in bridge/mumble/codec.go
* Telegram: handle entities before everything
* Telegram: use runes for text entities
* Telegram: use proper offset and runes for links
* Telegram: put newline after backticks for pre
* Telegram: use utf16 for entity processing
Forward from channels requires different handling than forward from the regular users.
This patch fixes the issue: it prints channel title instead of "forwarded from unknown".
* Change bridge/telegram/handlers.go
Comment out the removing of empty lines
add support for bold, italic and striked telegram messages
* Implement Telegram MessageEntities correctly
* Apply gofmt
Co-authored-by: Jan Martin Reckel <jan-martin.reckel@s2017.tu-chemnitz.de>
Co-authored-by: Wim <wim@42.be>