Support servers that reply error on any command before registration (thanks to Gelraen)
This makes mod_irc actually work with servers that reply with error on any command before the registration procedure is completed. Such servers, after NICK/USER they send PING and wait for client response. In such situation they reply with message 451 to CODEPAGE command, and mod_irc thinks that connection failed. Example IRC server that works thanks to the patch: irc.mibbit.com
This commit is contained in:
parent
f112df2cfc
commit
d673ff5fad
|
@ -132,8 +132,6 @@ open_socket(init, StateData) ->
|
|||
StateData#state.nick,
|
||||
StateData#state.host,
|
||||
StateData#state.nick])),
|
||||
send_text(NewStateData,
|
||||
io_lib:format("CODEPAGE ~s\r\n", [StateData#state.encoding])),
|
||||
{next_state, wait_for_registration,
|
||||
NewStateData};
|
||||
{error, Reason} ->
|
||||
|
@ -498,6 +496,8 @@ handle_info({ircstring, [$: | String]}, wait_for_registration, StateData) ->
|
|||
{NewState, NewStateData} =
|
||||
case Words of
|
||||
[_, "001" | _] ->
|
||||
send_text(StateData,
|
||||
io_lib:format("CODEPAGE ~s\r\n", [StateData#state.encoding])),
|
||||
{stream_established, StateData};
|
||||
[_, "433" | _] ->
|
||||
{error,
|
||||
|
|
Loading…
Reference in New Issue