Replies: 5 comments 13 replies
-
More info can be found at plugins/README.md |
Beta Was this translation helpful? Give feedback.
-
Yes what you wrote is correct. There are some caveats though. Most can be found in existing plugins, but a good documentation for each would be nice. I've also made a big change in the smtp/imap/sieve hooks to make them more powerfull. |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for your reply! |
Beta Was this translation helpful? Give feedback.
-
Wiki would be better and then split into multiple pages |
Beta Was this translation helpful? Give feedback.
-
Hi @the-djmaze
|
Beta Was this translation helpful? Give feedback.
-
Hi,
because I'm trying to write a plugin for SnappyMail I tried to understand the logic how everything is connected - as at the moment there is no documentation for developers I would like to ask if my thoughts are correct. Maybe this could be the first step to produce some documentation regarding the development of plugins etc. 🙂.
Please correct me if I'm wrong (and as I'm new to this, this could happen often 🙈😄). It's also possible that I'm using some wrong words - sorry about that...
History of SnappyMail / Rainloop
For me it made some things clearer to understand how SnappyMail was created.
Rainloop initially was written by Timur Usenko who worked at AfterLogic. He wrote the library MailSo that handles the main part of the IMAP functions in SnappyMail.
As Rainloop does not seem to be under heavy development the project was took by @the-djmaze to create SnappyMail.
SnappyMail therefore contains the code of Rainloop, but has been modified a lot to bring it to a next level.
How SnappyMail gets started and how Hooks work
snappymail/snappymail/v/0.0.0/app/libraries/RainLoop/Service.php
Line 10 in efbc756
snappymail/snappymail/v/0.0.0/app/libraries/RainLoop/Api.php
Line 19 in efbc756
BootEnd()
in Actions.phpsnappymail/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php
Line 122 in efbc756
snappymail/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php
Line 154 in efbc756
As the
Init()
function of every plugin is called by Manager.php inside this function each plugin can register itself to be launched (=callback function) at various points in the code of SnappyMail (=hooks).SnappyMail calls the functions registered by the single plugins by launching the function
RunHook
:snappymail/snappymail/v/0.0.0/app/libraries/RainLoop/Plugins/Manager.php
Line 313 in efbc756
The function
fabrica
snappymail/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php
Line 179 in efbc756
This functions seems to be a central part of the code. It returns needed objects by checking the passed variable
$sName
. For example it returns a FileStorage Object when$sName
contains'files'
. Alsofabrica
callsRunHook
twice (hook namemain.fabrica
andfilter.fabrica).
fabricais called often and therefore a plugin inside his callback function should check for example the content of
$sName` that is also passed to the callback function.Searching for the best hook
As at the moment there is no detailed documentation it is possible to search for hooks by doing a fulltext search for the string
RunHook(
this returns every active hook and his circumstances.Beta Was this translation helpful? Give feedback.
All reactions