Commit 1ed25c96 authored by kaniini's avatar kaniini
Browse files

twitterapi: activity view: add the other in_reply_to fields

parent 1b480e35
......@@ -182,12 +182,7 @@ def to_map(
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 @@ 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,
"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,
......
......@@ -238,12 +238,7 @@ def render(
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 @@ 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,
"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,
......
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