Commit Graph

15 Commits

Author SHA1 Message Date
Sami Mazouz
af9e5a9cc9 Eager load more necessary related mentions (#72)
* perf: Eager load related mentions from the extender

These missing relations caused more queries to be called, the more mentions posts have the more queries produced.

* perf: Eager load models in show endpoints

Can't use the extender for that
2021-08-23 20:33:42 +01:00
Alexander Skvortsov
8ed08b63cd Fix mentioned filtering (#67) 2021-05-04 14:57:29 -04:00
Sami Mazouz
e407c66784 New mentions format, decouple usernames from mentions (#65)
* Convert user mentions to new `@"Display Name"#ID` format

* Handle deleted user's mentions

* Convert post mentions to `@"Display Name"#pID` format

* Handle deleted user's post mentions and deleted posts mentions

* Clean display name of `"#{letters}{numbers}` (replace with underscore _)

* Adapt integration tests to new mention formats

* Use a deleted attribute for user mentions

* Introduce cleanDisplayName util

* Detect new format with autocomplete

* Slug needed on rendering only

* Invalidate user mention tag when ID is invalid
This used to be implicitly done, when there was a username attribute configured, formatter would check that all attributes are available and if not invalidate.

since we now only have `displayname` and `id` attributes which are both available from the regex matching, formatter doesn't implicitly invalidate anymore and therefore validates ANY matches. So we explicitly invalidate the tag when the ID does not match a user.

* Allow username mention format with a setting

* Add tests for turning setting on/off

* Move setting check to tag filter
Because the configurator caches, changing the setting only takes effect after the cache is cleared.

* fix: showing autocomplete at the right moment

* Add dockblocks to explain unparsing process
2021-04-21 10:58:54 +01:00
Alexander Skvortsov
302687b11a Use one instance of formatter extender 2021-03-01 23:26:35 -05:00
Alexander Skvortsov
3198de4b9b Use Formatter extender for rendering callbacks 2020-12-08 11:41:05 -05:00
Sami Mazouz
256e821289 Use new extenders (#58) 2020-12-08 11:15:52 -05:00
Sami Mazouz
2e9d9ab816 Use the new Notification type extender (#57) 2020-10-31 18:43:02 -04:00
Alexander Skvortsov
5d7f1d87d5 Don't typehint the view factory in the closure in extend.php
This causes the view factory to resolve early, breaking all future extensions that use the view extender
2020-07-27 19:30:24 -04:00
Franz Liedke
ba3071eaac Use new View extender
Refs flarum/core#2134.
2020-07-17 12:10:47 +02:00
Alexander Skvortsov
13e79e5457 Add empty locale extender to clear cache properly on enable/disable.
See https://github.com/flarum/core/pull/2020#issuecomment-616149583
2020-06-19 22:27:37 -04:00
Franz Liedke
a552b957ba Use new Model extender 2020-04-24 15:55:50 +02:00
Franz Liedke
3390bd5b02 Apply fixes from StyleCI 2019-11-29 23:02:17 +00:00
Franz Liedke
70a66a9529 Get rid of event subscribers that resolve services too early
Refs flarum/core#1578.
2018-12-16 16:24:05 +01:00
Franz Liedke
3656072ff4 Use Formatter extender to avoid resolving the UrlGenerator too early
Refs flarum/core#1578.
Fixes flarum/core#1703.
2018-12-15 12:06:58 +01:00
Toby Zerner
6700eeecfd Rename bootstrap.php 2018-09-21 11:48:36 +09:30