jt3k / chat-linker

the bridge between jabber and telegram over chat-bots
MIT License
46 stars 9 forks source link

better XMPP integration #28

Open oxpa opened 7 years ago

oxpa commented 7 years ago

Current implementation uses single account to send all messages. I propose changing this behaviour by using multiple connections into a single conference in XMPP with resources matching telegram user names. (e.g. js@c.j.r/username)

So if you have a chat of user1, user2, user3 you should join javascript@conferences.domain.tld three times with nicknames (and from resources) of /user1, /user2, /user3 and send messages from appropriate resource.

On a nick collision add some prefix or suffix.

Later this may be reworked to create a service when the bot can link two chatroom of different networks by a user command.

ForNeVeR commented 7 years ago

First of all, I think that the titular better XMPP integration should be done. You propose a viable solution, but currently I'd vote against that particular solution.

@vitalyster told me about that "component" thing (see XEP-0114). It seems that we can make our bot into a component. That way it'll be authoritative for sending presences on behalf of <username>@telegram.example.com, so it'll be possible to send activity presences and messages from Telegram users to any XMPP server.

I think that we should conduct additional research and go that component way instead of inventing poor ad-hoc solutions for the problem.