RITlug / teleirc

Go implementation of a Telegram <=> IRC bridge for use with any IRC channel and Telegram group
https://docs.teleirc.com/
GNU General Public License v3.0
141 stars 45 forks source link

RELAYMSG support when supported by the IRCd #373

Open Mikaela opened 3 years ago

Mikaela commented 3 years ago

Summary

https://github.com/ircv3/ircv3-specifications/pull/417 as implemented by Ergo IRCd and an InspIRCd module would allow more native (and prettier) feel for Telegram users when they are relayed to IRC.

Background

Currently messages from Telegram users appear like <teleirc> <telegramuser> hello world, this is a message from Telegram, this isn't very pleasing and at times confuses people who then start speaking to nickname teleirc instead of telegramuser.

Describe the solution you'd like:

Supporting RELAYMSG would instead make Telegram users look something like <telegramuser/tg> hello world, this is a message from Telegram with their only differences to IRC user being the / and not appearing in the channel user list.

Describe alternatives you've considered:

One method would be making ghost users matching all Telegram users, but this would take resources to manage all the IRC connections, hit connection limits of IRC server very quickly and annoy the IRC network operators.

Details

In practice I think TeleIRC should look at capabilities provided by the IRC network during capability negotiation and if it sees draft/relaymsg=/ (where / is a sign required to separate RELAYMSG'd users from real IRC users), it should switch from using PRIVMSG #ircchannel :<telegramuser> message from Telegram into RELAYMSG #ircchannel telegramuser/tg :message from Telegram (where the / was seen during capability negotiation).

RELAYMSG also requires that the bot has channel op mode +o to help prevent abuse.

Outcome

Telegram users look nicer to IRC users making modern IRC is more friendly towards everyone unused to seeing relaybots 🎉