summaryrefslogtreecommitdiff
path: root/lib/irc/connection.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irc/connection.ex')
-rw-r--r--lib/irc/connection.ex11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/irc/connection.ex b/lib/irc/connection.ex
index d115d88..b83c4d3 100644
--- a/lib/irc/connection.ex
+++ b/lib/irc/connection.ex
@@ -211,13 +211,13 @@ defmodule IRC.Connection do
else
Logger.info("Connecting")
{:ok, client} = ExIRC.Client.start_link(debug: false)
+ ExIRC.Client.add_handler(client, self())
client
end
- ExIRC.Client.add_handler(client, self())
if state.conn.tls do
- ExIRC.Client.connect_ssl!(client, state.conn.host, state.conn.port)
+ ExIRC.Client.connect_ssl!(client, state.conn.host, state.conn.port, [])#[{:ifaddr, {45,150,150,33}}])
else
- ExIRC.Client.connect!(client, state.conn.host, state.conn.port)
+ ExIRC.Client.connect!(client, state.conn.host, state.conn.port, [])#[{:ifaddr, {45,150,150,33}}])
end
{:noreply, %{state | client: client}}
end
@@ -241,8 +241,9 @@ defmodule IRC.Connection do
# Connection successful
def handle_info({:connected, server, port}, state) do
Logger.info("#{inspect(self())} Connected to #{server}:#{port} #{inspect state}")
+ {_, backoff} = :backoff.succeed(state.backoff)
ExIRC.Client.logon(state.client, state.conn.pass || "", state.conn.nick, state.conn.user, state.conn.name)
- {:noreply, state}
+ {:noreply, %{state | backoff: backoff}}
end
# Logon successful
@@ -344,7 +345,7 @@ defmodule IRC.Connection do
end
def handle_info({:parted, channel, %ExIRC.SenderInfo{nick: nick}}, state) do
- IRC.UserTrack.parted(channel, nick)
+ IRC.UserTrack.parted(network(state), channel, nick)
{:noreply, state}
end