X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fbbs%2Fhandler.ex;h=12d64c2fe2c982f2c09800bb9d5cb5871b5661bb;hb=ed08da9135e230ec67636a31f452c7ec31b9e79f;hp=0a381f5920c954517b3dfdf1a31bf022cb0b4601;hpb=ffb4eb9779ddd28ecee84c06e8dc58f4a4daaa38;p=akkoma
diff --git a/lib/pleroma/bbs/handler.ex b/lib/pleroma/bbs/handler.ex
index 0a381f592..12d64c2fe 100644
--- a/lib/pleroma/bbs/handler.ex
+++ b/lib/pleroma/bbs/handler.ex
@@ -1,10 +1,11 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.BBS.Handler do
use Sshd.ShellHandler
alias Pleroma.Activity
+ alias Pleroma.HTML
alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.CommonAPI
@@ -42,9 +43,9 @@ defmodule Pleroma.BBS.Handler do
end
def puts_activity(activity) do
- status = Pleroma.Web.MastodonAPI.StatusView.render("status.json", %{activity: activity})
+ status = Pleroma.Web.MastodonAPI.StatusView.render("show.json", %{activity: activity})
IO.puts("-- #{status.id} by #{status.account.display_name} (#{status.account.acct})")
- IO.puts(HtmlSanitizeEx.strip_tags(status.content))
+ IO.puts(HTML.strip_tags(status.content))
IO.puts("")
end
@@ -65,7 +66,7 @@ defmodule Pleroma.BBS.Handler do
with %Activity{} <- Activity.get_by_id(activity_id),
{:ok, _activity} <-
- CommonAPI.post(user, %{"status" => rest, "in_reply_to_status_id" => activity_id}) do
+ CommonAPI.post(user, %{status: rest, in_reply_to_status_id: activity_id}) do
IO.puts("Replied!")
else
_e -> IO.puts("Could not reply...")
@@ -77,7 +78,7 @@ defmodule Pleroma.BBS.Handler do
def handle_command(%{user: user} = state, "p " <> text) do
text = String.trim(text)
- with {:ok, _activity} <- CommonAPI.post(user, %{"status" => text}) do
+ with {:ok, _activity} <- CommonAPI.post(user, %{status: text}) do
IO.puts("Posted!")
else
_e -> IO.puts("Could not post...")
@@ -97,7 +98,7 @@ defmodule Pleroma.BBS.Handler do
|> Map.put("user", user)
activities =
- [user.ap_id | user.following]
+ [user.ap_id | Pleroma.User.following(user)]
|> ActivityPub.fetch_activities(params)
Enum.each(activities, fn activity ->