projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
HTML: Compile Scrubbers on boot
[akkoma]
/
lib
/
pleroma
/
bbs
/
handler.ex
diff --git
a/lib/pleroma/bbs/handler.ex
b/lib/pleroma/bbs/handler.ex
index 1ebba77d26dedcff578959c03546a08772b77d79..054d422b04101b7fe6932822d394582fce5a4858 100644
(file)
--- a/
lib/pleroma/bbs/handler.ex
+++ b/
lib/pleroma/bbs/handler.ex
@@
-1,16
+1,17
@@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.BBS.Handler do
defmodule Pleroma.BBS.Handler do
- @moduledoc """
- An example implementation of `Sshd.ShellHandler`, implementing a very simple
- Read-Eval-Loop, that does nothing.
- """
use Sshd.ShellHandler
use Sshd.ShellHandler
- alias Pleroma.Web.CommonAPI
- alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Activity
alias Pleroma.Activity
+ alias Pleroma.HTML
+ alias Pleroma.Web.ActivityPub.ActivityPub
+ alias Pleroma.Web.CommonAPI
def on_shell(username, _pubkey, _ip, _port) do
:ok = IO.puts("Welcome to #{Pleroma.Config.get([:instance, :name])}!")
def on_shell(username, _pubkey, _ip, _port) do
:ok = IO.puts("Welcome to #{Pleroma.Config.get([:instance, :name])}!")
- user = Pleroma.User.get_by_nickname(to_string(username))
+ user = Pleroma.User.get_
cached_
by_nickname(to_string(username))
Logger.debug("#{inspect(user)}")
loop(run_state(user: user))
end
Logger.debug("#{inspect(user)}")
loop(run_state(user: user))
end
@@
-42,9
+43,9
@@
defmodule Pleroma.BBS.Handler do
end
def puts_activity(activity) do
end
def puts_activity(activity) do
- status = Pleroma.Web.MastodonAPI.StatusView.render("s
tatus
.json", %{activity: activity})
+ status = Pleroma.Web.MastodonAPI.StatusView.render("s
how
.json", %{activity: activity})
IO.puts("-- #{status.id} by #{status.account.display_name} (#{status.account.acct})")
IO.puts("-- #{status.id} by #{status.account.display_name} (#{status.account.acct})")
- IO.puts(H
tmlSanitizeEx
.strip_tags(status.content))
+ IO.puts(H
TML
.strip_tags(status.content))
IO.puts("")
end
IO.puts("")
end
@@
-97,9
+98,8
@@
defmodule Pleroma.BBS.Handler do
|> Map.put("user", user)
activities =
|> Map.put("user", user)
activities =
- [user.ap_id |
user.following
]
+ [user.ap_id |
Pleroma.User.following(user)
]
|> ActivityPub.fetch_activities(params)
|> ActivityPub.fetch_activities(params)
- |> ActivityPub.contain_timeline(user)
Enum.each(activities, fn activity ->
puts_activity(activity)
Enum.each(activities, fn activity ->
puts_activity(activity)