Commit Graph

1035 Commits

Author SHA1 Message Date
Hugo Sales 5600218924
[TWIG][I18N] Remove unnecessary wrappers for translation functions, use them directly 2022-03-01 17:25:51 +00:00
Hugo Sales 070f53c10e
[TWIG][I18N] Add transList function, which uses _m_list 2022-03-01 13:46:01 +00:00
Hugo Sales f73e9c12ba
[CORE][I18n] Add I18n::_m_list, which formats an array of elements into a list. Limited to 5 elements, as that should be enough (tm) and ICU doesn't support this natively 2022-03-01 13:45:40 +00:00
Hugo Sales fc203e2e38
[TWIG][TEMPLATES] Rename transchoice to trans and make it more generic 2022-03-01 13:45:11 +00:00
Hugo Sales 4cc4d06b11
[CORE][Cache] Fix bug where empty lists must be stored as a string in Redis (not supported natively), so we can't directly push to it, but the key still exists 2022-03-01 11:07:21 +00:00
Hugo Sales d5f90a1206
[ENTITY][Note][CONFIG] Use getListPartialCache for getReplies. Add feeds/cached_replies config entry to control how many replies get cached 2022-02-28 15:47:38 +00:00
Hugo Sales 85ce6bfd41
[CORE][Cache] Add getListPartialCache, which allows for fetching a list and backing only a portion of it in the cache (useful for feeds and replies to notes, for instance) 2022-02-28 15:47:38 +00:00
Hugo Sales 45c7888676
[TOOLS] Run CS-Fixer on whole project 2022-02-28 15:47:37 +00:00
Hugo Sales 255c44bbf0
[ENTITY][LocalUser] Don't use FILTER_SANITIZE_EMAIL, use just want to validate. Up to the user to fix any errors. Use setter, rather than duplicate it's code 2022-02-28 15:47:37 +00:00
Hugo Sales 5188a473d0
[TOOLS] Fix errors reported by PHPStan 2022-02-28 15:47:37 +00:00
Diogo Peralta Cordeiro 5495a3c5ec
[ENTITY][Note] NoteType now becomes a varchar as predicted 2022-02-27 02:04:48 +00:00
Diogo Peralta Cordeiro a9b34b75b6
[PLUGIN][TreeNotes] Correct cache issues and iterate functionality
- Replies ordering now correct
- Replies count added
- Posting adds new replies to cache (when concerning replies cache is not empty) and increments replies count
- Configuration to specify number of in-tree replies shown added
- TreeNotes templates was moved from core to plugin
- Button to read more replies was added
2022-02-27 01:46:25 +00:00
Diogo Peralta Cordeiro 2f539d176d
[TWIG] Implement transchoice for ICU plural translations 2022-02-27 00:44:23 +00:00
Diogo Peralta Cordeiro d4c908c194
[CORE][Cache] Implement listPushRight 2022-02-27 00:44:23 +00:00
Diogo Peralta Cordeiro d5731e6351
[COMPONENT][Notification] Consider attention properly in notes 2022-02-25 13:12:16 +00:00
Diogo Peralta Cordeiro 05b7f2c28b
[CORE][DB] Remove doc from deprecated DB::merge and add about DB::refresh 2022-02-23 17:42:20 +00:00
Diogo Peralta Cordeiro c380cbd846
[COMPONENT][FreeNetwork] Mention and Group tags in notes are handled differently 2022-02-21 04:52:30 +00:00
José Marques 8b0e9c7890
[UTIL][Form][ActorForms] Fix Full Name validate: Tried to mb_strln on null
If the trim(string) is empty, then store null without further ado
2022-02-20 05:03:55 +00:00
Diogo Peralta Cordeiro 51cccd0155
[PLUGIN][ActivityPub] Simplify DB usage 2022-02-20 05:03:40 +00:00
Diogo Peralta Cordeiro b6ed0b4c6c
[CORE][Actor] Fix generic profile route 2022-02-16 18:53:08 +00:00
Diogo Peralta Cordeiro 2d5fac7a89
[COMPONENT][Notification] Re-introduce the concept of note attention
Minor refactoring and bug fixing
2022-02-16 18:53:08 +00:00
Eliseu Amaro e70acd5c3b
[UTIL][HTML] HTML abstraction class was extended with a more specialised Heading class
This little abstraction layer made it a bit easier to add a different title to a Note or Actor Feed Collection template, from whichever controller that uses it. Please, bear in mind, that abstract templates such as those found in Components\Collection, may act in a very 'declarative' way upon using them. This makes it difficult to dynamically choose what type of header is used without undergoing a mining operation in the likes of a pyramid of doom. Hence, this _little_ change.
2022-02-16 18:53:08 +00:00
Diogo Peralta Cordeiro f66e178dfc
[CORE][Actor][Settings] Fix nickname change and refactor Core Form::handle so it's harder to repeat these mistakes again
Minor improvements on actor->getLocal
2022-02-16 18:53:07 +00:00
Diogo Peralta Cordeiro 54b9ec48b4
[COMPONENT][Collection][FeedController] Fix group scope, we should use the IN context actor to check the group 2022-02-16 18:53:07 +00:00
Diogo Peralta Cordeiro bf23ae2dcf
[ENTITY][Note] Some notes aren't exactly just a note but rather a Page, or further (like happening or poll), this is only initial support for that
It prolly will become a varchar instead of an enum, so plugins can add their own note types
2022-02-16 18:53:06 +00:00
Diogo Peralta Cordeiro 3f9c86f0df
[COMPONENT][Group] More flexible member roles than only isAdmin
Refactor terminology of canAdmin to match current roles system
2022-02-14 05:02:10 +00:00
Diogo Peralta Cordeiro 090a087832
[COMPONENT][Group] Check nickname on register 2022-02-14 01:21:40 +00:00
Diogo Peralta Cordeiro 66323c5a73
[PLUGIN][ActivityPub] Fix several issues with target and notifications inserted by AP 2022-02-13 23:14:59 +00:00
Diogo Peralta Cordeiro 62bf788b90
[CORE][Note] Implement private group scope properly 2022-02-13 23:14:59 +00:00
Diogo Peralta Cordeiro 1f2638d15a
[ROUTES] Remove ActorCircle holdover route 2022-02-11 15:31:47 +00:00
Diogo Peralta Cordeiro 17733f32d6
[PLUGIN][ActivityPub] Implement Group Outbox
Fix various minor issues
2022-02-11 10:06:01 +00:00
Diogo Peralta Cordeiro fb3e900b28
[CORE] Add CONFIG_ prefix to environment whitelist
Fixed minor issues with Commong:config of env not being included and ported to local social yaml

