summaryrefslogtreecommitdiff
path: root/lib/irc/user_track.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irc/user_track.ex')
-rw-r--r--lib/irc/user_track.ex16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/irc/user_track.ex b/lib/irc/user_track.ex
index 1efa523..3f144d5 100644
--- a/lib/irc/user_track.ex
+++ b/lib/irc/user_track.ex
@@ -73,7 +73,7 @@ defmodule IRC.UserTrack do
end
end
- def find_by_account(%IRC.Account{id: id}) do
+ def find_by_account(%Nola.Account{id: id}) do
#iex(15)> :ets.fun2ms(fn(obj = {_, net, acct, _, _, _, _, _, _}) when net == network and acct == account -> obj end)
spec = [
{{:_, :_, :"$2", :_, :_, :_, :_, :_, :_, :_, :_, :_},
@@ -90,7 +90,7 @@ defmodule IRC.UserTrack do
nil
end
- def find_by_account(network, %IRC.Account{id: id}) do
+ def find_by_account(network, %Nola.Account{id: id}) do
#iex(15)> :ets.fun2ms(fn(obj = {_, net, acct, _, _, _, _, _, _}) when net == network and acct == account -> obj end)
spec = [
{{:_, :"$1", :"$2", :_, :_, :_, :_, :_, :_, :_, :_, :_},
@@ -178,7 +178,7 @@ defmodule IRC.UserTrack do
# TODO
def connected(network, nick, user, host, account_id, opts \\ %{}) do
- if account = IRC.Account.get(account_id) do
+ if account = Nola.Account.get(account_id) do
user = if user = find_by_nick(network, nick) do
user
else
@@ -207,7 +207,7 @@ defmodule IRC.UserTrack do
else
user = %User{id: IRC.UserTrack.Id.large_id, network: sender.network, nick: nick, username: uname, host: host, privileges: %{channel => privileges}}
- account = IRC.Account.lookup(user).id
+ account = Nola.Account.lookup(user).id
user = %User{user | account: account}
end
user = touch_struct(user, channel)
@@ -239,10 +239,10 @@ defmodule IRC.UserTrack do
def messaged(%IRC.Message{network: network, account: account, channel: chan, sender: %{nick: nick}} = m) do
{user, account} = if user = find_by_nick(network, nick) do
- {touch_struct(user, chan), account || IRC.Account.lookup(user)}
+ {touch_struct(user, chan), account || Nola.Account.lookup(user)}
else
user = %User{network: network, nick: nick, privileges: %{}}
- account = IRC.Account.lookup(user)
+ account = Nola.Account.lookup(user)
{%User{user | account: account.id}, account}
end
Storage.insert(User.to_tuple(user))
@@ -256,9 +256,9 @@ defmodule IRC.UserTrack do
def renamed(network, old_nick, new_nick) do
if user = find_by_nick(network, old_nick) do
- old_account = IRC.Account.lookup(user)
+ old_account = Nola.Account.lookup(user)
user = %User{user | nick: new_nick, nicks: [old_nick|user.nicks]}
- account = IRC.Account.lookup(user, false) || old_account
+ account = Nola.Account.lookup(user, false) || old_account
user = %User{user | nick: new_nick, account: account.id, nicks: [old_nick|user.nicks]}
Storage.insert(User.to_tuple(user))
channels = for {channel, _} <- user.privileges, do: channel