diff options
Diffstat (limited to 'lib/irc/membership.ex')
-rw-r--r-- | lib/irc/membership.ex | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/irc/membership.ex b/lib/irc/membership.ex index b727dfd..25a0cfc 100644 --- a/lib/irc/membership.ex +++ b/lib/irc/membership.ex @@ -19,7 +19,7 @@ defmodule IRC.Membership do {:ok, dets} end - def of_account(%IRC.Account{id: id}) do + def of_account(%Nola.Account{id: id}) do spec = [{{{:"$1", :"$2", :"$3"}, :_}, [{:==, :"$1", {:const, id}}], [{{:"$2", :"$3"}}]}] :dets.select(dets(), spec) end @@ -33,11 +33,11 @@ defmodule IRC.Membership do end) end - def touch(%IRC.Account{id: id}, network, channel) do + def touch(%Nola.Account{id: id}, network, channel) do :dets.insert(dets(), {{id, network, channel}, NaiveDateTime.utc_now()}) end def touch(account_id, network, channel) do - if account = IRC.Account.get(account_id) do + if account = Nola.Account.get(account_id) do touch(account, network, channel) end end @@ -91,7 +91,7 @@ defmodule IRC.Membership do :dets.select(dets(), spec) end - def friends(account = %IRC.Account{id: id}) do + def friends(account = %Nola.Account{id: id}) do for({net, chan} <- of_account(account), do: members(net, chan)) |> List.flatten() |> Enum.uniq() @@ -116,7 +116,7 @@ defmodule IRC.Membership do defp expand(network, list) do for id <- list do - if account = IRC.Account.get(id) do + if account = Nola.Account.get(id) do user = IRC.UserTrack.find_by_account(network, account) nick = if(user, do: user.nick, else: account.name) {account, user, nick} |