basic reconnection logic

master
Rachel Fae Fox (foxiepaws) 2020-07-17 14:18:09 -04:00
parent 08d41aa70f
commit 5c22f69953
1 changed files with 10 additions and 0 deletions

View File

@ -114,6 +114,16 @@ defmodule Discordirc.IRC do
{:noreply, state}
end
def handle_info(:disconnected, state) do
if state.ssl? do
Client.connect_ssl!(state.client, state.server, state.port)
else
Client.connect!(state.client, state.server, state.port)
end
{:noreply, state}
end
def handle_info(_event, state) do
{:noreply, state}
end