diff options
author | href <href@random.sh> | 2021-09-01 10:30:18 +0200 |
---|---|---|
committer | href <href@random.sh> | 2021-09-01 10:30:18 +0200 |
commit | 75687711f35355bc30e4829439384aab28fcac6d (patch) | |
tree | 8f3256f472893c39720a684d390e890a152f7303 /lib/irc/connection.ex | |
parent | link: post_* callbacks; html & pdftitle. (diff) |
Commit all the changes that hasn't been committed + updates.
Diffstat (limited to 'lib/irc/connection.ex')
-rw-r--r-- | lib/irc/connection.ex | 11 |
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 |