summaryrefslogtreecommitdiff
path: root/lib/web/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'lib/web/controllers')
-rw-r--r--lib/web/controllers/alcoolog_controller.ex16
-rw-r--r--lib/web/controllers/irc_controller.ex2
-rw-r--r--lib/web/controllers/page_controller.ex2
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/web/controllers/alcoolog_controller.ex b/lib/web/controllers/alcoolog_controller.ex
index dc09517..6337da5 100644
--- a/lib/web/controllers/alcoolog_controller.ex
+++ b/lib/web/controllers/alcoolog_controller.ex
@@ -19,7 +19,7 @@ defmodule NolaWeb.AlcoologController do
def nick(conn = %{assigns: %{account: account}}, params = %{"network" => network, "nick" => nick}) do
profile_account = Nola.Account.find_always_by_nick(network, nick, nick)
days = String.to_integer(Map.get(params, "days", "180"))
- friend? = Enum.member?(IRC.Membership.friends(account), profile_account.id)
+ friend? = Enum.member?(Nola.Membership.friends(account), profile_account.id)
if friend? do
stats = Nola.Plugins.Alcoolog.get_full_statistics(profile_account.id)
history = for {{nick, ts}, points, active, cl, deg, type, descr, meta} <- Nola.Plugins.Alcoolog.nick_history(profile_account) do
@@ -48,7 +48,7 @@ defmodule NolaWeb.AlcoologController do
def nick_stats_json(conn = %{assigns: %{account: account}}, params = %{"network" => network, "nick" => nick}) do
profile_account = Nola.Account.find_always_by_nick(network, nick, nick)
- friend? = Enum.member?(IRC.Membership.friends(account), profile_account.id)
+ friend? = Enum.member?(Nola.Membership.friends(account), profile_account.id)
if friend? do
stats = Nola.Plugins.Alcoolog.get_full_statistics(profile_account.id)
@@ -64,7 +64,7 @@ defmodule NolaWeb.AlcoologController do
def nick_gls_json(conn = %{assigns: %{account: account}}, params = %{"network" => network, "nick" => nick}) do
profile_account = Nola.Account.find_always_by_nick(network, nick, nick)
- friend? = Enum.member?(IRC.Membership.friends(account), profile_account.id)
+ friend? = Enum.member?(Nola.Membership.friends(account), profile_account.id)
count = String.to_integer(Map.get(params, "days", "180"))
if friend? do
data = Nola.Plugins.Alcoolog.user_over_time_gl(profile_account, count)
@@ -98,7 +98,7 @@ defmodule NolaWeb.AlcoologController do
def nick_volumes_json(conn = %{assigns: %{account: account}}, params = %{"network" => network, "nick" => nick}) do
profile_account = Nola.Account.find_always_by_nick(network, nick, nick)
- friend? = Enum.member?(IRC.Membership.friends(account), profile_account.id)
+ friend? = Enum.member?(Nola.Membership.friends(account), profile_account.id)
count = String.to_integer(Map.get(params, "days", "180"))
if friend? do
data = Nola.Plugins.Alcoolog.user_over_time(profile_account, count)
@@ -130,7 +130,7 @@ defmodule NolaWeb.AlcoologController do
def nick_log_json(conn = %{assigns: %{account: account}}, %{"network" => network, "nick" => nick}) do
profile_account = Nola.Account.find_always_by_nick(network, nick, nick)
- friend? = Enum.member?(IRC.Membership.friends(account), profile_account.id)
+ friend? = Enum.member?(Nola.Membership.friends(account), profile_account.id)
if friend? do
history = for {{nick, ts}, points, active, cl, deg, type, descr, meta} <- Nola.Plugins.Alcoolog.nick_history(profile_account) do
%{
@@ -161,7 +161,7 @@ defmodule NolaWeb.AlcoologController do
def nick_history_json(conn = %{assigns: %{account: account}}, %{"network" => network, "nick" => nick}) do
profile_account = Nola.Account.find_always_by_nick(network, nick, nick)
- friend? = Enum.member?(IRC.Membership.friends(account), profile_account.id)
+ friend? = Enum.member?(Nola.Membership.friends(account), profile_account.id)
if friend? do
history = for {_, date, value} <- Nola.Plugs.AlcoologAnnouncer.log(profile_account) do
%{date: DateTime.to_iso8601(date), value: value}
@@ -220,7 +220,7 @@ defmodule NolaWeb.AlcoologController do
]
# tuple ets: {{nick, date}, volumes, current, nom, commentaire}
- members = IRC.Membership.expanded_members_or_friends(account, network, channel)
+ members = Nola.Membership.expanded_members_or_friends(account, network, channel)
members_ids = Enum.map(members, fn({account, _, nick}) -> account.id end)
member_names = Enum.reduce(members, %{}, fn({account, _, nick}, acc) -> Map.put(acc, account.id, nick) end)
drinks = :ets.select(Nola.Plugins.Alcoolog.ETS, match)
@@ -246,7 +246,7 @@ defmodule NolaWeb.AlcoologController do
def index_gls_json(conn = %{assigns: %{account: account}}, %{"network" => network, "chan" => channel}) do
count = 30
channel = NolaWeb.reformat_chan(channel)
- members = IRC.Membership.expanded_members_or_friends(account, network, channel)
+ members = Nola.Membership.expanded_members_or_friends(account, network, channel)
members_ids = Enum.map(members, fn({account, _, nick}) -> account.id end)
member_names = Enum.reduce(members, %{}, fn({account, _, nick}, acc) -> Map.put(acc, account.id, nick) end)
delay = count*((24 * 60)*60)
diff --git a/lib/web/controllers/irc_controller.ex b/lib/web/controllers/irc_controller.ex
index d6114e6..441cbe7 100644
--- a/lib/web/controllers/irc_controller.ex
+++ b/lib/web/controllers/irc_controller.ex
@@ -17,7 +17,7 @@ defmodule NolaWeb.IrcController do
members = cond do
network && channel -> Enum.map(IRC.UserTrack.channel(network, channel), fn(tuple) -> IRC.UserTrack.User.from_tuple(tuple) end)
true ->
- IRC.Membership.of_account(conn.assigns.account)
+ Nola.Membership.of_account(conn.assigns.account)
end
render conn, "index.html", network: network, commands: commands, channel: channel, members: members
end
diff --git a/lib/web/controllers/page_controller.ex b/lib/web/controllers/page_controller.ex
index c5d0a57..a6b85b6 100644
--- a/lib/web/controllers/page_controller.ex
+++ b/lib/web/controllers/page_controller.ex
@@ -23,7 +23,7 @@ defmodule NolaWeb.PageController do
end
def index(conn = %{assigns: %{account: account}}, _) do
- memberships = IRC.Membership.of_account(account)
+ memberships = Nola.Membership.of_account(account)
users = IRC.UserTrack.find_by_account(account)
metas = Nola.Account.get_all_meta(account)
predicates = Nola.Account.get_predicates(account)