Commit Graph

5381 Commits

Author SHA1 Message Date
Diogo Peralta Cordeiro 9e4c43e8fd
[ActivityStreamsTwo] Further work on routes and use render event on note's content 2021-09-20 17:05:04 +01:00
Diogo Peralta Cordeiro 7813723ca1
[ActivityPub] Inbox must work without actor, specify source for AS2 2021-09-20 17:03:23 +01:00
Eliseu Amaro 543853c374 [PLUGINS][Actor][Profile] Current user profile in line with other users. Directory plugin actor template standardized. 2021-09-20 14:39:11 +01:00
Diogo Peralta Cordeiro 67d62cf37b
[TWIG] Remove kludge event TwigPopulateVars 2021-09-18 07:27:35 +01:00
Diogo Peralta Cordeiro fda998e335
[Avatar] We definitely don't need an event to retrieve avatar urls 2021-09-18 07:26:10 +01:00
Diogo Peralta Cordeiro 2bd19fa087
[NOTE][Posting] Revert regressions introduced with c90efe2c52
Entity Note: It doesn't make sense to handle attachments on Note::create.
Attachments exist out of Notes, they are a thing on their own.
Furthermore, they aren't always handled the same, they most definitely
aren't always uploaded files.

FileQuota: It doesn't make sense to check if a file is greater than max
allowed upload size here. The plugin ensures a user is inside his
allowed quota, it's ignorant to anything else. Whether a file respect
max upload is a core thing that must be handled directly in the Posting
component. TODO: The configuration regarding user and monthly quota
must become FileQuotaPlugin settings and be removed from core.

