aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2018-10-25 04:04:04 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2018-10-25 04:04:04 +0000
commit1ed25c963a69d0f4cabcb7adfed0739af82d1f32 (patch)
tree66cb530eba4f60c4c6dd6abc971bfd8b0ad18c34 /lib
parent1b480e351405a4f987e0ba21bfe845cef7ff36de (diff)
downloadpleroma-1ed25c963a69d0f4cabcb7adfed0739af82d1f32.tar.gz
twitterapi: activity view: add the other in_reply_to fields
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/twitter_api/representers/activity_representer.ex12
-rw-r--r--lib/pleroma/web/twitter_api/views/activity_view.ex12
2 files changed, 10 insertions, 14 deletions
diff --git a/lib/pleroma/web/twitter_api/representers/activity_representer.ex b/lib/pleroma/web/twitter_api/representers/activity_representer.ex
index 04857001c..fbd33f07e 100644
--- a/lib/pleroma/web/twitter_api/representers/activity_representer.ex
+++ b/lib/pleroma/web/twitter_api/representers/activity_representer.ex
@@ -182,12 +182,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
reply_parent = Activity.get_in_reply_to_activity(activity)
- reply_user_nickname =
- if reply_parent do
- User.get_cached_by_ap_id(reply_parent.actor).nickname
- else
- nil
- end
+ reply_user = reply_parent && User.get_cached_by_ap_id(reply_parent.actor)
%{
"id" => activity.id,
@@ -199,7 +194,10 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
"is_post_verb" => true,
"created_at" => created_at,
"in_reply_to_status_id" => object["inReplyToStatusId"],
- "in_reply_to_screen_name" => reply_user_nickname,
+ "in_reply_to_screen_name" => reply_user && reply_user.nickname,
+ "in_reply_to_profileurl" => User.profile_url(reply_user),
+ "in_reply_to_ostatus_uri" => reply_user && reply_user.ap_id,
+ "in_reply_to_user_id" => reply_user && reply_user.id,
"statusnet_conversation_id" => conversation_id,
"attachments" => attachments |> ObjectRepresenter.enum_to_list(opts),
"attentions" => attentions,
diff --git a/lib/pleroma/web/twitter_api/views/activity_view.ex b/lib/pleroma/web/twitter_api/views/activity_view.ex
index 13fb04f95..fb97f199b 100644
--- a/lib/pleroma/web/twitter_api/views/activity_view.ex
+++ b/lib/pleroma/web/twitter_api/views/activity_view.ex
@@ -238,12 +238,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
reply_parent = Activity.get_in_reply_to_activity(activity)
- reply_user_nickname =
- if reply_parent do
- User.get_cached_by_ap_id(reply_parent.actor).nickname
- else
- nil
- end
+ reply_user = reply_parent && User.get_cached_by_ap_id(reply_parent.actor)
%{
"id" => activity.id,
@@ -255,7 +250,10 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
"is_post_verb" => true,
"created_at" => created_at,
"in_reply_to_status_id" => object["inReplyToStatusId"],
- "in_reply_to_screen_name" => reply_user_nickname,
+ "in_reply_to_screen_name" => reply_user && reply_user.nickname,
+ "in_reply_to_profileurl" => User.profile_url(reply_user),
+ "in_reply_to_ostatus_uri" => reply_user && reply_user.ap_id,
+ "in_reply_to_user_id" => reply_user && reply_user.id,
"statusnet_conversation_id" => conversation_id,
"attachments" => (object["attachment"] || []) |> ObjectRepresenter.enum_to_list(opts),
"attentions" => attentions,