From d2a1cb541d55eba6997a8c6e9e4be0465ed95408 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Fri, 17 Jul 2020 22:14:40 -0700 Subject: [PATCH] Change message routing logic to be an implication instead of AND Previously, a message wouldn't be admitted if it didn't have a prefix, (logical) AND if the message was equal to the bot's nickname. Now, a message with a blank prefix passes through, but if the prefix is the bot's nickname, it does not. Signed-off-by: Alek Ratzloff --- lib/irc/irc.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/irc/irc.ex b/lib/irc/irc.ex index 4438aca..504fd99 100644 --- a/lib/irc/irc.ex +++ b/lib/irc/irc.ex @@ -77,7 +77,7 @@ defmodule Omnibot.Irc do msg = Msg.parse(line) # Send the message to the router - if msg.prefix && (msg.prefix.nick != State.cfg().nick) do + if (!msg.prefix) || (msg.prefix.nick != State.cfg().nick) do route_msg(self(), msg) end {:noreply, socket}