Commit Graph

23 Commits

Author SHA1 Message Date
Hélène f3e061c964
Object: remove context_id field
30 to 70% of the objects in the object table are simple JSON objects
containing a single field, 'id', being the context's ID. The reason for
the creation of an object per context seems to be an old relic from the
StatusNet era, and has only been used nowadays as an helper for threads
in Pleroma-FE via the `pleroma.conversation_id` field in status views.
An object per context was created, and its numerical ID (table column)
was used and stored as 'context_id' in the object and activity along
with the full 'context' URI/string.

This commit removes this field and stops creation of objects for each
context, which will also allow incoming activities to use activity IDs
as contexts, something which was not possible before, or would have been
very broken under most circumstances.

The `pleroma.conversation_id` field has been reimplemented in a way to
maintain backwards-compatibility by calculating a CRC32 of the full
context URI/string in the object, instead of relying on the row ID for
the created context object.
2022-08-09 20:10:43 +02:00
Sean King 17aa3644be
Copyright bump for 2022 2022-02-25 23:11:42 -07:00
Haelwenn (lanodan) Monnier 23161526d4 object_validators: Group common fields in CommonValidations
Notes:
- QuestionValidator didn't have a :name field but that seems like a mistake
- `_fields` functions can't inherit others because of some Validators
- bto/bcc fields were absent in activities, also seems like a mistake
  (Well IIRC we don't or barely support bto/bcc anyway)
2021-10-10 02:50:06 +02:00
Haelwenn (lanodan) Monnier e2a3365b5c
ObjectValidator.CommonFixes: Introduce fix_objects_defaults and fix_activity_defaults 2021-04-05 19:19:11 +02:00
Haelwenn (lanodan) Monnier 7ebfe89900
object_validators: Mark validate_data as private 2021-04-01 14:18:41 +02:00
Haelwenn (lanodan) Monnier 9015df2229
TagValidator: New 2021-04-01 14:18:40 +02:00
Haelwenn (lanodan) Monnier c4439c630f
Bump Copyright to 2021
grep -rl '# Copyright © .* Pleroma' * | xargs sed -i 's;Copyright © .* Pleroma .*;Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>;'
2021-01-13 07:49:50 +01:00
Haelwenn (lanodan) Monnier 2132b24a9d
object_validators: likes & announcements as [ObjectID] 2020-09-11 01:39:39 +02:00
Haelwenn (lanodan) Monnier a142da3e4f
Add new Emoji Ecto.Type and fix emoji in Question 2020-09-01 08:34:57 +02:00
Haelwenn (lanodan) Monnier 5316e231b0
Pipeline Ingestion: Audio (Part 2) 2020-08-19 00:06:31 +02:00
lain 3998ef9d64 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into features/validators-audio 2020-08-18 13:31:42 +02:00
Haelwenn (lanodan) Monnier c9d6638461
common_fixes: Get fixes common from Audio and Question 2020-08-18 02:24:48 +02:00
Haelwenn (lanodan) Monnier 7a273087ed
object_validators: Use ecto_types where available 2020-08-17 23:47:00 +02:00
lain f889400d05 Questions: Move fixes to validators. 2020-08-05 14:51:33 +02:00
lain 00c4c6a382 CommonValidations: Remove superfluous function
The `is_active` functionality was integrated into the presence
checker.
2020-08-05 12:24:34 +02:00
Haelwenn (lanodan) Monnier 0f088d8ce3
question_validator: Allow content to be an empty-string (blank) 2020-08-04 14:29:16 +02:00
Haelwenn (lanodan) Monnier bfe2dafd39
{Answer,Question}Validator: Keep both actor and attributedTo for now but sync them 2020-07-15 12:32:42 +02:00
Haelwenn (lanodan) Monnier d713930ea7
Fixup for EctoType module move 2020-07-15 11:40:24 +02:00
Haelwenn (lanodan) Monnier 435a65b976
QuestionValidator: Use AttachmentValidator 2020-07-15 11:40:24 +02:00
Haelwenn (lanodan) Monnier 82895a4012
SideEffects: port ones from ActivityPub.do_create and ActivityPub.insert 2020-07-15 11:40:23 +02:00
Haelwenn (lanodan) Monnier 4f70fd4105
question_validator: remove conversation field 2020-07-15 11:39:56 +02:00
Haelwenn (lanodan) Monnier 173f69c854
question_validator: fix for mastodon poll expiration
Mastodon activities do not have a "closed" field, this could be seen on
https://pouet.it/users/lanodan_tmp/statuses/104345126997708380
which runs Mastodon 3.1.4 (SDF runs 3.1.2)
2020-07-15 11:39:56 +02:00
Haelwenn (lanodan) Monnier 7bcd7a9595
QuestionValidator: Create 2020-07-15 11:39:53 +02:00