diff options
-rw-r--r-- | config/config.exs | 41 | ||||
-rw-r--r-- | lib/lsg_web/live/chat_live.ex | 10 | ||||
-rw-r--r-- | lib/lsg_web/live/chat_live.html.heex | 6 | ||||
-rw-r--r-- | priv/static/assets/alcoolog.js.gz | bin | 44 -> 44 bytes | |||
-rw-r--r-- | priv/static/assets/site.css.gz | bin | 9187 -> 9187 bytes | |||
-rw-r--r-- | priv/static/assets/site.js.gz | bin | 68949 -> 68949 bytes |
6 files changed, 10 insertions, 47 deletions
diff --git a/config/config.exs b/config/config.exs index 9a3633e..8a1faa6 100644 --- a/config/config.exs +++ b/config/config.exs @@ -10,13 +10,16 @@ config :logger, :console, format: "$date $time [$level$levelpad] $metadata$message\n", metadata: :all +config :phoenix, :json_library, Jason + # General application configuration config :lsg, namespace: LSG config :lsg, :data_path, "priv" -config :lsg, :icecast_poll_interval, 600_000 +config :lsg, :irc, + name: "ircbot" config :ex_aws, region: "us-east-1", @@ -33,46 +36,12 @@ config :lsg, LSGWeb.Endpoint, secret_key_base: "cAFb7x2p/D7PdV8/C6Os18uygoD0FVQh3efNEFc5+5L529q3dofZtZye/BG12MRZ", render_errors: [view: LSGWeb.ErrorView, accepts: ~w(html json)], server: true, + live_view: [signing_salt: "CHANGE_ME_FFS"], pubsub: [name: LSG.PubSub, adapter: Phoenix.PubSub.PG2] config :mime, :types, %{"text/event-stream" => ["sse"]} -# THIS IS NOT USED ANYMORE! -# XXX: Make sure it is not used anymore and remove.. -config :lsg, :irc, - name: "irc bot", - handlers: [ - LSG.IRC.AdminHandler, - #LSG.IRC.BroadcastHandler, - #LSG.IRC.NpHandler, - ], - plugins: [ - LSG.IRC.BasePlugin, - LSG.IRC.TxtPlugin, - LSG.IRC.CalcPlugin, - LSG.IRC.DicePlugin, - LSG.IRC.YouTubePlugin, - LSG.IRC.WikipediaPlugin, - LSG.IRC.KickRoulettePlugin, - LSG.IRC.AlcoolismePlugin, - LSG.IRC.QuatreCentVingtPlugin, - LSG.IRC.LastFmPlugin, - LSG.IRC.LinkPlugin, - LSG.IRC.OutlinePlugin, - LSG.IRC.StocksPlugin - ] - #admins: [ - # # Format is {nick, user, host}. :_ for any value. - #] - #irc: [ - # host: "irc.", - # port: 6667, - # nick: "`115ans", - # user: "115ans", - # name: "https://sys.115ans.net/irc" - #] - config :lsg, LSG.IRC.LastFmHandler, api_key: "x", api_secret: "x" diff --git a/lib/lsg_web/live/chat_live.ex b/lib/lsg_web/live/chat_live.ex index a2b4c13..d736d72 100644 --- a/lib/lsg_web/live/chat_live.ex +++ b/lib/lsg_web/live/chat_live.ex @@ -22,6 +22,8 @@ defmodule LSGWeb.ChatLive do Map.put(acc, id, user) end) + {backlog, _} = LSG.IRC.BufferPlugin.select_buffer(connection.network, chan) + socket = socket |> assign(:connection_id, connection.id) |> assign(:network, connection.network) @@ -29,7 +31,7 @@ defmodule LSGWeb.ChatLive do |> assign(:title, "live") |> assign(:channel, chan) |> assign(:account_id, account.id) - |> assign(:backlog, []) + |> assign(:backlog, Enum.reverse(backlog)) |> assign(:users, users) |> assign(:counter, 0) @@ -47,17 +49,11 @@ defmodule LSGWeb.ChatLive do def handle_info({:irc, :event, event = %{type: :join, user_id: id}}, socket) do if user = IRC.UserTrack.lookup(id) do - IO.puts("JOIN USER JOIN USER JOIN USER") - socket = socket |> assign(:users, Map.put(socket.assigns.users, id, user)) |> assign(:backlog, socket.assigns.backlog ++ [event]) - - IO.inspect(socket.assigns.users) - {:noreply, socket} else - IO.puts("\n\n\n?!\n\n\n?!\n\n\n\n") {:noreply, socket} end end diff --git a/lib/lsg_web/live/chat_live.html.heex b/lib/lsg_web/live/chat_live.html.heex index 01d8b3a..717be4f 100644 --- a/lib/lsg_web/live/chat_live.html.heex +++ b/lib/lsg_web/live/chat_live.html.heex @@ -15,14 +15,12 @@ <div class="body"> <div class="log"> - <%= if Enum.empty?(@backlog) do %> <p class="disconnected text-center text-6xl tracking-tight font-extrabold text-red-800 w-full my-24 mx-auto overflow-y-auto"> - Disconnected + Disconnected <span class="text-mono">:'(</span> </p> <p class="phx-errored text-center text-6xl tracking-tight font-extrabold text-red-800 w-full my-24 mx-auto overflow-y-auto"> - Oh no error + Oh no error <span class="text-mono">>:(</span> </p> - <% end %> <ul class="pt-4 pl-4"> <%= for message <- @backlog do %> diff --git a/priv/static/assets/alcoolog.js.gz b/priv/static/assets/alcoolog.js.gz Binary files differindex 95c3f94..6ac0ce5 100644 --- a/priv/static/assets/alcoolog.js.gz +++ b/priv/static/assets/alcoolog.js.gz diff --git a/priv/static/assets/site.css.gz b/priv/static/assets/site.css.gz Binary files differindex f9dd920..351fbbf 100644 --- a/priv/static/assets/site.css.gz +++ b/priv/static/assets/site.css.gz diff --git a/priv/static/assets/site.js.gz b/priv/static/assets/site.js.gz Binary files differindex 5e0bb00..b6c539e 100644 --- a/priv/static/assets/site.js.gz +++ b/priv/static/assets/site.js.gz |