add 'author_is_pmable()' function with plugin hooks to control whether or not to display a 'send mail' link in the thread author menu.

This commit is contained in:
zotlabs
2017-03-27 15:49:48 -07:00
parent 8292553a20
commit 3e6088c614
3 changed files with 42 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
[h2]author_is_pmable[/h2]
Called from thread action menu before returning a 'send mail' link for the post author. Not all authors will be able to receive private mail, for instance those on other networks with incompatible mail systems.
By default author_is_pmable() returns true for 'zot' xchans, and false for all others.
The plugin is passed an array
[ 'xchan' => $author_xchan, 'result' => 'unset' ]
A plugin which sets the 'result' to something besides 'unset' will over-ride the default behaviour. A value of true will enable the 'send mail' link and the private mail recipient will be set to the author's xchan_hash. A value of false will disable the 'send mail' link.