erming / shout

Deprecated. See fork @ https://github.com/thelounge
MIT License
3.63k stars 273 forks source link

Delayed join / command-order #662

Open samboman opened 8 years ago

samboman commented 8 years ago

I have a list of Channels I auto join. And I have setup a commands-entry in the user configuration file to identify myself.

"commands": [
  "/msg NickServ identify my-pass"
],

The problem are channels that require registered nicks to join (eg. #openvpn on freenode). The commands seems to be sent after the join-commands.

//Sam

samboman commented 8 years ago

I simply fixed this by using: "password": "my-pass"

Maybe a better solution!

//Sam

erming commented 8 years ago

Glad to hear you solved it!

Just remember that the password property is not the same as NickServ identify. And to make sure that commands property wasn't broken, I tried using

"commands": ["/msg #chan test"]

and that worked for me.

dgw commented 8 years ago

I think the issue wasn't so much commands not being sent as it was commands being sent too late. The client tries to join channels before the command to identify with NickServ is sent, and thus is denied joining channels that require the use of a registered nickname.

samboman commented 8 years ago

@erming Yes, it worked for me... The command worked:

"commands": ["/msg NickServ identify my-pass"]

But as @dgw commented, its a timing issue... Joins happens before Identify are done. Is there a /msg wait 1000ms command to delay?

Like having:

"commands": ["/msg NickServ identify my-pass",
  "/wait 1000",
  "/join #authenticatedChan"]
erming commented 8 years ago

@dgw is right.

However, there is already a 1000ms delay in place, but maybe it's not enough. The code for running commands and joining channels can be found here: https://github.com/erming/shout/blob/master/src/client.js#L196

@samboman if you put everything in commands (but remove /wait 1000), does that work?

samboman commented 8 years ago

@erming No, it does not work: "commands": ["/msg NickServ identify my-pass", "/join #authenticatedChan"] It seems to fire off the commands to quick... Before they are finished.