Elkarte icon indicating copy to clipboard operation
Elkarte copied to clipboard

[WIP] Introduce recursive events: events can now be triggered from within modules

Open emanuele45 opened this issue 2 years ago • 4 comments

@spuds there we go: recursive events... actually probably it would have been better to call them nested? Yeah. Whatever. I thought thi was going to solve the issue with attachments you were facing, but it doesn't, though it looks pretty cool to me, so I just pushed it... let me know what you think. :laughing:

emanuele45 avatar Mar 28 '22 21:03 emanuele45

Codecov Report

Merging #3621 (a6bb97d) into development (f8e2423) will decrease coverage by 0.04%. The diff coverage is 28.26%.

@@                Coverage Diff                @@
##             development    #3621      +/-   ##
=================================================
- Coverage          30.64%   30.60%   -0.05%     
- Complexity         15876    15927      +51     
=================================================
  Files                427      429       +2     
  Lines              74288    74311      +23     
=================================================
- Hits               22768    22745      -23     
- Misses             51520    51566      +46     
Impacted Files Coverage Δ
...rces/ElkArte/AdminController/ManageAttachments.php 9.55% <0.00%> (ø)
sources/ElkArte/AttachmentsDisplay.php 0.00% <0.00%> (ø)
sources/ElkArte/Controller/PersonalMessage.php 23.91% <ø> (+0.05%) :arrow_up:
sources/ElkArte/Controller/Post.php 41.75% <0.00%> (ø)
sources/ElkArte/Controller/ProfileOptions.php 13.48% <0.00%> (+0.08%) :arrow_up:
sources/ElkArte/Controller/Register.php 36.78% <ø> (-0.15%) :arrow_down:
sources/ElkArte/Controller/Search.php 0.00% <ø> (ø)
sources/ElkArte/IlaIntegrate.php 3.79% <ø> (+0.16%) :arrow_up:
...Arte/Mentions/MentionType/AbstractEventMessage.php 21.73% <0.00%> (-2.08%) :arrow_down:
...urces/ElkArte/MessagesCallback/DisplayRenderer.php 90.00% <ø> (-0.20%) :arrow_down:
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 18fc6ab...a6bb97d. Read the comment docs.

codecov-commenter avatar Mar 28 '22 21:03 codecov-commenter

I think this is very cool .... When I was first playing with the micro data I was thinking it would be nice if I could trigger an event from the code !

Spuds avatar Mar 28 '22 22:03 Spuds

Spuds wrote on 3/29/22 12:31 AM:

I think this is very cool .... When I was first playing with the micro data I was thinking it would be nice if I could trigger an event from the code !

Little question: while working on this, I assumed that the trigger in the addon, should pass the states of the addon itself, not those of the controller, reason is the "addon of the addon" should be extending the addon and not the controller, otherwise it should hook up into the controller itself. @spuds do you think the reasoning works or should it always pass the states and variables of the controller?

emanuele45 avatar Apr 11 '22 18:04 emanuele45

I think that makes sense, I'd be able to give a better answer if (when) I work on an addon that utilizes the functionality, but rolling it around in my head extending the addon seems proper.

Spuds avatar Apr 11 '22 21:04 Spuds