Fixed some regressions introduced with [CORE] Unset sensitive information from the environment
2022-02-11 10:05:58 +00:00
Diogo Peralta Cordeiro 416451a519
[CORE][Actor] Simplify logic so more is reused between different types of actors
Minor bug fixes
2022-02-11 00:27:03 +00:00
Diogo Peralta Cordeiro 1f1524c2b3
[GROUP] Simplify logic by making Actor::Organisation a type of Actor::Group
Some minor bug fixes
2022-02-11 00:26:43 +00:00
Eliseu Amaro 9a53f94b77
[TWIG] Replaced getRightPanelBlocks with addRightPanelBlock, provides more control on block placement
[COMPONENTS][RightPanel] Refactored template, improved clarity, and added Posting form related macros

[PLUGINS][NoteTypeFeedFilter] Removed icons from template, added them through CSS to further improve performance
2022-02-07 20:29:14 +00:00
Eliseu Amaro 4dd976eb22
[ENTITY][Note] Added function getRenderedSplit, return an array of paragraphs/line breaks
[PLUGINS][Favourite] Foreign keys now properly defined on schema

[CARDS][Note] Note text is now hidden by default if too many paragraphs/line breaks are present, BlogCollection plugin will certainly need this feature
2022-02-04 16:07:24 +00:00
Bruno Aleixo fb76775716 [TOOLS][COMPONENTS][CORE] Ran cs-fixer on all files 2022-01-30 16:41:54 +00:00
Eliseu Amaro 2e6f91f34e
[FORM][ActorForms] Fullname length is now validated prior to being set 2022-01-27 17:53:02 +00:00
Eliseu Amaro 5036b72a71
[ENTITY][Actor] Nickname is lower case transformed when generating 'actor_view_nickname', making sure that actor pages are linked accordingly 2022-01-27 17:19:50 +00:00
Eliseu Amaro a17a514bfd
[CONTROLLER][Security] Further sanity checks and validation done on email entry 2022-01-27 17:08:20 +00:00
Eliseu Amaro 1576d253a5
[CONTROLLER][UserPanel] Email is now sanitized and validated before calling corresponding setter 2022-01-27 16:59:43 +00:00
Eliseu Amaro adf484f58a
[COMPONENTS][Posting] No error to ignore was reported on line 161, removed ignore
[PLUGINS][Directory] Further documentation work

[CORE][Controller] Separating workflows, setting proper return types

[TWIG][Security] Removing unused stylesheet calls
2022-01-26 20:54:55 +00:00
Eliseu Amaro 6a5312aca9
[CORE][GNUsocial] social.local.yaml is now updated with the proper node name 2022-01-26 18:46:31 +00:00
Eliseu Amaro e4a3438d55
[CORE][I18n] Fixing 'file_get_contents(): Argument #1 () must be of type string, Symfony\Component\Finder\SplFileInfo given' error by using Symfony's Finder to iterate through existing files 2022-01-23 19:07:39 +00:00
Diogo Peralta Cordeiro 6b1c6f603e
[CORE][ActorLocalRoles] Improve Roles 2022-01-22 18:47:56 +00:00
Diogo Peralta Cordeiro bdeb3bcff5
[PLUGIN][ActivityPub] Federate Actor of types other than Person
Fix some other minor bugs
2022-01-21 22:05:31 +00:00
Diogo Peralta Cordeiro 23d45ffab7
[UTIL][Formatting] Mention prefix was hardcoded, fixed. 2022-01-21 21:03:09 +00:00
Hugo Sales 1856af68b3
[PLUGIN][RepeatNote][COMPONENTS][Posting] Review and fix RepeatNote. Handle attachment lives in Posting 2022-01-21 21:03:08 +00:00
Hugo Sales 145c88d43f
[ENTITY][Note] Only attempt to find mentions if we have content 2022-01-21 21:03:08 +00:00
Eliseu Amaro 184d0246a5
[COMPONENTS][RightPanel] AppendRightPanelBlock event refactored,
replaced with src/Twig/Rintime::getRightPanelBlocks
[COMPONENTS] Re-ordered onAppendRightPanelBlock event calls arguments for improved consistency across events
2022-01-21 21:03:07 +00:00
Eliseu Amaro eff9318c1d
[UTIL][Formatting] Mention title is not always defined 2022-01-13 18:07:19 +00:00
Eliseu Amaro 859bf0c0bf
[CONTROLLER][UserPanel] Notification settings panel debug information added for future reference 2022-01-13 16:24:23 +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
Diogo Peralta Cordeiro 14b03c7137
[UI][UserPanel] Do not try to re-set an unchanged nickname 2022-01-12 17:46:13 +00:00
Diogo Peralta Cordeiro 480f570238
[CORE][SECURITY][HTML] Refactor Security::sanitize to HTML::sanitize
Update composer dependencies, move more general deps from ActivityPub to Core
2022-01-12 17:12:58 +00:00
José Marques d713429d88
[CORE][Nickname] Properly set nickname for existing accounts 2022-01-10 11:33:13 +00:00
Hugo Sales cdf1d67d0f
[CORE][Cache] Workaround to redis not allowing empty lists 2022-01-09 12:29:34 +00:00
Hugo Sales da6d3bd351
[COMPONENT][Collection] Use current locale 2022-01-09 12:29:34 +00:00
Diogo Peralta Cordeiro e056920de4
[COMPONENT][Subscription] Fix Notifications 2022-01-06 12:13:11 +00:00
Eliseu Amaro 0c245fcb6e
[COMPONENTS][Subscription] Subscribe Actor action implemented
[TWIG] AddProfileAction event added
[CARDS][Profile] Refactor and restyling to accomodate Actor actions
2022-01-06 12:13:10 +00:00
Diogo Peralta Cordeiro 0d1ab2c9cf
[SECURITY][Register] New users should have their current browser language set as first language preference 2022-01-05 04:19:35 +00:00
Diogo Peralta Cordeiro cd6ce3542e
[COMPONENT][Circle] Move circles to a component, various bug fixes
Mention links are now correct
2022-01-05 04:19:22 +00:00
Diogo Peralta Cordeiro 627d92b290
[COMPONENT][Tag] Improve Note Tag Handling and start extracting Circles logic out of the plugin, various bug fixes 2022-01-05 01:30:02 +00:00
Diogo Peralta Cordeiro 754135743e
[COMPONENT][Subscription] Move respective routes to component 2022-01-05 01:29:27 +00:00
Diogo Peralta Cordeiro 5a0bbfc795
[UTIL][Common][I18N] Use actor's preferred language for _m and utility to retrieve current language even when no actor is logged in 2022-01-05 01:29:26 +00:00
Hugo Sales de8eab2cf8
[CORE][FORM][FormTypeNonceExtension] Add a nonce to all forms with a CSRF token 2022-01-04 18:58:32 +00:00
Hugo Sales b7e4f79ccc
[CORE][Cache] Add Cache::incr which increments a value at , atomically, in the case of Redis 2022-01-04 18:58:32 +00:00
Hugo Sales a8a8cc4046
[COMPONENT][Posting] Plumb in reply_to and redirecto to GET from 2022-01-03 21:20:26 +00:00
Hugo Sales 7d38c927e1
[ENTITY][Note][CACHE] Consolidate cache keys to helper function and add ensureCanInteract 2022-01-03 21:20:26 +00:00
Hugo Sales f5fc7b6cd1
[CORE][Controller] Add facility for either returning null or throwing, from Controller->{int,string,bool} 2022-01-03 18:02:33 +00:00
Hugo Sales a9ea49d34c
[TOOLS][DOC] Add documentation to functions flagged by doc-check 2022-01-03 02:23:06 +00:00
Hugo Sales 27276ba379
[CONFIG] Rename streams/notes_per_page to feeds/entries_per_page 2022-01-03 02:18:44 +00:00
Diogo Peralta Cordeiro 6cfb69d64b
[COMPONENT][Subscription] Start component 2022-01-03 02:18:44 +00:00
Diogo Peralta Cordeiro 5fa8056899
[COMPONENT][Collection] Refactoring: Further work in abstracting collections 2022-01-03 02:18:43 +00:00
Diogo Peralta Cordeiro def5f36c25
[PLUGIN][ActivityPub][Inbox] Accept Follow Activity
Improve how Core Activity is handled in general
2022-01-02 23:50:16 +00:00
Diogo Peralta Cordeiro afb7ae0f75
[CORE][Util][Exception] Add log context to BugFoundException 2022-01-02 23:50:15 +00:00
Eliseu Amaro 28424402ec
[CONTROLLER][CollectionController] Refactored methods names and form
titles
[PLUGINS][AttachmentCollections] Renamed respective Controller to
differentiate it between The Controller and itself, renamed templates
and removed unnecessary HTML from templates
2022-01-02 23:50:15 +00:00
Diogo Peralta Cordeiro f42e91d2bc
[CORE][Controller] Allow plugins to override redirect responses 2022-01-02 23:50:14 +00:00
Diogo Peralta Cordeiro 362fc6c7dd
[CORE][Controller] Set some safe default headers for every response 2022-01-02 23:50:14 +00:00
Diogo Peralta Cordeiro d27e8610d6
[CORE][DB] DB:removeBy Accept class name instead of table. 2022-01-02 23:50:14 +00:00
Eliseu Amaro e7940a21ee
[PLUGINS][TreeNotes] Feed only shows each note and its respective direct
replies, conversation shows whole tree

