WIP: post editing #103

Closed
nbsp wants to merge 48 commits from nbsp/akkoma:feat/editing into develop

48 Commits

Author SHA1 Message Date
Tusooa Zhu 32baa9b9f0 Make NoEmptyPolicy work with Update
ci/woodpecker/push/docs Pipeline is pending Details
ci/woodpecker/push/release Pipeline is pending Details
ci/woodpecker/push/test Pipeline is pending Details
ci/woodpecker/pr/docs Pipeline is pending Details
ci/woodpecker/pr/release Pipeline is pending Details
ci/woodpecker/pr/test Pipeline is pending Details
2022-07-27 13:37:56 +01:00
Tusooa Zhu 1dfbf9edb6
Make AntiLinkSpamPolicy history-aware 2022-07-27 15:04:01 +03:00
Tusooa Zhu 0d1f3212d9
Make HashtagPolicy history-aware 2022-07-27 15:04:00 +03:00
Tusooa Zhu 6283fd9fa7
Make NormalizeMarkup history-aware 2022-07-27 15:01:16 +03:00
Tusooa Zhu 314804a5a0
Make NoPlaceholderTextPolicy history-aware 2022-07-27 15:01:16 +03:00
Tusooa Zhu 0e9561ed51
Make MediaProxyWarmingPolicy history-aware 2022-07-27 15:01:16 +03:00
Tusooa Zhu 21b63172a1
Make EnsureRePrepended history-aware 2022-07-27 15:01:10 +03:00
Tusooa Zhu 2ad579d467
Make MRF Keyword history-aware 2022-07-27 15:01:10 +03:00
Tusooa Zhu 5a1c5eebd5
Fix remote emoji in subject disappearing after edits 2022-07-27 15:01:10 +03:00
Tusooa Zhu 13e6deccfc
Test that Question updates are viable 2022-07-27 15:01:09 +03:00
Tusooa Zhu ce13b9c183
Guard against outdated Updates
It is possible for an earlier Update to be received by us later.
For this, we now
(1) only allows Updates to poll counts if there is no updated field,
    or the updated field is the same as the last updated date or
    creation date;
(2) does not allow updating anything if the updated field
    is older than the last updated date or creation date;
(3) allows updating updatable fields otherwise (normal updates);
(4) if only the updated field is changed, it does not create
    a new history item on its own.
2022-07-27 15:01:09 +03:00
Tusooa Zhu c93ab3b80f
Fix cannot get full history on object fetch 2022-07-27 15:01:09 +03:00
Tusooa Zhu f6384bfdd5
Validate object data for incoming Update activities
In Create validator we do not validate the object data,
but that is because the object itself will go through the
pipeline again, which is not the case for Update. Thus,
we added validation for objects in Update activities.
2022-07-27 15:00:54 +03:00
Tusooa Zhu e42a6ff405
Pass history items through ObjectValidator for updatable object types 2022-07-27 15:00:54 +03:00
Tusooa Zhu 53fdb10635
Make outbound transmogrifier aware of edit history 2022-07-27 14:59:54 +03:00
Tusooa Zhu acd1daf9ea
Do not put meta[:object_data] for local Updates 2022-07-27 14:59:54 +03:00
Tusooa Zhu a5ba2a3179
Fix local updates causing emojis to be lost 2022-07-27 14:59:54 +03:00
Tusooa Zhu 12bb15516a
Verify that formerRepresentation provided in Update is used 2022-07-27 14:59:54 +03:00
Tusooa Zhu 1c4065accc
Reuse formerRepresentations from remote if possible 2022-07-27 14:59:54 +03:00
Tusooa Zhu 57c130825b
Unify the logic of updating objects 2022-07-27 14:59:54 +03:00
Tusooa Zhu ccfcf15d4f
Fix CommonAPITest 2022-07-27 14:59:53 +03:00
Tusooa Zhu 09fd030961
Use meta[:object_data] in SideEffects for Update 2022-07-27 14:59:24 +03:00
Tusooa Zhu 19f5f7c3f0
Convert incoming Updated object into Pleroma format 2022-07-27 14:59:24 +03:00
Tusooa Zhu ab56283cc5
Add editing to features 2022-07-27 14:56:09 +03:00
Tusooa Zhu 97e9484e55
Show original status at the first of history 2022-07-27 14:55:38 +03:00
Tusooa Zhu bcb70dca4f
Workaround with_index does not support function in Elixir 1.9 2022-07-27 14:55:38 +03:00
Tusooa Zhu 2e8ddd5e21
Send the correct update in streamer
get_create_by_ap_id_with_object() seems to fetch the old object.
Why this happens needs further investigation.
2022-07-27 14:55:38 +03:00
Tusooa Zhu edbe714435
Expose history and source apis to anon users 2022-07-27 14:55:37 +03:00
Tusooa Zhu 670cbc368a
Fix incorrectly cached content after editing 2022-07-27 14:55:37 +03:00
Tusooa Zhu 41a003d117
Return the corresponding object id in attachment view 2022-07-27 14:55:37 +03:00
Tusooa Zhu 0d72051aa3
Add object id to uploaded attachments 2022-07-27 14:55:37 +03:00
Tusooa Zhu c3fc04cdaa
Lint 2022-07-27 14:55:37 +03:00
Tusooa Zhu bb016795ce
Return update notification in mastodon api 2022-07-27 14:55:37 +03:00
Tusooa Zhu 8a8b135f09
Create Update notifications 2022-07-27 14:55:36 +03:00
Tusooa Zhu 3865ed5e0b
Expose content type of status sources 2022-07-27 14:55:24 +03:00
Tusooa Zhu 3a24185dd4
Fix SideEffectsTest 2022-07-27 14:53:36 +03:00
Tusooa Zhu d236c091ad
Show edited_at in MastodonAPI/show 2022-07-27 14:53:36 +03:00
Tusooa Zhu 920a5c7107
Test that own edits are streamed 2022-07-27 14:53:35 +03:00
Tusooa Zhu a7bf1f27df
Stream out edits 2022-07-27 14:53:35 +03:00
Tusooa Zhu 3a4fd61bba
Inject history when object is refetched 2022-07-27 14:53:23 +03:00
Tusooa Zhu 8067ecad46
Strip internal fields in formerRepresentation 2022-07-27 14:53:23 +03:00
Tusooa Zhu e6ab68c624
Implement mastodon api for editing status 2022-07-27 14:53:23 +03:00
Tusooa Zhu f269e910ef
Implement viewing source 2022-07-27 14:53:23 +03:00
Tusooa Zhu bc54d06588
Implement mastodon api for showing edit history 2022-07-27 14:53:23 +03:00
Tusooa Zhu 1109acba2f
Allow updating polls 2022-07-27 14:50:11 +03:00
Tusooa Zhu 3563671e43
Record edit history for Note and Question Updates 2022-07-27 14:50:11 +03:00
Tusooa Zhu 9d9e765db2
Handle Note and Question Updates 2022-07-27 14:50:02 +03:00
Tusooa Zhu fb50f7ca7e
Allow Updates by every actor on the same origin 2022-07-27 14:49:29 +03:00