summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex6
-rw-r--r--lib/pleroma/web/router.ex1
-rw-r--r--lib/pleroma/web/twitter_api/representers/activity_representer.ex2
-rw-r--r--lib/pleroma/web/twitter_api/twitter_api.ex2
-rw-r--r--lib/pleroma/web/twitter_api/twitter_api_controller.ex2
5 files changed, 10 insertions, 3 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index ec9c5e970..75e4101f2 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -54,6 +54,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
query = from activity in query,
where: activity.id > ^since_id
+ query = if opts["max_id"] do
+ from activity in query, where: activity.id < ^opts["max_id"]
+ else
+ query
+ end
+
Repo.all(query)
|> Enum.reverse
end
diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex
index 66dcbb118..3c560349f 100644
--- a/lib/pleroma/web/router.ex
+++ b/lib/pleroma/web/router.ex
@@ -30,6 +30,7 @@ defmodule Pleroma.Web.Router do
scope "/api", Pleroma.Web do
pipe_through :authenticated_api
+ get "/account/verify_credentials", TwitterAPI.Controller, :verify_credentials
post "/account/verify_credentials", TwitterAPI.Controller, :verify_credentials
post "/statuses/update", TwitterAPI.Controller, :status_update
get "/statuses/home_timeline", TwitterAPI.Controller, :friends_timeline
diff --git a/lib/pleroma/web/twitter_api/representers/activity_representer.ex b/lib/pleroma/web/twitter_api/representers/activity_representer.ex
index 5fe0df359..b0dd85bbb 100644
--- a/lib/pleroma/web/twitter_api/representers/activity_representer.ex
+++ b/lib/pleroma/web/twitter_api/representers/activity_representer.ex
@@ -33,7 +33,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
"user" => UserRepresenter.to_map(user, opts),
"attentions" => [],
"statusnet_html" => content,
- "text" => content,
+ "text" => HtmlSanitizeEx.strip_tags(content),
"is_local" => true,
"is_post_verb" => true,
"created_at" => published,
diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex
index 0a942e880..0217b28d6 100644
--- a/lib/pleroma/web/twitter_api/twitter_api.ex
+++ b/lib/pleroma/web/twitter_api/twitter_api.ex
@@ -69,7 +69,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
end
def fetch_friend_statuses(user, opts \\ %{}) do
- ActivityPub.fetch_activities(user.following, opts)
+ ActivityPub.fetch_activities([user.ap_id | user.following], opts)
|> activities_to_statuses(%{for: user})
end
diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex
index f2c893e96..c3a58b63a 100644
--- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex
+++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex
@@ -44,7 +44,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
end
def follow(%{assigns: %{user: user}} = conn, %{ "user_id" => followed_id }) do
- { :ok, _user, follower, _activity } = TwitterAPI.follow(user, followed_id)
+ { :ok, user, follower, _activity } = TwitterAPI.follow(user, followed_id)
response = follower |> UserRepresenter.to_json(%{for: user})