c90efe2c52 - [UI] Add mechanism for rendering note contents in different formats. Implement plaintext rendering. Use rendered field for note content, rather than the content itself
2021-09-18 05:12:18 +01:00
Diogo Peralta Cordeiro 941cbe6599
[Actor] Refactor GSActor into Actor 2021-09-18 05:12:17 +01:00
Eliseu Amaro 6c899b7b61
[Plugins][Components] Fixed issue where right panel form was rendered multiple times in actors plugin page. Actors page done. 2021-09-18 05:12:16 +01:00
Eliseu Amaro e4b650be46
[PLUGINS][Settings] Removed unused templates. Directory plugin templates now using actual templates. Notification settings using details element now. 2021-09-18 05:12:16 +01:00
Diogo Peralta Cordeiro d6f31d102a
[CORE][ActivityStreamsTwo][ActivityPub] Set all routes
Allow global routes to act for every actor
Fix Favoured stream query
2021-09-18 05:12:15 +01:00
Eliseu Amaro 42f9a6a79c
[CSS][Attachments] Attachments page view done. Standardized left and right panels sections. Applying styling through key classes to be defined in docs. 2021-09-18 05:12:10 +01:00
Hugo Sales 8f0a3e4977
[UI] Add mechanism for rendering note contents in different formats. Implement plaintext rendering. Use rendered field for note content, rather than the content itself 2021-09-18 05:12:06 +01:00
Hugo Sales f344ed376c
[ATTACHMENTS][Embed][UI] Allow plugins to provide a title for an attachment, if a note has none, implement such a mechanism in Embed and cache the result, since it is potentially costly 2021-09-18 05:12:06 +01:00
Diogo Peralta Cordeiro 365edbaff0
[ActivityStreamsTwo] Initial Actor support
Various bug fixes
2021-09-15 10:26:53 +01:00
Diogo Peralta Cordeiro 7c465bba5f
[NOTE] Add mimetype to notes 2021-09-14 13:13:45 +01:00
Hugo Sales b74d944ae3
[TOOLS][PHPStan] Raise PHPStan level to 3 and fix new errors 2021-09-14 13:13:45 +01:00
Hugo Sales 4e30e5aad9
[TOOLS] Fix all issues found by PHPStan level 2 2021-09-14 13:13:44 +01:00
Diogo Peralta Cordeiro 4b1780a2ee
[ActivityStreamsTwo] Introduce a structure for data representation in ActivityStreams 2.0
Type factory borrowed from landrok/activitypub
2021-09-14 13:13:44 +01:00
Diogo Peralta Cordeiro 8123086881
[Embed] Fix normalizeEmbedLibMetadata for thumbnails starting with '/' 2021-09-14 13:13:43 +01:00
Eliseu Amaro 61071a6821
[PLUGINS][Reply][Repeat][Favourite] Base template semantic rework. Reply, repeat and favourite respective classes are now assigned in their NoteHandlerPlugin. 2021-09-14 13:13:43 +01:00
Eliseu Amaro 681144b380
[PLUGINS][Favourite][CSS] Favourite label now shows whether it's favourited or not already. 2021-09-14 13:13:42 +01:00
Hugo Sales add8f4a52f
[TOOLS] Fix all errors found by PHPStan level 1 2021-09-14 13:13:42 +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
Eliseu Amaro c612fe6df5
[PLUGINS][Reply][CSS] Help text added. Styling reply page done. 2021-09-14 13:13:41 +01:00
Hugo Sales bdde047dfa
[PLUGINS][Embed] Embed references a table that does not exist. It seems to mean `attachment_embed`, rather than `link_to_attachment` 2021-09-14 13:13:40 +01:00
Hugo Sales 16cde6dfd7
[PLUGINS][Reply] Redirect back to previous URL on note reply. Move controller to own class
This should be safe against open redirects, as it doesn't allow redirecting to other domains
2021-09-14 13:13:40 +01:00
Hugo Sales 61d95265a9
[PLUGINS][Repeat] Delete note repeat rather than the original Note. Don't fetch when we want a simple count 2021-09-14 13:13:39 +01:00
Hugo Sales be27a10244
[EVENTS] Rename event `RouteInFormat` to `ControllerResponseInFormat` 2021-09-14 13:13:39 +01:00
Eliseu Amaro 6fdec483cd
[Reply] RedirectionException wasn't allowing other handlers to do their job. 2021-09-14 13:13:39 +01:00
Eliseu Amaro 85db9464ca
[Reply] Fixed reply plugin action, there was no need to query the database when handling. 2021-09-14 13:13:39 +01:00
Eliseu Amaro f000532b7e
[Favourite][Reply][Repeat] The respective svg for note actions is assigned. Repeat note handler needs work. "An exception has been thrown during the rendering of a template ("No value in table note matches the requested criteria")." exception thrown on repeat. 2021-09-14 13:13:39 +01:00
Diogo Peralta Cordeiro 8880af8197
[ActivityStreamsTwo] Introduce a structure for data representation in ActivityStreams 2.0
Type factory borrowed from landrok/activitypub
2021-09-14 13:13:37 +01:00
Diogo Peralta Cordeiro 1ee8df1494
[DOCS][Developer] Elaborate on implementing and configuring a module 2021-09-14 13:13:37 +01:00
Diogo Peralta Cordeiro ab142ab52d
[FileQuota] Update plugin to respect the new entities 2021-09-14 13:13:35 +01:00
Diogo Peralta Cordeiro 415089914f
[VideoEncoder] Port plugin to v3 properly 2021-09-14 13:13:35 +01:00
Diogo Peralta Cordeiro 2b7232891e
[ImageEncoder] Make plugin respect instance config and use the new core interface 2021-09-14 13:13:35 +01:00
Hugo Sales 811caaadf9
[MODULES][PLUGINS] Move noteActionHandle utility to NoteHandlerPlugin which plugins which handle actions on notes should extend 2021-09-14 13:13:34 +01:00
Hugo Sales 458b6d0009
[UI] Rename all forms to more specific names, to avoid form name collisions 2021-09-14 13:13:33 +01:00
Hugo Sales 4b2a92d052
[UI][Attachment] Use Attachment methods to get the proper URL, rather than crafting it in a template 2021-09-14 13:13:32 +01:00
Hugo Sales 6799052ff5
[ATTACHMENTS] Ensure thumbnail dimensions are bounded and change way cropping is implemented 2021-09-14 13:13:32 +01:00
Diogo Peralta Cordeiro f67173061b
[VideoEncoder] Add plugin composer dependency php-ffmpeg/php-ffmpeg 2021-09-14 13:13:32 +01:00
Diogo Peralta Cordeiro ac45008240
[Embed] Move composer dependency embed/embed from core to plugin 2021-09-14 13:13:31 +01:00
Diogo Peralta Cordeiro 177801c81b
[Embed][StoreRemoteMedia] Re-add {white,black}list check config 2021-09-14 13:13:31 +01:00
Diogo Peralta Cordeiro 78f4ccb576
[ImageEncoder] Fix ImageSanitization, it should never modify the input image 2021-09-14 13:13:31 +01:00
Hugo Sales 4f880eb761
[PLUGINS][ENTITY][Cover][ProfileColor] Clean up after interns and move entity defintions to be inside the corresponding plugin, rather than in core 2021-09-14 13:13:29 +01:00
Diogo Peralta Cordeiro 1906d4f276
[Embed] Add UI element and fix some bugs 2021-09-14 13:13:27 +01:00
Diogo Peralta Cordeiro ef1a9ce3b1
[ImageEncoder] Handle VIPS unsupported image type 2021-09-14 13:13:27 +01:00
Diogo Peralta Cordeiro 9e4cac0123
[ENTITY] Refactor RemoteURL entities to Link
RemoteURL was being an awfully confusing term.
2021-09-14 13:13:26 +01:00
Diogo Peralta Cordeiro fb28a3656a
[Embed] Retrieve remote thumbnails and other improvements 2021-09-14 13:13:26 +01:00
Diogo Peralta Cordeiro 7a0a6f1f22
[Embed] Fix usage of EmbedLib
Fix other minor bugs
2021-09-14 13:13:26 +01:00
Diogo Peralta Cordeiro d076781c74
[AttachmentToNote][Attachment] Add title getter to Attachment 2021-09-14 13:13:26 +01:00
Diogo Peralta Cordeiro bac18715c5
[StoreRemoteMedia] Implement the first version of it in v3 2021-09-14 13:13:25 +01:00
Diogo Peralta Cordeiro fbbbde4275
[AttachmentShowRelated] Bug fix after re-introduction of NoteActions 2021-09-14 13:13:25 +01:00
Eliseu Amaro 5de0704de2
[Favourite][TWIG][CSS] Favourite shows alt-text and properly sets colours. Titles translated on the right panel. 2021-09-14 13:13:24 +01:00
Diogo Peralta Cordeiro 3f61537140
[ENTITY] Split Attachment in various new entities
Remove Attachment Scope
Fixed some minor bugs