[COMPONENTS][Feed] Added request to FormatNoteList event

Every single Note that was provided to FeedController::postProcess is
shown. This means, that even though the Feed is formatted to show only a
Note and its respective direct replies, those same replies are shown
individually again (and they get the chance to show their own direct
replies).

The Note list provided to FormatNoteList is reversed, and for every
index, the respective Note replies are filtered out of the original list.
The replies are then added as leafs of the current Note and added to the tree.
2022-01-01 21:42:47 +00:00
Hugo Sales acc84d757c
[CORE][Controller] Make Controller->{int,bool,string} functions return null if the GET parameter doesn't exist 2022-01-01 20:03:40 +00:00
Hugo Sales 7aa90954eb
[UTIL][Functional] Update Functional::cartesian_product to pass an array of collections first and a separator after 2021-12-31 21:03:25 +00:00
Hugo Sales b7872ba4ee
[CORE][Controller][FeedController] Use controller instance for filtering, making FeedControler->postProcess function non-static 2021-12-31 21:03:17 +00:00
Eliseu Amaro ba078b7b76
[ENTITY][Note] Caching note replies query
[COMPONENTS][Conversation] Reply route will now present a more suitable title
2021-12-31 17:54:06 +00:00
Hugo Sales 0ae24f6088
[CORE][Controller][FeedController] Use controller instance for filtering, making FeedControler->postProcess function non-static 2021-12-30 18:28:57 +00:00
Hugo Sales 5f4968ac05
[ENTITY][Note][CACHE] Store lists as lists in the cache 2021-12-30 18:28:57 +00:00
Hugo Sales 2e0bfc0bcd
[TOOLS] Run CS-Fixer on all files 2021-12-30 18:28:57 +00:00
Hugo Sales 8831276489
[TOOLS] Fix errors reported by PHPStan 2021-12-30 18:28:57 +00:00
Hugo Sales cbb70a5054
[COMPONENT][Feed] Refactor Feed component 2021-12-30 18:28:56 +00:00
Phablulo Joel 85e31c684d [MODULES][Collection] Fixing mistakes 2021-12-30 12:16:29 -03:00
Phablulo Joel d7f70d288d [MODULES][Collection] Abstracting Collections 2021-12-29 21:56:45 -03:00
Eliseu Amaro 836560f55f
[CARDS][Note] AppendCardNote event overhaul
[PLUGINS][Favourite] Added complementary information on user action

