Commit Graph

32 Commits

Author SHA1 Message Date
Hugo Sales dac94f53cd
[CORE][Entity] Rename createOrUpdate to 'checkExistingAndCreateOrUpdate', remove update feature from 'create' and add 'createOrUpdate' and fix users 2022-03-28 20:59:15 +01:00
Hugo Sales abe35428da
[CORE][DB] Rename App\Core\DB\DB to App\Core\DB 2022-03-28 20:59:14 +01:00
Diogo Peralta Cordeiro 888c3798b7
[COMPONENT][Notification] Make logic more generic and robust
Fixed various bugs

Some important concepts to bear in mind:

* Notification: Associated with activities, won't be reconstructed
together with objects, can be thought of as transient

* Attention: Associated with objects, will be reconstructed with them, can
be thought as persistent

* Notifications and Attentions have no direct implications.

* Mentions are a specific form of attentions in notes, leads to the creation of Attentions.

Finally,

Potential PHP issue detected and reported: https://github.com/php/php-src/issues/8199
`static::method()` from a non static context (such as a class method) calls `__call`, rather than
the expected `__callStatic`. Can be fixed by using `(static fn() => static::method())()`, but the
usage of the magic method is strictly unnecessary in this case.
2022-03-14 11:37:09 +00:00
Diogo Peralta Cordeiro 28453c585f
[COMPONENT][Attachment][TESTS] Fix Entity/AttachmentThumbnailTest 2022-03-09 01:42:11 +00:00
Eliseu Amaro d29e28b829
[CORE][Entity] Replaced get_called_class() calls with static::class since the former is deprecated 2022-01-13 16:24:12 +00:00
Hugo Sales ec28f23025
[TOOLS] Run CS-fixer on all files 2021-12-26 19:16:15 +00:00
Diogo Peralta Cordeiro 5e42723624
[ENTITY][Note] Include reply_to's targets in child's 2021-12-26 19:16:14 +00:00
Diogo Peralta Cordeiro 8b5286c383
[COMPONENT][Notification] Do not re-render content just to grab attentions
Other minor improvements and bug fixes
2021-12-21 16:05:24 +00:00
Hugo Sales a81ac673ac
[CORE][ENTITY] Rename 'Entity::getWithPK' to 'Entity::getByPK' 2021-12-19 19:04:01 +00:00
Diogo Peralta Cordeiro 9512890264
[PLUGIN][ActivityPub] Implement Actor Update
Diverse minor bug fixes
2021-12-05 03:11:08 +00:00
Diogo Peralta Cordeiro 7b9d388a44
[NOTIFICATION] Implement Target Collector 2021-11-27 15:14:15 +00:00
Hugo Sales 9109c61af5
[TOOLS][CS-FIXER] Run new PHP CS Fixer config. Notably, adds strict_types 2021-10-27 04:19:28 +01:00
Hugo Sales 4e30e5aad9
[TOOLS] Fix all issues found by PHPStan level 2 2021-09-14 13:13:44 +01:00
Hugo Sales eb833b62e2
[TOOLS] Fix all level 0 errors found by PHPStan and move constant definition to bootstrap file 2021-09-14 13:13:42 +01:00
Diogo Peralta Cordeiro fd3b57dc24
[CORE][Controller] Make it possible for plugins to add different content-types to existing routes 2021-09-14 13:13:37 +01:00
Hugo Sales 74d1874991
[DOCUMENTATION][Entity] Improve documentation on Entity::getWithPK, explaining the ways it can be used 2021-09-14 13:13:27 +01:00
Diogo Peralta Cordeiro 4ecdeac6a3
[CORE][Entity] Compare with object properties when creating/updating, instead of class 2021-09-14 13:13:25 +01:00
Hugo Sales 6728dd40b0
[ENTITY] Add JsonSerializable interface to Entity base class and implement it for the Note class 2021-09-14 13:13:24 +01:00
Hugo Sales 085e880631
[CORE][Entity] Fix implementation of createOrUpdate so it doesn't throw NotFoundException if trying to create an object
This was previously done because we wanted to notify the callee that
and entity existed but not with the provided contents. With the change
of return value, with a bool $is_update, this is no longer a problem.
2021-09-14 13:13:22 +01:00
Hugo Sales 0b80727769
[CORE][ENTITY] Allow create'ing will null values 2021-09-14 13:13:18 +01:00
Hugo Sales d22711504c
[ENTITY] Fixup implementation, as imformed by tests 2021-09-14 13:13:13 +01:00
Hugo Sales 9198797aea
[CORE] Throw more meaningfull error when method doesn't exist in Security and Entity 2021-09-14 13:13:02 +01:00
Hugo Sales b9fbed2e3d
[CORE] Clarify message when calling non existent method in Entity 2021-09-14 13:13:01 +01:00
Diogo Peralta Cordeiro b6d7d46719
[ENTITY] Fix entity->has to access private properties with closure bindTo 2021-09-14 13:12:57 +01:00
Hugo Sales b1e514832b
[Embed][ENTITY] Fix embed route and use attachment_view rather than _show. Rename Entity::have to Entity::has, because grammar 2021-09-14 13:12:52 +01:00
Hugo Sales 7adc198a52
[ENTITY] Add meta method 'have*' to Entity base class, which checks if a field 'isset' 2021-09-14 13:12:51 +01:00
Daniel ffb4b9df23
[Poll] Added modified param for Poll/Poll response, added PollTest 2021-09-14 13:10:12 +01:00
Hugo Sales e8feb2ae84
[DOCUMENTATION][REFACTOR] Add documentation to all flagged function and do some small cleanup 2021-09-14 13:06:55 +01:00
Hugo Sales 5b7fcc44cf
[DB] Add helper for removing entities 2021-09-14 13:06:47 +01:00
Hugo Sales 0b50905ac8
[NOTE][UI] Add note replying and UI displaying 2021-09-14 13:06:45 +01:00
Hugo Sales bd8f4bd277
[AVATAR] Fixed avatar upload, added avatar inline download and updated template and base controller 2021-09-14 13:05:51 +01:00
Hugo Sales 0ab6c2ef54
[DB] Add entity base class to allow sharing methods such as 'create' 2021-09-14 13:05:50 +01:00