logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: dd12cf7296566be206ca17044281ab2460fb7b9e
parent: 932e0e87db7b82574355e7ca38414c789f6e41ae
Author: Roger Braun <roger@rogerbraun.net>
Date:   Thu, 11 May 2017 17:59:11 +0200

Fix cws.

Diffstat:

Mlib/pleroma/user.ex6+++++-
Mlib/pleroma/web/ostatus/ostatus.ex8++++----
Atest/fixtures/cw_retweet.xml68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atest/fixtures/httpoison_mock/https___mamot.fr_users_Skruyb.atom342+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atest/fixtures/httpoison_mock/skruyb@mamot.fr.atom11+++++++++++
Mtest/support/httpoison_mock.ex14++++++++++++++
Mtest/web/ostatus/ostatus_test.exs13+++++++++++--
7 files changed, 455 insertions(+), 7 deletions(-)

diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex @@ -136,9 +136,13 @@ defmodule Pleroma.User do Enum.member?(follower.following, User.ap_followers(followed)) end + def get_by_ap_id(ap_id) do + Repo.get_by(User, ap_id: ap_id) + end + def get_cached_by_ap_id(ap_id) do key = "ap_id:#{ap_id}" - Cachex.get!(:user_cache, key, fallback: fn(_) -> Repo.get_by(User, ap_id: ap_id) end) + Cachex.get!(:user_cache, key, fallback: fn(_) -> get_by_ap_id(ap_id) end) end def get_cached_by_nickname(nickname) do diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex @@ -81,11 +81,11 @@ defmodule Pleroma.Web.OStatus do end def get_or_try_fetching(entry) do - Logger.debug("Trying to fetch entry") + Logger.debug("Trying to get entry from db") with id when not is_nil(id) <- string_from_xpath("//activity:object[1]/id", entry), %Activity{} = activity <- Activity.get_create_activity_by_object_ap_id(id) do {:ok, activity} - else _e -> + else e -> Logger.debug("Couldn't get, will try to fetch") with href when not is_nil(href) <- string_from_xpath("//activity:object[1]/link[@type=\"text/html\"]/@href", entry), {:ok, [favorited_activity]} <- fetch_activity_from_html_url(href) do @@ -126,7 +126,7 @@ defmodule Pleroma.Web.OStatus do base_content = string_from_xpath("//content", entry) with scope when not is_nil(scope) <- string_from_xpath("//mastodon:scope", entry), - cw when not is_nil(cw) <- string_from_xpath("//summary", entry) do + cw when not is_nil(cw) <- string_from_xpath("/*/summary", entry) do "<span class='mastodon-cw'>#{cw}</span><br>#{base_content}" else _e -> base_content end @@ -297,7 +297,7 @@ defmodule Pleroma.Web.OStatus do with {:ok, %{body: body}} <- @httpoison.get(url, [], follow_redirect: true), {:ok, atom_url} <- get_atom_url(body), {:ok, %{status_code: code, body: body}} when code in 200..299 <- @httpoison.get(atom_url, [], follow_redirect: true) do - Logger.debug("Got #{url}, handling...") + Logger.debug("Got document from #{url}, handling...") handle_incoming(body) else e -> Logger.debug("Couldn't get #{url}: #{inspect(e)}") end diff --git a/test/fixtures/cw_retweet.xml b/test/fixtures/cw_retweet.xml @@ -0,0 +1,68 @@ +<?xml version="1.0"?> +<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:media="http://purl.org/syndication/atommedia" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:mastodon="http://mastodon.social/schema/1.0"> + <id>https://mastodon.social/users/lambadalambda.atom</id> + <title>Critical Value</title> + <subtitle></subtitle> + <updated>2017-04-16T21:47:25Z</updated> + <logo>https://files.mastodon.social/accounts/avatars/000/000/264/original/1429214160519.gif</logo> + <author> + <id>https://mastodon.social/users/lambadalambda</id> + <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type> + <uri>https://mastodon.social/users/lambadalambda</uri> + <name>lambadalambda</name> + <email>lambadalambda@mastodon.social</email> + <link rel="alternate" type="text/html" href="https://mastodon.social/@lambadalambda"/> + <link rel="avatar" type="image/gif" media:width="120" media:height="120" href="https://files.mastodon.social/accounts/avatars/000/000/264/original/1429214160519.gif"/> + <link rel="header" type="" media:width="700" media:height="335" href="/headers/original/missing.png"/> + <poco:preferredUsername>lambadalambda</poco:preferredUsername> + <poco:displayName>Critical Value</poco:displayName> + <mastodon:scope>public</mastodon:scope> + </author> + <link rel="alternate" type="text/html" href="https://mastodon.social/@lambadalambda"/> + <link rel="self" type="application/atom+xml" href="https://mastodon.social/users/lambadalambda.atom"/> + <link rel="hub" href="https://mastodon.social/api/push"/> + <link rel="salmon" href="https://mastodon.social/api/salmon/264"/> + <entry> + <id>tag:mastodon.social,2017-05-11:objectId=5647963:objectType=Status</id> + <published>2017-05-11T10:23:15Z</published> + <updated>2017-05-11T10:23:15Z</updated> + <title>lambadalambda shared a status by Skruyb@mamot.fr</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/activity</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/share</activity:verb> + <activity:object> + <id>tag:mamot.fr,2017-05-10:objectId=1294943:objectType=Status</id> + <published>2017-05-10T17:31:44Z</published> + <updated>2017-05-10T17:31:45Z</updated> + <title>New status by Skruyb@mamot.fr</title> + <author> + <id>https://mamot.fr/users/Skruyb</id> + <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type> + <uri>https://mamot.fr/users/Skruyb</uri> + <name>Skruyb</name> + <email>Skruyb@mamot.fr</email> + <summary type="html">&lt;p&gt;Fr and En.&lt;br&gt;Posts will disappear on a regular basis.&lt;/p&gt;</summary> + <link rel="alternate" type="text/html" href="https://mamot.fr/@Skruyb"/> + <link rel="avatar" type="image/jpeg" media:width="120" media:height="120" href="https://files.mastodon.social/accounts/avatars/000/106/282/original/d95dbcfc76f77f4c.jpg"/> + <link rel="header" type="image/jpeg" media:width="700" media:height="335" href="https://files.mastodon.social/accounts/headers/000/106/282/original/c1aabdf5c97eb875.jpg"/> + <poco:preferredUsername>Skruyb</poco:preferredUsername> + <poco:displayName>The 7th Son</poco:displayName> + <poco:note>Fr and En.Posts will disappear on a regular basis.</poco:note> + <mastodon:scope>public</mastodon:scope> + </author> + <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <summary xml:lang="it">Hey.</summary> + <content type="html" xml:lang="it">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://mastodon.social/@lambadalambda"&gt;@&lt;span&gt;lambadalambda&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Hey!!!&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mastodon.social/users/lambadalambda"/> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176041"/> + <thr:in-reply-to ref="tag:mastodon.social,2017-05-10:objectId=5582979:objectType=Status" href="https://mastodon.social/@lambadalambda/5582979"/> + </activity:object> + <content type="html" xml:lang="en">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://mastodon.social/@lambadalambda"&gt;@&lt;span&gt;lambadalambda&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Hey!!!&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mastodon.social/users/lambadalambda/updates/2325225"/> + <link rel="self" type="application/atom+xml" href="https://mastodon.social/users/lambadalambda/updates/2325225.atom"/> + </entry> +</feed> diff --git a/test/fixtures/httpoison_mock/https___mamot.fr_users_Skruyb.atom b/test/fixtures/httpoison_mock/https___mamot.fr_users_Skruyb.atom @@ -0,0 +1,342 @@ +<?xml version="1.0"?> +<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:media="http://purl.org/syndication/atommedia" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:mastodon="http://mastodon.social/schema/1.0"> + <id>https://mamot.fr/users/Skruyb.atom</id> + <title>The 7th Son</title> + <subtitle>Fr and En. +Posts will disappear on a regular basis.</subtitle> + <updated>2017-04-28T13:54:23Z</updated> + <logo>https://mamot.fr/system/accounts/avatars/000/026/213/original/d95dbcfc76f77f4c.jpg?1493230984</logo> + <author> + <id>https://mamot.fr/users/Skruyb</id> + <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type> + <uri>https://mamot.fr/users/Skruyb</uri> + <name>Skruyb</name> + <email>Skruyb@mamot.fr</email> + <summary type="html">&lt;p&gt;Fr and En.&lt;br /&gt;Posts will disappear on a regular basis.&lt;/p&gt;</summary> + <link rel="alternate" type="text/html" href="https://mamot.fr/@Skruyb"/> + <link rel="avatar" type="image/jpeg" media:width="120" media:height="120" href="https://mamot.fr/system/accounts/avatars/000/026/213/original/d95dbcfc76f77f4c.jpg?1493230984"/> + <link rel="header" type="image/jpeg" media:width="700" media:height="335" href="https://mamot.fr/system/accounts/headers/000/026/213/original/c1aabdf5c97eb875.jpg?1492797601"/> + <poco:preferredUsername>Skruyb</poco:preferredUsername> + <poco:displayName>The 7th Son</poco:displayName> + <poco:note>Fr and En. +Posts will disappear on a regular basis.</poco:note> + <mastodon:scope>public</mastodon:scope> + </author> + <link rel="alternate" type="text/html" href="https://mamot.fr/@Skruyb"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb.atom"/> + <link rel="next" type="application/atom+xml" href="https://mamot.fr/users/Skruyb.atom?max_id=175878"/> + <link rel="hub" href="https://mamot.fr/api/push"/> + <link rel="salmon" href="https://mamot.fr/api/salmon/26213"/> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1299665:objectType=Status</id> + <published>2017-05-10T20:06:59Z</published> + <updated>2017-05-10T20:06:59Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="es">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://pouets.ovh/@noName" class="u-url mention"&gt;@&lt;span&gt;noName&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Pour comparer faut avoir tester... Ô wait!!! 😁&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://pouets.ovh/users/noName"/> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176780"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176780.atom"/> + <thr:in-reply-to ref="tag:pouets.ovh,2017-05-10:objectId=114198:objectType=Status" href="https://pouets.ovh/users/noName/updates/1174"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1299185:objectType=Status</id> + <published>2017-05-10T19:52:14Z</published> + <updated>2017-05-10T19:52:14Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://witches.town/@Dhveszak" class="u-url mention"&gt;@&lt;span&gt;Dhveszak&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Toi!! Tu vises le ministĂšre de la propagande avoue!!!!!!!&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://witches.town/users/Dhveszak"/> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176702"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176702.atom"/> + <thr:in-reply-to ref="tag:witches.town,2017-05-10:objectId=1439170:objectType=Status" href="https://witches.town/users/Dhveszak/updates/193318"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1299019:objectType=Status</id> + <published>2017-05-10T19:47:19Z</published> + <updated>2017-05-10T19:47:19Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;Facebook s&amp;apos;attaque aux sites internet &amp;quot;trompeurs&amp;quot;&lt;/p&gt;&lt;p&gt;&lt;a href="http://u.afp.com/4W4z" rel="nofollow noopener" target="_blank"&gt;&lt;span class="invisible"&gt;http://&lt;/span&gt;&lt;span class=""&gt;u.afp.com/4W4z&lt;/span&gt;&lt;span class="invisible"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;J&amp;apos;attends de voir que Facebook s&amp;apos;attaque Ă  lui mĂȘme... rien qu&amp;apos;Ă  lire leurs conditions gĂ©nĂ©rales d&amp;apos;utilisation, le respect de la vie privĂ©e...&lt;/p&gt;&lt;p&gt;CharitĂ© bien ordonnĂ©e... Parfois l&amp;apos;Ă©goĂŻsme aurait du bon.&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176668"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176668.atom"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1298889:objectType=Status</id> + <published>2017-05-10T19:43:18Z</published> + <updated>2017-05-10T19:43:18Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://octodon.social/@Balise" class="u-url mention"&gt;@&lt;span&gt;Balise&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Fait comme moi, annonce que tu fais dans le flou artistique et que seuls des esprits Ă©clairĂ©s pourront en percevoir la beautĂ© et apprĂ©cier. Globalement aprĂšs ça, tout le monde trouve les photos cool :-p&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://octodon.social/users/Balise"/> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176641"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176641.atom"/> + <thr:in-reply-to ref="tag:octodon.social,2017-05-10:objectId=1887380:objectType=Status" href="https://octodon.social/users/Balise/updates/115220"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1298728:objectType=Status</id> + <published>2017-05-10T19:38:39Z</published> + <updated>2017-05-10T19:38:39Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="ru">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://mastodon.social/@applecandy" class="u-url mention"&gt;@&lt;span&gt;applecandy&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Lucky you!!!&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mastodon.social/users/applecandy"/> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176608"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176608.atom"/> + <thr:in-reply-to ref="tag:mastodon.social,2017-05-10:objectId=5578123:objectType=Status" href="https://mastodon.social/users/applecandy/updates/2317372"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1298431:objectType=Status</id> + <published>2017-05-10T19:26:32Z</published> + <updated>2017-05-10T19:26:32Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;Est-ce que je suis le seul qui lorsqu&amp;apos;il commence Ă  compter les arbres sur le bord de la route n&amp;apos;arrive pas Ă  s&amp;apos;arrĂȘter de compter?&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176561"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176561.atom"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1298224:objectType=Status</id> + <published>2017-05-10T19:18:17Z</published> + <updated>2017-05-10T19:18:17Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;Ca y est j&amp;apos;ai une nouvelle passion. Mettre les bouchons qui trainent par terre dans le bons sens avec mon pied 🙌&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176536"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176536.atom"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1297450:objectType=Status</id> + <published>2017-05-10T18:53:37Z</published> + <updated>2017-05-10T18:53:37Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;Ok. On est capable d&amp;apos;envoyer des mecs dans l&amp;apos;espace, avoir des voitures autonomes, des trucs intelligents de partout mais pas tous les bĂątiments accessibles aux personnes Ă  mobilitĂ© rĂ©duite, les Ă©missions sur le services publics avec une personne faisant la traduction pour les sourds et malentendants de maniĂšre systĂ©matique...&lt;/p&gt;&lt;p&gt;J&amp;apos;ai du louper un truc dans l&amp;apos;ordre des prioritĂ©s Oo&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176412"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176412.atom"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1297292:objectType=Status</id> + <published>2017-05-10T18:48:17Z</published> + <updated>2017-05-10T18:48:17Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;J&amp;apos;ai comme envie de faire un truc mais je ne sais pas quoi mais pourtant c&amp;apos;est comme si je ressentais l&amp;apos;idĂ©e dans ma tĂȘte mais c&amp;apos;est pas clair...&lt;/p&gt;&lt;p&gt;Fuck!!! J&amp;apos;vais aller draguer Josiane Ă  la compta ça va me changer les idĂ©es!!!&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176387"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176387.atom"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1296598:objectType=Status</id> + <published>2017-05-10T18:25:11Z</published> + <updated>2017-05-10T18:25:11Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://mamot.fr/@Smeablog" class="u-url mention"&gt;@&lt;span&gt;Smeablog&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Pas faux MDR!!!!&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mamot.fr/users/Smeablog"/> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176320"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176320.atom"/> + <thr:in-reply-to ref="tag:mamot.fr,2017-05-10:objectId=1296591:objectType=Status" href="https://mamot.fr/@Smeablog/1296591"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1296571:objectType=Status</id> + <published>2017-05-10T18:24:13Z</published> + <updated>2017-05-10T18:24:13Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://mamot.fr/@Smeablog" class="u-url mention"&gt;@&lt;span&gt;Smeablog&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Ca ne change pas la finalitĂ© malheureusement, ça ne m&amp;apos;ouvre pas ce Ă  quoi je veux accĂ©der 😭&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mamot.fr/users/Smeablog"/> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176315"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176315.atom"/> + <thr:in-reply-to ref="tag:mamot.fr,2017-05-10:objectId=1296531:objectType=Status" href="https://mamot.fr/@Smeablog/1296531"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1296475:objectType=Status</id> + <published>2017-05-10T18:20:50Z</published> + <updated>2017-05-10T18:20:50Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;Arrrgghhhhhhh!!!!&lt;/p&gt;&lt;p&gt;Quand t&amp;apos;es sur le point de cliquer sur un lien dans le fil public global et que BOOM ça se met Ă  jour... J&amp;apos;ose mĂȘme pas imaginer combien j&amp;apos;ai ouvert de pages web sans le vouloir!!!&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176298"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176298.atom"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1296426:objectType=Status</id> + <published>2017-05-10T18:19:17Z</published> + <updated>2017-05-10T18:19:17Z</updated> + <title>Skruyb shared a status by Isaluini@mastodon.social</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/activity</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/share</activity:verb> + <activity:object> + <id>tag:mastodon.social,2017-05-10:objectId=5587049:objectType=Status</id> + <published>2017-05-10T18:18:59Z</published> + <updated>2017-05-10T18:19:00Z</updated> + <title>New status by Isaluini@mastodon.social</title> + <author> + <id>https://mastodon.social/users/Isaluini</id> + <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type> + <uri>https://mastodon.social/users/Isaluini</uri> + <name>Isaluini</name> + <email>Isaluini@mastodon.social</email> + <summary type="html">&lt;p&gt;Adicciones: Escribir, diseñar, cine, cafĂ©, humor negro, mĂșsica y dibujar. | Jedi. Bueno, no. AlgĂșn dĂ­a (?) | Gratitude.&lt;/p&gt;</summary> + <link rel="alternate" type="text/html" href="https://mastodon.social/@Isaluini"/> + <link rel="avatar" type="image/jpeg" media:width="120" media:height="120" href="https://mamot.fr/system/accounts/avatars/000/027/466/original/6c4659e795647240.jpg?1493580262"/> + <link rel="header" type="image/jpeg" media:width="700" media:height="335" href="https://mamot.fr/system/accounts/headers/000/027/466/original/608989b32a3efe1b.jpg?1493580262"/> + <poco:preferredUsername>Isaluini</poco:preferredUsername> + <poco:displayName>Isa</poco:displayName> + <poco:note>Adicciones: Escribir, diseñar, cine, cafĂ©, humor negro, mĂșsica y dibujar. | Jedi. Bueno, no. AlgĂșn dĂ­a (?) | Gratitude.</poco:note> + <mastodon:scope>public</mastodon:scope> + </author> + <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="ru">&lt;p&gt;♫ &lt;br&gt;&lt;a href="https://www.youtube.com/watch?v=pT68FS3YbQ4"&gt;&lt;span class="invisible"&gt;https://www.&lt;/span&gt;&lt;span class="ellipsis"&gt;youtube.com/watch?v=pT68FS3YbQ&lt;/span&gt;&lt;span class="invisible"&gt;4&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mastodon.social/users/Isaluini/updates/2318469"/> + </activity:object> + <content type="html" xml:lang="en">&lt;p&gt;♫ &lt;br&gt;&lt;a href="https://www.youtube.com/watch?v=pT68FS3YbQ4"&gt;&lt;span class="invisible"&gt;https://www.&lt;/span&gt;&lt;span class="ellipsis"&gt;youtube.com/watch?v=pT68FS3YbQ&lt;/span&gt;&lt;span class="invisible"&gt;4&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176292"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176292.atom"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1295893:objectType=Status</id> + <published>2017-05-10T18:01:51Z</published> + <updated>2017-05-10T18:01:51Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://mamot.fr/@Chat2Gouttieres" class="u-url mention"&gt;@&lt;span&gt;Chat2Gouttieres&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Ah bah aprĂšs faut savoir mettre Ă  profit ce savoir ^^&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mamot.fr/users/Chat2Gouttieres"/> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176203"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176203.atom"/> + <thr:in-reply-to ref="tag:mamot.fr,2017-05-10:objectId=1295869:objectType=Status" href="https://mamot.fr/@Chat2Gouttieres/1295869"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1295815:objectType=Status</id> + <published>2017-05-10T18:00:02Z</published> + <updated>2017-05-10T18:00:02Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://mamot.fr/@Chat2Gouttieres" class="u-url mention"&gt;@&lt;span&gt;Chat2Gouttieres&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Exactement. On a les jeux mais pas le pain encore.&lt;/p&gt;&lt;p&gt;Finalement on a rien inventĂ© :-p&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mamot.fr/users/Chat2Gouttieres"/> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176182"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176182.atom"/> + <thr:in-reply-to ref="tag:mamot.fr,2017-05-10:objectId=1295800:objectType=Status" href="https://mamot.fr/@Chat2Gouttieres/1295800"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1295778:objectType=Status</id> + <published>2017-05-10T17:58:52Z</published> + <updated>2017-05-10T17:58:52Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://mamot.fr/@Chat2Gouttieres" class="u-url mention"&gt;@&lt;span&gt;Chat2Gouttieres&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;C&amp;apos;est ça visiblement dans notre sociĂ©tĂ© dite moderne... &amp;quot;CrĂ©er l&amp;apos;illusion que&amp;quot; Oo.&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mamot.fr/users/Chat2Gouttieres"/> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176174"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176174.atom"/> + <thr:in-reply-to ref="tag:mamot.fr,2017-05-10:objectId=1295765:objectType=Status" href="https://mamot.fr/@Chat2Gouttieres/1295765"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1294943:objectType=Status</id> + <published>2017-05-10T17:31:44Z</published> + <updated>2017-05-10T17:31:44Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <summary xml:lang="it">Hey.</summary> + <content type="html" xml:lang="it">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://mastodon.social/@lambadalambda" class="u-url mention"&gt;@&lt;span&gt;lambadalambda&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Hey!!!&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mastodon.social/users/lambadalambda"/> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176041"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176041.atom"/> + <thr:in-reply-to ref="tag:mastodon.social,2017-05-10:objectId=5582979:objectType=Status" href="https://mastodon.social/users/lambadalambda/updates/2317991"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1294914:objectType=Status</id> + <published>2017-05-10T17:30:40Z</published> + <updated>2017-05-10T17:30:40Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://mamot.fr/@EloClemTiti" class="u-url mention"&gt;@&lt;span&gt;EloClemTiti&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;J&amp;apos;ai souvent cette impression en effet 😂&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mamot.fr/users/EloClemTiti"/> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176034"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/176034.atom"/> + <thr:in-reply-to ref="tag:mamot.fr,2017-05-10:objectId=1294608:objectType=Status" href="https://mamot.fr/@EloClemTiti/1294608"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1294148:objectType=Status</id> + <published>2017-05-10T17:02:01Z</published> + <updated>2017-05-10T17:02:01Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="fr">&lt;p&gt;Les gars, les boss veulent voir de l&amp;apos;avancement!! Une idĂ©e?&lt;/p&gt;&lt;p&gt;On fait comme d&amp;apos;habitude. On divise nos tĂąches en 25.000 tĂąches unitaires, on fout du vert au maximum et on crĂ©e l&amp;apos;illusion que ça a bien avancĂ©!&lt;/p&gt;&lt;p&gt;Deal!!&lt;/p&gt;&lt;p&gt;Bob, tu choisis quel vert on utilise&lt;br /&gt;Alice, t&amp;apos;es en charge de la typo&lt;br /&gt;Moi, je m&amp;apos;occupe qu&amp;apos;on prend bien le dernier template ppt fournit par la comm interne.&lt;/p&gt;&lt;p&gt;Des winners qu&amp;apos;on est!!!! Des WI-NNERS!!!&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/175898"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/175898.atom"/> + </entry> + <entry> + <id>tag:mamot.fr,2017-05-10:objectId=1293995:objectType=Status</id> + <published>2017-05-10T16:57:53Z</published> + <updated>2017-05-10T16:57:53Z</updated> + <title>New status by Skruyb</title> + <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> + <content type="html" xml:lang="ru">&lt;p&gt;&lt;span class="h-card"&gt;&lt;a href="https://mastodon.social/@SauceHair" class="u-url mention"&gt;@&lt;span&gt;SauceHair&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Cool!!&lt;/p&gt;&lt;p&gt;Bon courage.&lt;/p&gt;</content> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mastodon.social/users/SauceHair"/> + <link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/> + <mastodon:scope>public</mastodon:scope> + <link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/175878"/> + <link rel="self" type="application/atom+xml" href="https://mamot.fr/users/Skruyb/updates/175878.atom"/> + <thr:in-reply-to ref="tag:mastodon.social,2017-05-10:objectId=5579955:objectType=Status" href="https://mastodon.social/users/SauceHair/updates/2317615"/> + </entry> +</feed> diff --git a/test/fixtures/httpoison_mock/skruyb@mamot.fr.atom b/test/fixtures/httpoison_mock/skruyb@mamot.fr.atom @@ -0,0 +1,11 @@ +<?xml version="1.0"?> +<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"> + <Subject>acct:Skruyb@mamot.fr</Subject> + <Alias>https://mamot.fr/@Skruyb</Alias> + <Alias>https://mamot.fr/users/Skruyb</Alias> + <Link rel="http://webfinger.net/rel/profile-page" type="text/html" href="https://mamot.fr/@Skruyb"/> + <Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="https://mamot.fr/users/Skruyb.atom"/> + <Link rel="salmon" href="https://mamot.fr/api/salmon/26213"/> + <Link rel="magic-public-key" href="data:application/magic-public-key,RSA.oguRI4WsZfm-6wne1Y-_y8-8QmWFOrpqfyLemzc_bX-qCttWb-TXjZhE3iv-yg79i9qcJhCKvmTKwscJTcjr0Jp2KsGTLJrUodsR0zYAhYkugdv6EJHvbJVA0bXZKCk5XieGvBn-t7xQC5mclbEgQs58kY3cavJ70b5XFFAWeDloga9G3E2TMygnuzQ3oZlxBa6b3HzjY3RxB3bYirCZLV_bipPGHkI7xr7TDV7fnGTjRm9IUz6UOboixT5UIRvZ6EZ_rCJaMIFXj47bmwj74pxiNlughYpmSLhI0Ka7hofoYmZ7CbUEfBWIzfgEiB-SO99tACy8pDwyQ5d9P7pt0w==.AQAB"/> + <Link rel="http://ostatus.org/schema/1.0/subscribe" template="https://mamot.fr/authorize_follow?acct={uri}"/> +</XRD> diff --git a/test/support/httpoison_mock.ex b/test/support/httpoison_mock.ex @@ -135,6 +135,20 @@ defmodule HTTPoisonMock do }} end + def get("https://mamot.fr/.well-known/webfinger", [Accept: "application/xrd+xml"], [params: [resource: "https://mamot.fr/users/Skruyb"]]) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/skruyb@mamot.fr.atom") + }} + end + + def get("https://mamot.fr/users/Skruyb.atom", _, _) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/https___mamot.fr_users_Skruyb.atom") + }} + end + def get(url, body, headers) do {:error, "Not implemented the mock response for get #{inspect(url)}, #{inspect(body)}, #{inspect(headers)}"} end diff --git a/test/web/ostatus/ostatus_test.exs b/test/web/ostatus/ostatus_test.exs @@ -72,6 +72,13 @@ defmodule Pleroma.Web.OStatusTest do assert String.contains?(activity.data["object"]["content"], "technologic") end + test "handle incoming retweets - Mastodon, with CW" do + incoming = File.read!("test/fixtures/cw_retweet.xml") + {:ok, [[activity, retweeted_activity]]} = OStatus.handle_incoming(incoming) + + assert String.contains?(retweeted_activity.data["object"]["content"], "Hey.") + end + test "handle incoming notes - GS, subscription, reply" do incoming = File.read!("test/fixtures/ostatus_incoming_reply.xml") {:ok, [activity]} = OStatus.handle_incoming(incoming) @@ -99,6 +106,7 @@ defmodule Pleroma.Web.OStatusTest do refute retweeted_activity.local assert retweeted_activity.data["object"]["announcement_count"] == 1 assert String.contains?(retweeted_activity.data["object"]["content"], "mastodon") + refute String.contains?(retweeted_activity.data["object"]["content"], "Test account") end test "handle incoming retweets - GS, subscription - local message" do @@ -138,6 +146,7 @@ defmodule Pleroma.Web.OStatusTest do assert retweeted_activity.data["type"] == "Create" assert retweeted_activity.data["actor"] == "https://pleroma.soykaf.com/users/lain" refute retweeted_activity.local + refute String.contains?(retweeted_activity.data["object"]["content"], "Test account") end test "handle incoming favorites - GS, websub" do @@ -192,8 +201,8 @@ defmodule Pleroma.Web.OStatusTest do assert activity.data["object"] == "https://pawoo.net/users/pekorino" refute activity.local - follower = User.get_cached_by_ap_id(activity.data["actor"]) - followed = User.get_cached_by_ap_id(activity.data["object"]) + follower = User.get_by_ap_id(activity.data["actor"]) + followed = User.get_by_ap_id(activity.data["object"]) assert User.following?(follower, followed) end