projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4b2a586
)
activity: add helper to fetch an activity's parent
author
William Pitcock
<nenolod@dereferenced.org>
Thu, 25 Oct 2018 02:47:55 +0000
(
02:47
+0000)
committer
William Pitcock
<nenolod@dereferenced.org>
Thu, 25 Oct 2018 02:47:55 +0000
(
02:47
+0000)
lib/pleroma/activity.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/activity.ex
b/lib/pleroma/activity.ex
index bed96861f893043f8651401fb6cc268aa91c2d5a..c065f3b6ce690a688ead5a087135f46e44f13ba8 100644
(file)
--- a/
lib/pleroma/activity.ex
+++ b/
lib/pleroma/activity.ex
@@
-82,4
+82,10
@@
defmodule Pleroma.Activity do
def normalize(obj) when is_map(obj), do: Activity.get_by_ap_id(obj["id"])
def normalize(ap_id) when is_binary(ap_id), do: Activity.get_by_ap_id(ap_id)
def normalize(_), do: nil
+
+ def get_in_reply_to_activity(%Activity{data: %{"object" => %{"inReplyTo" => ap_id}}}) do
+ get_create_activity_by_object_ap_id(ap_id)
+ end
+
+ def get_in_reply_to_activity(_), do: nil
end