Big refactoring of the Inbox (#443)
* Big refactoring of the Inbox We now have a type that routes an activity through the registered handlers until one of them matches. Each Actor/Activity/Object combination is represented by an implementation of AsObject These combinations are then registered on the Inbox type, which will try to deserialize the incoming activity in the requested types. Advantages: - nicer syntax: the final API is clearer and more idiomatic - more generic: only two traits (`AsActor` and `AsObject`) instead of one for each kind of activity - it is easier to see which activities we handle and which one we don't * Small fixes - Avoid panics - Don't search for AP ID infinitely - Code style issues * Fix tests * Introduce a new trait: FromId It should be implemented for any AP object. It allows to look for an object in database using its AP ID, or to dereference it if it was not present in database Also moves the inbox code to plume-models to test it (and write a basic test for each activity type we handle) * Use if let instead of match * Don't require PlumeRocket::intl for tests * Return early and remove a forgotten dbg! * Add more tests to try to understand where the issues come from * Also add a test for comment federation * Don't check creation_date is the same for blogs * Make user and blog federation more tolerant to errors/missing fields * Make clippy happy * Use the correct Accept header when dereferencing * Fix follow approval with Mastodon * Add spaces to characters that should not be in usernames And validate blog names too * Smarter dereferencing: only do it once for each actor/object * Forgot some files * Cargo fmt * Delete plume_test * Delete plume_tests * Update get_id docs + Remove useless : Sized * Appease cargo fmt * Remove dbg! + Use as_ref instead of clone when possible + Use and_then instead of map when possible * Remove .po~ * send unfollow to local instance * read cover from update activity * Make sure "cc" and "to" are never empty and fix a typo in a constant name * Cargo fmt
This commit is contained in:
+14
-13
@@ -42,6 +42,10 @@ msgstr ""
|
||||
msgid "To create a new blog, you need to be logged in"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "A blog with the same name already exists."
|
||||
msgstr "Et innlegg med samme navn finnes allerede."
|
||||
|
||||
#, fuzzy
|
||||
msgid "You are not allowed to delete this blog."
|
||||
msgstr "Du er ikke denne bloggens forfatter."
|
||||
@@ -222,8 +226,8 @@ msgid "Allow anyone to register here"
|
||||
msgstr "Tillat at hvem som helst registrerer seg"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Short description - byline"
|
||||
msgstr "Kort beskrivelse"
|
||||
msgid "Short description"
|
||||
msgstr "Lang beskrivelse"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Markdown syntax is supported"
|
||||
@@ -243,7 +247,7 @@ msgstr "Lagre innstillingene"
|
||||
msgid "About {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Home to <em>{0}</em> users"
|
||||
msgid "Home to <em>{0}</em> people"
|
||||
msgstr ""
|
||||
|
||||
msgid "Who wrote <em>{0}</em> articles"
|
||||
@@ -386,7 +390,7 @@ msgid "Subscribe"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "{0}'s subscriptions'"
|
||||
msgid "{0}'s subscriptions"
|
||||
msgstr "Lang beskrivelse"
|
||||
|
||||
#, fuzzy
|
||||
@@ -411,7 +415,7 @@ msgid "Plume is a decentralized blogging engine."
|
||||
msgstr "Plume er et desentralisert bloggsystem."
|
||||
|
||||
#, fuzzy
|
||||
msgid "Authors can manage various blogs, each as an unique website."
|
||||
msgid "Authors can manage multiple blogs, each as its own website."
|
||||
msgstr "Forfattere kan administrere forskjellige blogger fra en unik webside."
|
||||
|
||||
#, fuzzy
|
||||
@@ -422,9 +426,6 @@ msgstr ""
|
||||
"Artiklene er også synlige på andre websider som kjører Plume, og du kan "
|
||||
"interagere med dem direkte fra andre plattformer som f.eks. Mastodon."
|
||||
|
||||
msgid "Home to <em>{0}</em> people"
|
||||
msgstr ""
|
||||
|
||||
msgid "Read the detailed rules"
|
||||
msgstr "Les reglene"
|
||||
|
||||
@@ -673,7 +674,7 @@ msgstr "Legg til din"
|
||||
|
||||
#, fuzzy
|
||||
msgid "One boost"
|
||||
msgid_plural "{0} boost"
|
||||
msgid_plural "{0} boosts"
|
||||
msgstr[0] "Én fremhevning"
|
||||
msgstr[1] "{0} fremhevninger"
|
||||
|
||||
@@ -857,6 +858,10 @@ msgstr ""
|
||||
msgid "Use as an avatar"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "Short description - byline"
|
||||
#~ msgstr "Kort beskrivelse"
|
||||
|
||||
#~ msgid "Login"
|
||||
#~ msgstr "Logg inn"
|
||||
|
||||
@@ -977,10 +982,6 @@ msgstr ""
|
||||
#~ msgid "The comment field can't be left empty"
|
||||
#~ msgstr "Kommentaren din kan ikke være tom"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "An article with the same title already exists."
|
||||
#~ msgstr "Et innlegg med samme navn finnes allerede."
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "Your password field can't be left empty"
|
||||
#~ msgstr "Kommentaren din kan ikke være tom"
|
||||
|
||||
Reference in New Issue
Block a user