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
135 stars 46 forks source link

Cannot join registration-required channels #398

Open half-duplex opened 2 years ago

half-duplex commented 2 years ago

Summary

TeleIRC fails to join channels with +R (registration required) mode.

Standard debugging steps

How to reproduce?

  1. Create an IRC channel and set mode +R
  2. Create and configure a NickServ account for the bot
  3. Configure the bot to join your test channel
  4. Start the bot
  5. Note that the bot has not joined the channel

Expected behavior

Bot should have joined the channel, or at least logged an error.

Logs

Bot log ``` INFO: 2022/04/26 01:32:34 Current TeleIRC version: DEBUG: 2022/04/26 01:32:34 Debug mode enabled! INFO: 2022/04/26 01:32:34 Creating new Telegram bot client... INFO: 2022/04/26 01:32:34 Creating new IRC bot client... INFO: 2022/04/26 01:32:34 Starting up Telegram bot... INFO: 2022/04/26 01:32:34 Starting up IRC bot... DEBUG: 2022/04/26 01:32:34 Adding IRC event handler: JOIN DEBUG: 2022/04/26 01:32:34 Adding IRC event handler: KICK DEBUG: 2022/04/26 01:32:34 Adding IRC event handler: PRIVMSG DEBUG: 2022/04/26 01:32:34 Adding IRC event handler: PART DEBUG: 2022/04/26 01:32:34 Adding IRC event handler: QUIT DEBUG: 2022/04/26 01:32:34 Adding IRC event handler: CLIENT_CONNECTED DEBUG: 2022/04/26 01:32:34 Adding IRC event handler: CLIENT_DISCONNECTED INFO: 2022/04/26 01:32:35 Authorized on account bos2600bridgebot DEBUG: 2022/04/26 01:32:37 connectHandler triggered ``` (Version is 2.2.0 compiled from git tag)
IRC pcap ``` CAP LS 302 NICK bostg USER BosTG * * :Telegram bridge run by mal for #boston2600 :cornelius.scuttled.net NOTICE * :*** Looking up your hostname :cornelius.scuttled.net NOTICE * :*** Checking Ident :cornelius.scuttled.net NOTICE * :*** No Ident response :cornelius.scuttled.net NOTICE * :*** Found your hostname :cornelius.scuttled.net CAP * LS :account-notify away-notify chghost extended-join invite-notify multi-prefix userhost-in-names CAP REQ :extended-join invite-notify multi-prefix userhost-in-names account-notify away-notify chghost :cornelius.scuttled.net CAP bostg ACK :account-notify away-notify chghost extended-join invite-notify multi-prefix userhost-in-names CAP END :cornelius.scuttled.net 001 bostg :Welcome to the 2600net Internet Relay Chat Network bostg!~BosTG@nova.sec.gd :cornelius.scuttled.net 002 bostg :Your host is cornelius.scuttled.net[2a00:dd80:3c::f6a/6667], running version hybrid-8.2.31 :cornelius.scuttled.net 003 bostg :This server was created Jul 13 2020 at 12:20:44 :cornelius.scuttled.net 004 bostg cornelius.scuttled.net hybrid-8.2.31 DFGHXRSWabcdefgijklnopqrsuwy bchiklmnoprstuveCILMNORST bkloveIh :cornelius.scuttled.net 005 bostg CALLERID CASEMAPPING=ascii DEAF=D KICKLEN=180 MODES=6 PREFIX=(ohv)@%+ STATUSMSG=@%+ EXCEPTS INVEX NICKLEN=15 NETWORK=2600net MAXLIST=beI:100 MAXTARGETS=4 :are supported by this server :cornelius.scuttled.net 005 bostg CHANTYPES=# CHANLIMIT=#:25 CHANNELLEN=50 TOPICLEN=300 CHANMODES=beI,k,l,cimnprstuCLMNORST EXTBAN=$,acjmnorsuz WATCH=30 ELIST=CMNTU SAFELIST KNOCK AWAYLEN=180 :are supported by this server [snip] :cornelius.scuttled.net 376 bostg :End of /MOTD command. :bostg!~BosTG@nova.sec.gd MODE bostg :+i :NickServ!services@services.2600.net NOTICE bostg :This nickname is registered and protected. If it is your :NickServ!services@services.2600.net NOTICE bostg :nick, type ./msg NickServ IDENTIFY .password... Otherwise, :NickServ!services@services.2600.net NOTICE bostg :please choose a different nick. JOIN #boston2600 :cornelius.scuttled.net 477 bostg #boston2600 :You need to identify to a registered nick to join or speak in that channel. ```

Other details

It seems like the bot, instead of authenticating and then joining, is joining then authenticating.

I haven't tested this on a network that supports SASL PLAIN, I'm not sure if it would work there or not.

half-duplex commented 2 years ago

Actually. I just realized it's not authenticating even when it's able to join. Does it not know how to PRIVMSG NickServ at all?

jwflory commented 2 years ago

Just curious. What is the IRC server and what software is it using the power the network? I wonder if this differs significantly from Libera.Chat. I almost exclusively test on Libera.Chat and not other IRC networks.

half-duplex commented 2 years ago

cornelius.scuttled.net/6697, hybrid-8.2.31(20200503_9370) - I wouldn't be surprised if hybrid supports SASL PLAIN, but it's not currently enabled.