mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-22 17:27:18 +00:00
Fix cws.
This commit is contained in:
parent
932e0e87db
commit
dd12cf7296
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
68
test/fixtures/cw_retweet.xml
vendored
Normal file
68
test/fixtures/cw_retweet.xml
vendored
Normal file
|
@ -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"><p>Fr and En.<br>Posts will disappear on a regular basis.</p></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"><p><span class="h-card"><a href="https://mastodon.social/@lambadalambda">@<span>lambadalambda</span></a></span></p><p>Hey!!!</p></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"><p><span class="h-card"><a href="https://mastodon.social/@lambadalambda">@<span>lambadalambda</span></a></span></p><p>Hey!!!</p></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>
|
342
test/fixtures/httpoison_mock/https___mamot.fr_users_Skruyb.atom
vendored
Normal file
342
test/fixtures/httpoison_mock/https___mamot.fr_users_Skruyb.atom
vendored
Normal file
|
@ -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"><p>Fr and En.<br />Posts will disappear on a regular basis.</p></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"><p><span class="h-card"><a href="https://pouets.ovh/@noName" class="u-url mention">@<span>noName</span></a></span></p><p>Pour comparer faut avoir tester... Ô wait!!! 😁</p></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"><p><span class="h-card"><a href="https://witches.town/@Dhveszak" class="u-url mention">@<span>Dhveszak</span></a></span></p><p>Toi!! Tu vises le ministère de la propagande avoue!!!!!!!</p></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"><p>Facebook s&apos;attaque aux sites internet &quot;trompeurs&quot;</p><p><a href="http://u.afp.com/4W4z" rel="nofollow noopener" target="_blank"><span class="invisible">http://</span><span class="">u.afp.com/4W4z</span><span class="invisible"></span></a></p><p>J&apos;attends de voir que Facebook s&apos;attaque à lui même... rien qu&apos;à lire leurs conditions générales d&apos;utilisation, le respect de la vie privée...</p><p>Charité bien ordonnée... Parfois l&apos;égoïsme aurait du bon.</p></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"><p><span class="h-card"><a href="https://octodon.social/@Balise" class="u-url mention">@<span>Balise</span></a></span></p><p>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</p></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"><p><span class="h-card"><a href="https://mastodon.social/@applecandy" class="u-url mention">@<span>applecandy</span></a></span></p><p>Lucky you!!!</p></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"><p>Est-ce que je suis le seul qui lorsqu&apos;il commence à compter les arbres sur le bord de la route n&apos;arrive pas à s&apos;arrêter de compter?</p></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"><p>Ca y est j&apos;ai une nouvelle passion. Mettre les bouchons qui trainent par terre dans le bons sens avec mon pied 🙌</p></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"><p>Ok. On est capable d&apos;envoyer des mecs dans l&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...</p><p>J&apos;ai du louper un truc dans l&apos;ordre des priorités Oo</p></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"><p>J&apos;ai comme envie de faire un truc mais je ne sais pas quoi mais pourtant c&apos;est comme si je ressentais l&apos;idée dans ma tête mais c&apos;est pas clair...</p><p>Fuck!!! J&apos;vais aller draguer Josiane à la compta ça va me changer les idées!!!</p></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"><p><span class="h-card"><a href="https://mamot.fr/@Smeablog" class="u-url mention">@<span>Smeablog</span></a></span></p><p>Pas faux MDR!!!!</p></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"><p><span class="h-card"><a href="https://mamot.fr/@Smeablog" class="u-url mention">@<span>Smeablog</span></a></span></p><p>Ca ne change pas la finalité malheureusement, ça ne m&apos;ouvre pas ce à quoi je veux accéder 😭</p></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"><p>Arrrgghhhhhhh!!!!</p><p>Quand t&apos;es sur le point de cliquer sur un lien dans le fil public global et que BOOM ça se met à jour... J&apos;ose même pas imaginer combien j&apos;ai ouvert de pages web sans le vouloir!!!</p></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"><p>Adicciones: Escribir, diseñar, cine, café, humor negro, música y dibujar. | Jedi. Bueno, no. Algún día (?) | Gratitude.</p></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"><p>♫ <br><a href="https://www.youtube.com/watch?v=pT68FS3YbQ4"><span class="invisible">https://www.</span><span class="ellipsis">youtube.com/watch?v=pT68FS3YbQ</span><span class="invisible">4</span></a></p></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"><p>♫ <br><a href="https://www.youtube.com/watch?v=pT68FS3YbQ4"><span class="invisible">https://www.</span><span class="ellipsis">youtube.com/watch?v=pT68FS3YbQ</span><span class="invisible">4</span></a></p></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"><p><span class="h-card"><a href="https://mamot.fr/@Chat2Gouttieres" class="u-url mention">@<span>Chat2Gouttieres</span></a></span></p><p>Ah bah après faut savoir mettre à profit ce savoir ^^</p></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"><p><span class="h-card"><a href="https://mamot.fr/@Chat2Gouttieres" class="u-url mention">@<span>Chat2Gouttieres</span></a></span></p><p>Exactement. On a les jeux mais pas le pain encore.</p><p>Finalement on a rien inventé :-p</p></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"><p><span class="h-card"><a href="https://mamot.fr/@Chat2Gouttieres" class="u-url mention">@<span>Chat2Gouttieres</span></a></span></p><p>C&apos;est ça visiblement dans notre société dite moderne... &quot;Créer l&apos;illusion que&quot; Oo.</p></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"><p><span class="h-card"><a href="https://mastodon.social/@lambadalambda" class="u-url mention">@<span>lambadalambda</span></a></span></p><p>Hey!!!</p></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"><p><span class="h-card"><a href="https://mamot.fr/@EloClemTiti" class="u-url mention">@<span>EloClemTiti</span></a></span></p><p>J&apos;ai souvent cette impression en effet 😂</p></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"><p>Les gars, les boss veulent voir de l&apos;avancement!! Une idée?</p><p>On fait comme d&apos;habitude. On divise nos tâches en 25.000 tâches unitaires, on fout du vert au maximum et on crée l&apos;illusion que ça a bien avancé!</p><p>Deal!!</p><p>Bob, tu choisis quel vert on utilise<br />Alice, t&apos;es en charge de la typo<br />Moi, je m&apos;occupe qu&apos;on prend bien le dernier template ppt fournit par la comm interne.</p><p>Des winners qu&apos;on est!!!! Des WI-NNERS!!!</p></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"><p><span class="h-card"><a href="https://mastodon.social/@SauceHair" class="u-url mention">@<span>SauceHair</span></a></span></p><p>Cool!!</p><p>Bon courage.</p></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>
|
11
test/fixtures/httpoison_mock/skruyb@mamot.fr.atom
vendored
Normal file
11
test/fixtures/httpoison_mock/skruyb@mamot.fr.atom
vendored
Normal file
|
@ -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>
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue