From 75687711f35355bc30e4829439384aab28fcac6d Mon Sep 17 00:00:00 2001 From: href Date: Wed, 1 Sep 2021 10:30:18 +0200 Subject: Commit all the changes that hasn't been committed + updates. --- lib/irc/connection.ex | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/irc/connection.ex') 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 -- cgit v1.2.3