Commit fee43ae5 authored by kaniini's avatar kaniini
Browse files

twitterapi: activity view: implement in_reply_to_screen_name using the new graph walking helper

parent f3f736af
......@@ -180,6 +180,15 @@ def to_map(
attachments = (object["attachment"] || []) ++ video
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
%{
"id" => activity.id,
"uri" => activity.data["object"]["id"],
......@@ -190,6 +199,7 @@ def to_map(
"is_post_verb" => true,
"created_at" => created_at,
"in_reply_to_status_id" => object["inReplyToStatusId"],
"in_reply_to_screen_name" => reply_user_nickname,
"statusnet_conversation_id" => conversation_id,
"attachments" => attachments |> ObjectRepresenter.enum_to_list(opts),
"attentions" => attentions,
......
......@@ -236,6 +236,15 @@ def render(
HTML.filter_tags(content, User.html_filter_policy(opts[:for]))
|> Formatter.emojify(object["emoji"])
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
%{
"id" => activity.id,
"uri" => activity.data["object"]["id"],
......@@ -246,6 +255,7 @@ def render(
"is_post_verb" => true,
"created_at" => created_at,
"in_reply_to_status_id" => object["inReplyToStatusId"],
"in_reply_to_screen_name" => reply_user_nickname,
"statusnet_conversation_id" => conversation_id,
"attachments" => (object["attachment"] || []) |> ObjectRepresenter.enum_to_list(opts),
"attentions" => attentions,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment