diff options
Diffstat (limited to 'lib/pleroma/web/ostatus')
-rw-r--r-- | lib/pleroma/web/ostatus/activity_representer.ex | 9 | ||||
-rw-r--r-- | lib/pleroma/web/ostatus/handlers/note_handler.ex | 22 |
2 files changed, 15 insertions, 16 deletions
diff --git a/lib/pleroma/web/ostatus/activity_representer.ex b/lib/pleroma/web/ostatus/activity_representer.ex index 2f28c456e..921a89bd0 100644 --- a/lib/pleroma/web/ostatus/activity_representer.ex +++ b/lib/pleroma/web/ostatus/activity_representer.ex @@ -131,7 +131,8 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do h.(activity.data["object"]["content"] |> String.replace(~r/[\n\r]/, ""))}, {:published, h.(inserted_at)}, {:updated, h.(updated_at)}, - {:"ostatus:conversation", [ref: h.(activity.data["context"])], h.(activity.data["context"])}, + {:"ostatus:conversation", [ref: h.(activity.data["context"])], + h.(activity.data["context"])}, {:link, [ref: h.(activity.data["context"]), rel: 'ostatus:conversation'], []} ] ++ summary ++ @@ -162,7 +163,8 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do # For notes, federate the object id. {:id, h.(activity.data["object"])} ]}, - {:"ostatus:conversation", [ref: h.(activity.data["context"])], h.(activity.data["context"])}, + {:"ostatus:conversation", [ref: h.(activity.data["context"])], + h.(activity.data["context"])}, {:link, [ref: h.(activity.data["context"]), rel: 'ostatus:conversation'], []}, {:link, [rel: 'self', type: ['application/atom+xml'], href: h.(activity.data["id"])], []}, {:"thr:in-reply-to", [ref: to_charlist(activity.data["object"])], []} @@ -193,7 +195,8 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do {:content, [type: 'html'], ['RT #{retweeted_activity.data["object"]["content"]}']}, {:published, h.(inserted_at)}, {:updated, h.(updated_at)}, - {:"ostatus:conversation", [ref: h.(activity.data["context"])], h.(activity.data["context"])}, + {:"ostatus:conversation", [ref: h.(activity.data["context"])], + h.(activity.data["context"])}, {:link, [ref: h.(activity.data["context"]), rel: 'ostatus:conversation'], []}, {:link, [rel: 'self', type: ['application/atom+xml'], href: h.(activity.data["id"])], []}, {:"activity:object", retweeted_xml} diff --git a/lib/pleroma/web/ostatus/handlers/note_handler.ex b/lib/pleroma/web/ostatus/handlers/note_handler.ex index b012abd51..bd6e92238 100644 --- a/lib/pleroma/web/ostatus/handlers/note_handler.ex +++ b/lib/pleroma/web/ostatus/handlers/note_handler.ex @@ -138,19 +138,15 @@ defmodule Pleroma.Web.OStatus.NoteHandler do do: note |> Map.put("inReplyTo", inReplyTo), else: note ) do - res = - ActivityPub.create(%{ - to: to, - actor: actor, - context: context, - object: note, - published: date, - local: false, - additional: %{"cc" => cc} - }) - - User.increase_note_count(actor) - res + ActivityPub.create(%{ + to: to, + actor: actor, + context: context, + object: note, + published: date, + local: false, + additional: %{"cc" => cc} + }) else %Activity{} = activity -> {:ok, activity} e -> {:error, e} |