hi, here's a patch for pm_block_user that adds a function to determine if a user may write a message to another user

* less code for you to maintain
* api for developers/themers to determine if a user is blocked or not

Comments

berdir’s picture

Status: Needs review » Needs work

The hooks has changes, so this needs to be re-rolled and probably support multiple recipients.

black silence’s picture

Status: Needs work » Needs review
StatusFileSize
new1.14 KB

re-patched for current dev

the part with less code is now irrelevant, but it's still an api for other modules

berdir’s picture

Status: Needs review » Closed (won't fix)

Hm, not sure.

You can use privatemsg_get_link, which will return an URL if you are allowed to send a message to someone. The difference is, that privatemsg_get_link() does not only use pm_block_user but it does also check all permissions and any other modules that might implement hook_privatemsg_block_message().

http://blog.worldempire.ch/api/function/privatemsg_get_link

Also, this does not check the new rule-based configuration options, so I'm setting this to won't fix, feel free to re-open if you disagree.