aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2011-06-28 23:04:12 +0200
committerBadlop <badlop@process-one.net>2011-06-28 23:04:12 +0200
commitd673ff5fad72660bbc87e2d5295b448dd7f65c8e (patch)
tree7235a49abae38329bdfba45e76961354f96d315c /src
parentComment in the cfg file the correct node name used in ejabberdctl.template (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/mod_irc/mod_irc_connection.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mod_irc/mod_irc_connection.erl b/src/mod_irc/mod_irc_connection.erl
index c342f2877..62abd0556 100644
--- a/src/mod_irc/mod_irc_connection.erl
+++ b/src/mod_irc/mod_irc_connection.erl
@@ -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,