From b76b8c2800e993bfe5fa7f505279249058c01eec Mon Sep 17 00:00:00 2001 From: href Date: Wed, 1 Sep 2021 23:08:00 +0200 Subject: connection: fix crash with incomplete track_change --- lib/irc/connection.ex | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib') diff --git a/lib/irc/connection.ex b/lib/irc/connection.ex index bdcc658..3d27f93 100644 --- a/lib/irc/connection.ex +++ b/lib/irc/connection.ex @@ -454,6 +454,21 @@ defmodule IRC.Connection do :ok end + defp track_mode(network, channel, nick, "+v") do + IRC.UserTrack.change_privileges(network, channel, nick, {[:voice], []}) + :ok + end + + defp track_mode(network, channel, nick, "-v") do + IRC.UserTrack.change_privileges(network, channel, nick, {[], [:voice]}) + :ok + end + + defp track_mode(network, channel, nick, mode) do + Logger.warn("Unhandled track_mode: #{inspect {nick, mode}}") + :ok + end + defp server(%{conn: %{host: host, port: port}}) do host <> ":" <> to_string(port) end -- cgit v1.2.3