[COMPONENTS][Conversation] Fixed AppendCardNote issue where cached query
would only act on Notes with depth > 1
2021-12-29 18:35:12 +00:00
Phablulo Joel 01d5e84a08 [COMPONENT][ACTOR CIRCLE] mention self tag circle with @#self_tag 2021-12-29 14:13:25 -03:00
Diogo Peralta Cordeiro 9585472679
[ENTITY][Actor] Basic check if can admin for remote actors 2021-12-28 15:38:41 +00:00
Diogo Peralta Cordeiro bf4a0008ef
[ENTITY][Note] GNU social uses Tombstones for deleted notes instead of fully removing them.
Various corrections.
2021-12-28 06:56:05 +00:00
Diogo Peralta Cordeiro f5b06e2c7e
[UTIL][Formatting] Fix group mentions 2021-12-27 21:38:20 +00:00
Hugo Sales c40e38c5ba
[TOOLS] Fix errors found by PHPStan 2021-12-27 20:37:16 +00:00
Hugo Sales d74a9ad373
[ENTITY][Subscription] Add Subscription::cacheKeys 2021-12-27 20:37:16 +00:00
Hugo Sales 76440961ca
[CORE][DB] Add option to findOneBy to return null rather than throw 2021-12-27 20:37:16 +00:00