telegram

A Matrix-Telegram hybrid puppeting/relaybot bridge

AGPL-3.0 License

Downloads
1.7K
Stars
1.2K
Committers
45

Bot releases are hidden (Show)

telegram - v0.6.1-rc1

Published by tulir about 5 years ago

  • Started ignoring invalid reply fallbacks sent by Riot web in edits
  • Added invalid reply fallbacks to edits
  • Added 100-character displayname limit to avoid synapse errors
  • Fixed one user's startup failing causing the bridge to crash (#292)
  • Fixed one portal's sync failing causing the whole sync to fail (#358)
telegram - v0.6.0

Published by tulir over 5 years ago

  • Fixed vulnerability in event handling

Added

  • Native Matrix edit support and new fallback format.
  • Config options for retry_delay and other TelegramClient constructor fields.
  • Config option for maximum document size to let through the bridge (#335).
  • External URL field for chat and private channel messages (#308).
  • Telegram user info (puppet displayname & avatar) is now updated every time the user sends a message.
  • Command to change Telegram displayname (#249).
  • Possibility to override config fields with environment variables (thanks to @pacien in #332).
  • Nested formatting is now supported by Telegram, so the bridge also supports it.

Improved

  • Simplified bridged poll message.
  • Telegram user info updates are now accepted from any logged in user as long as the logged in user doesn't see a phone number for the Telegram user.
  • Some image errors are now handled by resending the image as a document (#324).
  • Made getting started more user-friendly (#327).
  • Strikethrough and underline are now bridged into native Telegram formatting rather than unicode hacks.
  • Updated to Telethon 1.9.
  • Updated docker image to Alpine 3.10.

Fixed

  • Portal peer type not being saved in database after Telegram chat upgrade (#304).
  • Newlines in unformatted messages not being bridged when using relaybot (#306).
  • Mime type info field for stickers converted to PNG (#307).
  • Content after newlines being stripped in messages sent by some clients (#309).
  • Potential NoneType is not iterable exception when logging out (thanks to @turt2live in #315).
  • Handling of Matrix messages where m.relates_to is null (#317).
  • Internal server error when logging in with an account on another DC (#314).
  • Spaces between command and arguments are now trimmed (#322).
  • Vulnerability in event handling.
  • Changed migrations to use batch_alter_table for adding columns to have less warnings with SQLite.
  • Error when pinging without being logged in.
  • Terminating sessions with negative hashes.
  • State cache not being updated when sending events, causing invalid cache if the server doesn't echo the sent events (#278).
telegram - v0.6.0-rc2

Published by tulir over 5 years ago

  • Nested formatting is now supported by Telegram, so the bridge also supports it.
  • Strikethrough and underline are now bridged into native Telegram formatting rather than unicode hacks.
  • Fixed displayname not updating for users who the bridge only saw via a logged in user who had the problematic user in their contacts.
  • Fixed handling unsupported media.
  • Added handling for FileIdInvalidError in file transfers that could disrupt syncs.

Added

  • Native Matrix edit support and new fallback format.
  • Config options for retry_delay and other TelegramClient constructor fields.
  • Config option for maximum document size to let through the bridge (#335).
  • External URL field for chat and private channel messages (#308).
  • Telegram user info (puppet displayname & avatar) is now updated every time the user sends a message.
  • Command to change Telegram displayname (#249).
  • Possibility to override config fields with environment variables (thanks to @pacien in #332).
  • Nested formatting is now supported by Telegram, so the bridge also supports it.

Improved

  • Simplified bridged poll message.
  • Telegram user info updates are now accepted from any logged in user as long as the logged in user doesn't see a phone number for the Telegram user.
  • Some image errors are now handled by resending the image as a document (#324).
  • Made getting started more user-friendly (#327).
  • Strikethrough and underline are now bridged into native Telegram formatting rather than unicode hacks.
  • Updated to Telethon 1.9.
  • Updated docker image to Alpine 3.10.

Fixed

  • Portal peer type not being saved in database after Telegram chat upgrade (#304).
  • Newlines in unformatted messages not being bridged when using relaybot (#306).
  • Mime type info field for stickers converted to PNG (#307).
  • Content after newlines being stripped in messages sent by some clients (#309).
  • Potential NoneType is not iterable exception when logging out (thanks to @turt2live in #315).
  • Handling of Matrix messages where m.relates_to is null (#317).
  • Internal server error when logging in with an account on another DC (#314).
  • Spaces between command and arguments are now trimmed (#322).
  • Changed migrations to use batch_alter_table for adding columns to have less warnings with SQLite.
  • Error when pinging without being logged in.
  • Terminating sessions with negative hashes.
  • State cache not being updated when sending events, causing invalid cache if the server doesn't echo the sent events (#278).
telegram - v0.6.0-rc1

Published by tulir over 5 years ago

Added

  • Native Matrix edit support and new fallback format.
  • Config options for retry_delay and other TelegramClient constructor fields.
  • Config option for maximum document size to let through the bridge (#335).
  • External URL field for chat and private channel messages (#308).
  • Telegram user info (puppet displayname & avatar) is now updated every time the user sends a message.
  • Command to change Telegram displayname (#249).
  • Possibility to override config fields with environment variables (thanks to @pacien in #332)

Improved

  • Simplified bridged poll message.
  • Telegram user info updates are now accepted from any logged in user as long as the logged in user doesn't see a phone number for the Telegram user.
  • Some image errors are now handled by resending the image as a document (#324).
  • Made getting started more user-friendly (#327).
  • Updated to Telethon 1.8.

Fixed

  • Portal peer type not being saved in database after Telegram chat upgrade (#304).
  • Newlines in unformatted messages not being bridged when using relaybot (#306).
  • Mime type info field for stickers converted to PNG (#307).
  • Content after newlines being stripped in messages sent by some clients (#309).
  • Potential NoneType is not iterable exception when logging out (thanks to @turt2live in #315).
  • Handling of Matrix messages where m.relates_to is null (#317).
  • Internal server error when logging in with an account on another DC (#314).
  • Spaces between command and arguments are now trimmed (#322).
  • Changed migrations to use batch_alter_table for adding columns to have less warnings with SQLite.
  • Error when pinging without being logged in.
  • Terminating sessions with negative hashes.
  • State cache not being updated when sending events, causing invalid cache if the server doesn't echo the sent events (#278).
telegram - v0.5.2

Published by tulir over 5 years ago

  • Fixed null m.relates_to's that break Synapse 0.99.5
telegram - v0.5.1

Published by tulir over 5 years ago

  • Fixed Python 3.5 compatibility
  • Fixed DBMS migration script
telegram - v0.5.0

Published by tulir over 5 years ago

  • Replaced rawgit with cdnjs in public website as rawgit is deprecated (#289).
  • Fixed login command throwing error when web login is enabled (#300).
  • Updated telethon-session-sqlalchemy to fix logging into an account on another DC (#301).
  • Stopped adding reply fallback to caption when sending caption and image as separate messages (#285).

Added

  • More config options
    • Option to to use Telegram test servers.
    • Option to disable link previews on Telegram (#244).
    • Option to disable startup sync (#176).
    • Option to skip deleted members when syncing member lists (#192).
    • Option to change number of dialogs to handle in startup sync.
    • Option to set maximum size of image to send to Telegram (#141). Images above the size limit will be sent as documents without the compression Telegram applies to images.
  • More commands
    • username for setting Telegram username (#249).
    • sync-state for updating Matrix room state cache.
    • matrix-ping for checking Matrix login status (#270, thanks to @krombel).
    • clear-db-cache for clearing internal database caches.
    • reload-user for reloading and reconnecting a Telegram user.
    • session for listing and terminating other Telegram sessions.
    • Added argument to login to allow admins to log in for other users (#251).
  • Added warning when logging in that it grants the bridge full access to the telegram account (#248).
  • Added verbose flag to DBMS migration script.
  • Telegram->Matrix bridging
    • Telegram games (#256)
    • Telegram polls (#257)
    • Message pins in normal groups (#259)
    • Custom message for unsupported media like polls (#258)
  • Added client ID in logs when making requests to telegram (#265).
  • Added handling for Matrix room upgrades (#277).
  • Added pytest setup and some tests (thanks to @V02460)

Improved

  • Replaced lxml with native Python HTMLParser in the better Matrix->Telegram format converter and removed the old converter completely.
  • Stopped using SQLAlchemy ORM completely. This should speed things up and remove problems with the ORM getting stuck (#263).
  • ensure_started is now only called for logged in users, which should improve performance for large instances (#247).
  • Displayname template extras (e.g. the (Telegram) suffix) are now stripped when mentioning Telegram users with no username (#138).
  • Updated to Telethon 1.6.
  • Switched Dockerfile to use setup.py for dependencies to avoid dependency updates breaking stuff.
  • The telematrix import script will now warn about and skip over duplicate portals (#243).
  • Relaybot will now be used for users who have logged in, but are not in the chat (#205).
  • Replaced rawgit with cdnjs in public website as rawgit is deprecated (#289).
  • Stopped adding reply fallback to caption when sending caption and image as separate messages (#285).
  • New style for release notes that have release notes since two different versions (e.g. this release has "since v0.5.0-rc4" and "since v0.4.0") using <details> and <summary>.

Fixed

  • Bug where stickers with an unidentified emoji failed to bridge (#252).
  • Invalid letter prefixes in clean-rooms output.
  • Messages forwarded from channels showing up as "Unknown source" (#107).
  • Matrix->Telegram room avatar bridging (#165).
  • Telegram chat upgrade handling for relaybot (#283).
telegram - v0.5.0-rc4

Published by tulir over 5 years ago

  • Added verbose flag to migration script
  • Added pytest setup and some tests (thanks to @V02460)
  • Fixed scripts (DBMS migration and Telematrix import) not being included in builds
  • Fixed some database problems
  • Removed remaining traces of ORM that might have been the causes of some other database problems (#296)
  • Removed option to use lxml in HTML parsing as it was messing up emoji offset handling. The new HTML parser supports using the default python HTMLParser class since 0.5.0rc1, so lxml wasn't really useful anway.
telegram - v0.5.0-rc3

Published by tulir over 5 years ago

  • Fixed bridging documents without thumbnails to Matrix
  • Added option to set maximum size of image to send to Telegram (#141). Images above the size limit will be sent as documents without the compression Telegram applies to images.
  • Fixed saving user portals and contacts (#284)
  • Added Telegram -> Matrix poll bridging and a command to vote in polls (#257)
telegram - v0.5.0-rc2

Published by tulir over 5 years ago

  • Added missing future-fstrings comments that caused the bridge to not start on Python 3.5
  • Fixed handling of document thumbnails (#281)
  • Fixed private chat portals failing to be created (#282)
  • Made relaybot handle Telegram chat upgrade events (#283)
telegram - v0.5.0-rc1

Published by tulir over 5 years ago

Added

  • More config options
    • Option to to use Telegram test servers.
    • Option to disable link previews on Telegram (#244).
    • Option to disable startup sync (#176).
    • Option to skip deleted members when syncing member lists (#192).
    • Option to change number of dialogs to handle in startup sync.
  • More commands
    • username for setting Telegram username (#249).
    • sync-state for updating Matrix room state cache.
    • matrix-ping for checking Matrix login status (#270, thanks to @krombel).
    • clear-db-cache for clearing internal database caches.
    • reload-user for reloading and reconnecting a Telegram user.
    • session for listing and terminating other Telegram sessions.
    • Added argument to login to allow admins to log in for other users (#251).
  • Added warning when logging in that it grants the bridge full access to the telegram account (#248).
  • Telegram->Matrix bridging
    • Telegram games (#256)
    • Message pins in normal groups (#259)
    • Custom message for unsupported media like polls (#258)
  • Added client ID in logs when making requests to telegram (#265)
  • Added handling for Matrix room upgrades (#277)

Improved

  • Removed lxml dependency from the new HTML parser and removed the old parser completely.
  • Switched mautrix-appservice-python state store and most mautrix-telegram tables to SQLAlchemy core. This should speed things up and reduce problems with the ORM getting stuck (#263)
  • ensure_started is now only called for logged in users, which should improve performance for large instances (#247).
  • Displayname template extras (e.g. the (Telegram) suffix) are now stripped when mentioning Telegram users with no username (#138).
  • Updated Telethon.
  • Switched Dockerfile to use setup.py for dependencies to avoid dependency updates breaking stuff.
  • Stopped using SQLAlchemy ORM. This should reduce problems with the ORM becoming stuck after an invalid transaction (#263), which will remove fake stack traces and make it easier to find where the actual invalid transaction happened.
  • The telematrix import script will now warn about and skip over duplicate portals. (#243)
  • Relaybot will now be used for users who have logged in, but are not in the chat (#205)

Fixed

  • Bug where stickers with an unidentified emoji failed to bridge (#252).
  • Invalid letter prefixes in clean-rooms output.
  • Messages forwarded from channels showing up as "Unknown source" (#107)
  • Matrix->Telegram room avatar bridging (#165)
telegram - v0.4.0

Published by tulir almost 6 years ago

No changes since v0.4.0-rc2. Most of changelog in v0.4.0-rc1

telegram - v0.4.0-rc2

Published by tulir almost 6 years ago

Fixed

  • Kicking Telegram puppets from Matrix (#191)
telegram - v0.4.0-rc1

Published by tulir almost 6 years ago

Added

  • Flag to indicate if user can unbridge portal in provisioning API (#225, thanks to @turt2live).
  • Option to send captions as second message (replaces option to send caption in body, #233)
  • Room-specific settings (#167).

Improved

  • [Internal] Added type hints everywhere (mostly thanks to @V02460 in #206).
  • Telegram->Matrix formatter now uses <pre> tags for multiline code even if said code was in the telegram equivalent of inline code tags.
  • Better bullets and linebreak handling in Matrix->Telegram formatter.
  • Logging in will now show your phone number instead of @None if you don't have a username (#213).
  • Significantly improved performance on high-load instances (t2bot.io) by moving most used database tables to SQLAlchemy Core.

Fixed

  • Bugs that caused database migrations to fail in some cases.
  • Editing the config (e.g. whitelisting chats) corrupting the config (#216).
  • Negative numbers (chat IDs) in /connect of the provisioning API (#223, thanks to @turt2live).
  • Relaybot creating portals automatically when receiving message (#219).
  • Not being able to use a bridge bot localpart that would also match the puppet localpart format (#234).
  • Matrix login sync failing completely if the homeserver stopped during a sync response (#210).
  • Errors when cleaning rooms (#217).
  • Bridging code blocks without a language (#240)
  • Error and lost messages when trying to bridge PM from new users in some cases (#229)
  • Logging in with an account that someone has already logged in failing silently and then breaking the bridge (#198)
  • Relaybot message when adding/removing Matrix displaynames (#228)
telegram - v0.3.0

Published by tulir about 6 years ago

Changes since v0.3.0-rc3

  • Added database URI format examples
  • Bumped maximum Telethon version to 1.2, possibly fixing the catch_up option.

Changes since v0.2.0

Added

  • Logging in with a bot (see wiki for usage).
    • You can log in with a personal Telegram bot to appear almost like a real user without logging in with a real Telegram account.
  • Replacing your Telegram account's Matrix puppet with your Matrix account (see wiki for usage).
  • Formatting options for relaybot messages.
    • Real displaynames are now supported and enabled by default.
    • State events (join/leave/name change) can be independently disabled by setting the format to a blank string.
  • New config sections
    • Proper log config, including logging to file (by default)
    • Proxy support (requires installing PySocks)
    • Separate field for appservice address for homeserver (useful if using a reverse proxy).
    • Option to change max body size for AS API
  • New permission levels to allow initiating bridges without allowing puppeting and to allow Telegram puppeting without allowing Matrix puppeting.
  • Telematrix import script (see wiki for usage).
  • Provisioning API (see wiki for more info).
  • DBMS migration script (see wiki for usage).

Improved

  • Tabs are now replaced with 4 spaces so that Telegram servers wouldn't change the message.
  • Help page now detects your permissions and only shows commands you can use.
  • Moved Matrix state cache to the main database. This means that the mx-state.json file is no longer needed and all non-config data is stored in the main database.
  • Better lxml-based HTML parser for Matrix->Telegram formatting bridging. lxml is still optional, so the old parser is used as fallback if lxml is not installed.
  • Disabled Telegram->Matrix bridging of messages sent by the relaybot. Can be re-enabled in config if necessary.
  • Telegram message deduplication options
    • Added pre-send message database check for deduplication
    • Made dedup cache queue length configurable
  • Bumped minimum mautrix-appservice version to include some recent bugfixes
  • Bumped maximum Telethon version to 1.2, possibly fixing the catch_up option.

Fixed

  • A ValueError in some cases when syncing power levels.
  • A minor error regarding power level changes (thanks @turt2live)
  • Telegram connections being created for unauthenticated users possibly triggering spam protection connection delays in the Telegram servers.
  • Logging out if a portal had been deleted/unbridged.
telegram - v0.3.0-rc3

Published by tulir about 6 years ago

  • Improved Telegram message deduplication options
    • Added pre-send message database check for deduplication
    • Made dedup cache queue length configurable
telegram - v0.3.0-rc2

Published by tulir about 6 years ago

  • Added option to change max body size for AS API
  • Fixed a minor error regarding power level changes (thanks @turt2live)
  • Updated minimum mautrix-appservice version to include some recent bugfixes
telegram - v0.3.0-rc1

Published by tulir about 6 years ago

Added

  • Logging in with a bot (see wiki for usage).
    • You can log in with a personal Telegram bot to appear almost like a real user without logging in with a real Telegram account.
  • Replacing your Telegram account's Matrix puppet with your Matrix account (see wiki for usage).
  • Formatting options for relaybot messages.
    • Real displaynames are now supported and enabled by default.
    • State events (join/leave/name change) can be independently disabled by setting the format to a blank string.
  • New config sections
    • Proper log config, including logging to file (by default)
    • Proxy support (requires installing PySocks)
    • Separate field for appservice address for homeserver (useful if using a reverse proxy).
  • New permission levels to allow initiating bridges without allowing puppeting and to allow Telegram puppeting without allowing Matrix puppeting.
  • Telematrix import script (see wiki for usage).
  • Provisioning API (see wiki for more info).
  • DBMS migration script (see wiki for usage).

Improved

  • Tabs are now replaced with 4 spaces so that Telegram servers wouldn't change the message.
  • Help page now detects your permissions and only shows commands you can use.
  • Moved Matrix state cache to the main database. This means that the mx-state.json file is no longer needed and all non-config data is stored in the main database.
  • Better lxml-based HTML parser for Matrix->Telegram formatting bridging. lxml is still optional, so the old parser is used as fallback if lxml is not installed.
  • Disabled Telegram->Matrix bridging of messages sent by the relaybot. Can be re-enabled in config if necessary.

Fixed

  • A ValueError in some cases when syncing power levels.
  • Telegram connections being created for unauthenticated users possibly triggering spam protection connection delays in the Telegram servers.
  • Logging out if a portal had been deleted/unbridged.
telegram - v0.2.0

Published by tulir over 6 years ago

Changes since v0.1.1

  • Switched to AGPLv3

Added

  • Support for using a relay bot to relay messages for unauthenticated users.
  • Option to exclude telegram chats from being bridged.
  • Bridging for message pinning and room mentions/pills.
  • Matrix->Telegram sticker bridging.
  • !command to /command conversion at the start of Matrix message text.
  • Conversion of t.me message links to matrix.to message links
  • Timestamp massaging (bridge Telegram timestamps to Matrix)
  • Support for out-of-Matrix login (useful if you don't want your 2FA password to be stored in the homeserver)
  • Optional HQ gif/video thumbnails using moviepy.
  • Option to send bot messages as m.notice
  • Postgres compatibility
  • Dockerfile

Improved

  • Improved deduplication
    • Matrix file uploads are now reused if the same Telegram file (e.g. a sticker) is sent multiple times
    • Room metadata changes and other non-message actions are now deduplicated
  • Improved formatting bridging
  • Improved Telegram user display name handling in cases where one or more users have set custom display names for other users.
  • Switched to telethon-session-sqlalchemy to have the session databases in the main database.

Fixed

  • Fixed Alembic setup and removed automatic database generation.
  • Fixed outgoing message deduplication in cases where message is sent to other clients before responding to the sender.
  • Moved mautrix-appservice-python to a separate repository.
telegram - v0.2.0-rc6

Published by tulir over 6 years ago

  • Added warning about delete-portal kicking all room members
  • Fixed error when upgrading/creating SQLite database.