Open n-peugnet opened 1 year ago
It definitely works correctly for mentions, so this may be a good example how to implement this in this extension, since the functionality is quite similar. However, I think there is one problem with current schema of discussion_reference
- currently it tracks discussion-to-discussion relations. But for including data in payload it makes sense to store information also about post with link to discussion and generated EventPost. In this way you can include info about linked discussions using PostSerializer
, so payload will contain info only about discussion needed to handle current page. I you useDiscussionSerializer
, payload will contain all linked discussion, even if none of them is visible on current page - it could be a real problem for large discussions with lots of references.
Originally posted by @rob006 in https://github.com/club-1/flarum-ext-cross-references/issues/20#issuecomment-1435740909
This will should lower the network and client usage.
If I understand correctly, something similar is done in
flarum/mentions
in this file: https://github.com/flarum/mentions/blob/v1.6.3/src/FilterVisiblePosts.phpWhich is of course wired in extend.php: