summaryrefslogtreecommitdiff
path: root/lib/irc/connection.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irc/connection.ex')
-rw-r--r--lib/irc/connection.ex32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/irc/connection.ex b/lib/irc/connection.ex
index 49f5774..9bb09ed 100644
--- a/lib/irc/connection.ex
+++ b/lib/irc/connection.ex
@@ -264,7 +264,7 @@ defmodule IRC.Connection do
# ISUP
def handle_info({:isup, network}, state) when is_binary(network) do
- IRC.UserTrack.clear_network(state.network)
+ Nola.UserTrack.clear_network(state.network)
if network != state.network do
Logger.warn("Possibly misconfigured network: #{network} != #{state.network}")
end
@@ -279,11 +279,11 @@ defmodule IRC.Connection do
# Received something in a channel
def handle_info({:received, text, sender, chan}, state) do
- user = if user = IRC.UserTrack.find_by_nick(state.network, sender.nick) do
+ user = if user = Nola.UserTrack.find_by_nick(state.network, sender.nick) do
user
else
Logger.error("Could not lookup user for message: #{inspect {state.network, chan, sender.nick}}")
- user = IRC.UserTrack.joined(chan, sender, [])
+ user = Nola.UserTrack.joined(chan, sender, [])
ExIRC.Client.who(state.client, chan) # Rewho everything in case of need ? We shouldn't not know that user..
user
end
@@ -297,7 +297,7 @@ defmodule IRC.Connection do
message = %IRC.Message{id: FlakeId.get(), transport: :irc, at: NaiveDateTime.utc_now(), text: text, network: state.network,
account: account, sender: sender, channel: chan, replyfun: reply_fun,
trigger: extract_trigger(text)}
- message = case IRC.UserTrack.messaged(message) do
+ message = case Nola.UserTrack.messaged(message) do
:ok -> message
{:ok, message} -> message
end
@@ -313,7 +313,7 @@ defmodule IRC.Connection do
account = Nola.Account.lookup(sender)
message = %IRC.Message{id: FlakeId.get(), transport: :irc, text: text, network: state.network, at: NaiveDateTime.utc_now(),
account: account, sender: sender, replyfun: reply_fun, trigger: extract_trigger(text)}
- message = case IRC.UserTrack.messaged(message) do
+ message = case Nola.UserTrack.messaged(message) do
:ok -> message
{:ok, message} -> message
end
@@ -324,7 +324,7 @@ defmodule IRC.Connection do
## -- Broadcast
def handle_info({:broadcast, net, account = %Nola.Account{}, message}, state) do
if net == state.conn.network do
- user = IRC.UserTrack.find_by_account(net, account)
+ user = Nola.UserTrack.find_by_account(net, account)
if user do
irc_reply(state, {user.nick, nil}, message)
end
@@ -349,7 +349,7 @@ defmodule IRC.Connection do
accounts = Enum.map(whos, fn(who = %ExIRC.Who{nick: nick, operator?: operator}) ->
priv = if operator, do: [:operator], else: []
# Don't touch -- on WHO the bot joined, not the users.
- IRC.UserTrack.joined(channel, who, priv, false)
+ Nola.UserTrack.joined(channel, who, priv, false)
account = Nola.Account.lookup(who)
if account do
{:account, who.network, channel, who.nick, account.id}
@@ -361,12 +361,12 @@ defmodule IRC.Connection do
end
def handle_info({:quit, reason, sender}, state) do
- IRC.UserTrack.quitted(sender, reason)
+ Nola.UserTrack.quitted(sender, reason)
{:noreply, state}
end
def handle_info({:joined, channel, sender}, state) do
- IRC.UserTrack.joined(channel, sender, [])
+ Nola.UserTrack.joined(channel, sender, [])
account = Nola.Account.lookup(sender)
if account do
dispatch("account", {:account, sender.network, channel, sender.nick, account.id})
@@ -375,12 +375,12 @@ defmodule IRC.Connection do
end
def handle_info({:kicked, nick, _by, channel, _reason}, state) do
- IRC.UserTrack.parted(state.network, channel, nick)
+ Nola.UserTrack.parted(state.network, channel, nick)
{:noreply, state}
end
def handle_info({:parted, channel, %ExIRC.SenderInfo{nick: nick}}, state) do
- IRC.UserTrack.parted(state.network, channel, nick)
+ Nola.UserTrack.parted(state.network, channel, nick)
{:noreply, state}
end
@@ -390,7 +390,7 @@ defmodule IRC.Connection do
end
def handle_info({:nick_changed, old_nick, new_nick}, state) do
- IRC.UserTrack.renamed(state.network, old_nick, new_nick)
+ Nola.UserTrack.renamed(state.network, old_nick, new_nick)
{:noreply, state}
end
@@ -490,22 +490,22 @@ defmodule IRC.Connection do
end
defp track_mode(network, channel, nick, "+o") do
- IRC.UserTrack.change_privileges(network, channel, nick, {[:operator], []})
+ Nola.UserTrack.change_privileges(network, channel, nick, {[:operator], []})
:ok
end
defp track_mode(network, channel, nick, "-o") do
- IRC.UserTrack.change_privileges(network, channel, nick, {[], [:operator]})
+ Nola.UserTrack.change_privileges(network, channel, nick, {[], [:operator]})
:ok
end
defp track_mode(network, channel, nick, "+v") do
- IRC.UserTrack.change_privileges(network, channel, nick, {[:voice], []})
+ Nola.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]})
+ Nola.UserTrack.change_privileges(network, channel, nick, {[], [:voice]})
:ok
end