Scope will be implemented later in v3. It doesn't make sense to have
the scope handling being per attachment. Different actors can post
the same attachment with different scopes. The attachment controller
will assume the highest level of scope applied to the attachment and
the rest will be handled at the note level.

Motivation:
* Remove title from attachment, as it's part of the relation between attachment and note.
* Remove actor from attachment, many actors may publish the same attachment.
* Remove is_local from attachment,  as it's part of the relation between attachment and note.
* Remove remote_url from attachment, different urls can return the same attachment.

Addition:
* Attachment now has a lives attribute,  it's a reference counter with a nicer name
* GSActorToAttachment
* GSActorToRemoteURL
* RemoteURL
* RemoteURLToNote
* RemoteURLToAttachment
* AttachmentToNote now has a title attribute
2021-09-14 13:13:24 +01:00
Diogo Peralta Cordeiro a7c8da0534
[FileQuota] We'll get back to this plugin later 2021-09-14 13:13:24 +01:00
Hugo Sales 061a85d6b3
[EVENTS] Change FormatNoteList do separate in and out arguments
This is necessary due to some weird problem which I wasn't able to figure out (but which doesn't matter)
that somehow causes the event to be called twice during testing, and thus the function was exploding
2021-09-14 13:13:23 +01:00
Hugo Sales cdf3426567
[CONTROLLR][UserPanel][PLUGINS] Add submit button to notification settings for each transport 2021-09-14 13:13:23 +01:00
Eliseu Amaro 1647c5391f
[Favourite][TWIG][CSS] Favourite now works. 2021-09-14 13:13:22 +01:00
Hugo Sales 77742c56c3
[ImageEncoder] Don't print_r the exception as that leads to an OOM error 2021-09-14 13:13:18 +01:00
Eliseu Amaro c8a8e94d48
[SETTINGS][PLUGIN][CONTROLLER] Populate profile tabs event added. Settings base template populated with such event for plugins and components.
Signed-off-by: Eliseu Amaro <mail@eliseuama.ro>
2021-09-14 13:13:12 +01:00
Eliseu Amaro 6dd0292397
[SETTINGS][ROUTES][CONTROLLER] Settings overhaul, refactoring to accommodate new global settings view. WIP, component settings aren't shown at the moment.
Signed-off-by: Eliseu Amaro <mail@eliseuama.ro>
2021-09-14 13:13:12 +01:00
Eliseu Amaro 701b4967b4
[TWIG] Microformats added to timeline, note's view and media. Should be backwards compatible as well.
Signed-off-by: Eliseu Amaro <mail@eliseuama.ro>
2021-09-14 13:13:06 +01:00
Eliseu Amaro ee3ed5f096
[TWIG][CSS] Timeline WIP. Creating a notice is now done on the right panel. HTML structure improvements, such as the timeline divided from the navigation div. 2021-09-14 13:13:05 +01:00
Diogo Peralta Cordeiro a5348f2427
[MEDIA][AttachmentThumbnail] Add mimetype to Entity 2021-09-14 13:13:04 +01:00
Diogo Peralta Cordeiro 41dcef3c7b
[Media] EncoderPlugins should handle the views that concern them
Ensure the intended filetypes and mimetypes during Vips conversions (part 2)
Sanitize Attachments instead of Validate (part 2)
Various bug fixes
2021-09-14 13:13:04 +01:00
Diogo Peralta Cordeiro 481e953cde
[Media] File quota should be triggered by the Core 2021-09-14 13:13:03 +01:00
Diogo Peralta Cordeiro c8cf8c3f13
[FILE][TemporaryFile] Fix various issues now that we also have Symfony's file abstractions 2021-09-14 13:13:03 +01:00
Hugo Sales d31c3b1784
[AUTOGENERATED] Update autogenerated code 2021-09-14 13:13:01 +01:00
Hugo Sales 2b83a4b627
[UTILS][TemporaryFile] Change way TemporaryFile takes arguments and it's internal implementation 2021-09-14 13:12:58 +01:00
Diogo Peralta Cordeiro 6a999b8237
[Embed] Do not create AttachmenThumbnail 2021-09-14 13:12:57 +01:00
Diogo Peralta Cordeiro 8f43c8b405
[AUTOGENERATED] Update auto generated code 2021-09-14 13:12:57 +01:00
Diogo Peralta Cordeiro 4fcccb1d1c
[CORE][ImageEncoder] Add width and height back in attachment entity and allow for differently sized thumbs
The strategy adopted involves predicting the thumb size as we did in v2 before having vips resize
2021-09-14 13:12:56 +01:00
Diogo Peralta Cordeiro 1c9f807595
[Embed] Fix some bugs and change AttachmentEmbed::url to ::media_url 2021-09-14 13:12:56 +01:00
Diogo Peralta Cordeiro a3860e6257
[Embed] Local config 2021-09-14 13:12:56 +01:00
Diogo Peralta Cordeiro 837f644458
[UTIL][Formatting] Add twigRenderFile 2021-09-14 13:12:55 +01:00
Hugo Sales 5067bcd074
[ImageEncoder][FileQuota] Move quota enforcement to it's own plugin, so it can be easily shared and disabled 2021-09-14 13:12:55 +01:00
Diogo Peralta Cordeiro 8cb64ede7f
[AttachmentShowRelated] Move Attachment related to plugin 2021-09-14 13:12:55 +01:00
Hugo Sales d11615ded6
[Avatar][Embed] Change use of TemporaryFile::getPath to getRealPath 2021-09-14 13:12:55 +01:00
Hugo Sales aad4bddedd
[ImageEncoder] Implement attachment validation for images. This limits the maximum dimensions of the file, enforces a per file, per user and per user-month size quota and fixes the title if it's a filename, by replacing the extension to the new one 2021-09-14 13:12:54 +01:00
Diogo Peralta Cordeiro 110c2572a4
[TEMPLATES] Minor refactoring, extending left was weird 2021-09-14 13:12:54 +01:00
Hugo Sales ced610d942
[Embed] Use Formatting utilities rather than substr and such 2021-09-14 13:12:53 +01:00
Diogo Peralta Cordeiro 9008bee558
[Embed] Add docblock to handle function to pass pre-commit hook 2021-09-14 13:12:53 +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 30107de079
[Embed] Fix plugin. Only attempt to show an image, if we have one 2021-09-14 13:12:52 +01:00
Hugo Sales a7ef2babe6
[AUTOGENERATED] Update autogenerated code 2021-09-14 13:12:52 +01:00
Hugo Sales bb1ba11fcf
[AUTOGENERATED] Run bin/generate_entity_fields for the Embed plugin 2021-09-14 13:12:51 +01:00
Hugo Sales 4cd152f640
[Embed] Review and port v2 code 2021-09-14 13:12:51 +01:00
Hugo Sales 7dab063a72
[PLUGINS] Remove scripts. These will need to be implemented with Commands 2021-09-14 13:12:48 +01:00
Hugo Sales 3d8c348cb8
[Emebed] Add Embed plugin and initial cleanup 2021-09-14 13:12:24 +01:00
Hugo Sales 8dff0b1d0c
[Favourite] Make twig event operate on array rather than string 2021-09-14 13:12:23 +01:00
Hugo Sales aeabf64051
[PLUGIN] Change base class from Module to Plugin for all plugins 2021-09-14 13:12:23 +01:00
Diogo Peralta Cordeiro 3afa872cec
[UI] Use thumbnail path for thumbs 2021-09-14 13:12:22 +01:00
Hugo Sales e1995f44ce
[ATTACHMENTS] Move thumbnail controller to core and cleanup 2021-09-14 13:12:22 +01:00
Hugo Sales 3a7e92ed01
[ImageEncoder] Change preferred type to always be WEBP 2021-09-14 13:12:22 +01:00
Hugo Sales 0c8c5a4b87
[ImageEncoder] Fix error when not providing a width and/or height 2021-09-14 13:12:22 +01:00
Diogo Peralta Cordeiro e385a9ac29
[ATTACHMENTS] Even more further refactoring
Introduce Encoder plugins Instead of abstract upload and thumb modules

Ported attachment routes. In v3 thumbnail depends on existing attachment
so route updated accordingly.
2021-09-14 13:12:18 +01:00
Diogo Peralta Cordeiro 0eaccc32fe
[ATTACHMENTS] Further refactoring
Some key points:
- Components and Plugins shouldn't extend Module directly
- Avatars should be fetched via GSActor ID, not by nickname as that isn't unique
- Avatar now is a separate Component
- Common file utilities are now to be placed in Core\GSFile, this will
  handle storage and trigger validation
- Some bug fixes
2021-09-14 13:11:51 +01:00
Hugo Sales 65999bd183
[Poll] Move tables from core to plugin 2021-09-14 13:11:51 +01:00
Hugo Sales 716ca063d5
[ImageThumbnail] Finish image thumbnailing functionality 2021-09-14 13:11:51 +01:00