mautrix / telegram Goto Github PK
View Code? Open in Web Editor NEWA Matrix-Telegram hybrid puppeting/relaybot bridge
Home Page: https://matrix.to/#/#telegram:maunium.net
License: GNU Affero General Public License v3.0
A Matrix-Telegram hybrid puppeting/relaybot bridge
Home Page: https://matrix.to/#/#telegram:maunium.net
License: GNU Affero General Public License v3.0
Even if it successfully logs out, you can't log in again without clearing your user data.
Hi,
thanks for this awesome bridge.
So far it works really well for me, I just had some problems when initially logging in:
enter_code
command was not found (neither directly nor by login
), renaming it to entercode
worked.args[0]
in mautrix_telegram/commands.py#L133 contained only a space so something is wrong there.!delete-portal
so that the portal wont be recreated before a restart!delete-portal
and !unbridge
to make the no-recreate flag persistentMessages are duplicated a lot: If a portal room has multiple real Matrix users, messages from real Telegram users are duplicated for each real Matrix user. Messages from real Matrix users are also duplicated for each real Matrix user except for the sender.
Telegram doesn't have globally unique message IDs (only per-user unique IDs), so we have to figure out some other way to handle duplicate messages.
If #4 is implemented, we can use the bot as the primary source of information for all chats the bot has been added to. However, we'd still need to figure out how to avoid duplicates in chats without the bot.
<blockquote>
with >
for each line<del>
(strikethrough) and <u>
(underline)The HTML symbol (en|de)coding is difficult, since Telegram formatting uses character indices...
Will be good to have command for check current connection status to telegram (logged out, logged in and active, logged in and inactive / connection problem), something like ping
, that send some basic api command, wait reply and report status.
The help page doesn't look good, since it doesn't have any formatting. We should make it look nicer.
Riot has rich quotes in /develop, so after #24 is implemented, we should add two-way bridging of replies.
This would allows things like bidirectional reply bridging
If management commands are sent in a room without any other people, we should allow running management commands without the prefix.
This may be broken on the telegram-mtproto side.
Currently the bridge won't register such rooms as the private chats. When we implement this, we should also figure out how to handle multiple private rooms.
Private chat dialogs are a bit weird in Telegram and seem to appear and disappear randomly from messages.getDialogs
. Instead of automatic opening like groups and channels, we should allow the user to initiate private chats by either
!tg pm <user identifier>
. In this case, we'll need to figure out what kind of identifier to use to make it easy to initiate chats while minimizing ambiguity.'We should also automatically open the chat if there's no existing private chat open and the other person sends a message.
Unhandled service message of type messageActionChatJoinedByLink
{
"_": "messageActionChatJoinedByLink",
"inviter_id": ...
}
So I just found out that Telegram message IDs are even more messed up than I thought: Messages in private chats and normal groups have per-user unique IDs (different users see different IDs for the same message), but messages in channels/supergroups have per-channel unique IDs.
The per-channel unique IDs can conflict with the per-user unique IDs, which means that the current message ID mapping table is broken. Since primary keys can't be null, the composite primary key in the message table will probably have to be replaced with a composite unique key user
-channel
-message id
where either user
or channel
is null.
This also means that deduplication of channel messages is a lot easier than other types of chats.
This would make IRC bridging nicer.
We should allow creating Telegram groups using the management commands and/or by simply inviting users to a new room.
A bit like what matrix-puppet-bridge does, but just as an option that may make the user experience nicer.
Almost nothing supports webp, so we need to convert them to png to make them usable.
Having a bot would make getting started with the bridge easier, as users wouldn't have to log in with their Telegram account right away. It could also potentially help with message duplication problems.
i.e. add default values for config
Also, it might be a good idea to just have a numeric config version and warn if the config isn't at the latest version.
Only riot-web implements rich replies right now and the format is most likely going to change, so a non-native display option would be good
Currently message edits are just ignored, which is not good. A simple solution would be to display them as replies.
Power levels are currently bridged with preset values: In chats, 50 = admin and 95 = creator and in channels/supergroups 50 = moderator (admin who can't add other admins), 75 = admin and 95 = creator.
These values could be read from the power level requirements rather than using the hardcoded values. Also, the separate admin rights could be precisely bridged using the power level requirements.
The displaynames we get from the Telegram client API may be affected by the user who we're puppeting. AFAIK if the puppeted user has set a custom displayname for the target user, there's no way to get the real displayname that the target user has set themselves.
The duplicate portal creation will then probably cause SQL integrity errors and possibly other fun stuff.
Probably caused by multithreading. A simple patch might be to add new portals to the cache only after saving them to the database.
Avatar syncing is mostly disabled due to potential API call flooding. We should try to figure out a way to sync avatars when needed without causing flooding.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.