1. Please make available a function to use an link to block or unblock messages.

The function output should show the link in the dependency status - if user blocked or if user not blocked.

2. In this context
it is a good idea you extend the function privatemsg_user_access() and check if a user blocked. The result: If a user blocked the link to write a message are not displayed.
If this functionality realized the views_handler_field_privatemsg_link will then work with this feature. A dream should be it so.

Conclusively

I am very surprised that my requested functionality is not implemented yet.
This is simple logik and simple development and makes better usability and better usage for users (themers and developers) of the PM module.

Comments

berdir’s picture

Version: 6.x-1.3 »

1. Patches are welcome. All you need to do is separate the whole logic out of http://blog.worldempire.ch/de/api/function/pm_block_user_privatemsg_mess... into a separate function, which gets passed $author and $user object and then returns the correct link. Problem might be that we loose the context (array key) if it is a block or unblock link but that's not so important.

2. That functionality is part of privatemsg_get_link(), privatemsg_user_access() doesn't have the necessary context to decide if the user has permission or not.

No new features are added to 6.x-1.x, so if you make a patch, you should do that against the 6.x-2.x branch.

berdir’s picture

Title: block/unblock link functionality; extend privatemsg_user_access() » API function to get block/unblock link
Component: Code » Code (pm_block_user)
berdir’s picture

Also note that there is already an API function 6.x-2.x: http://blog.worldempire.ch/api/function/pm_block_user_has_blocked/6-2 to check if a user has blocked another one.

rmarino’s picture

Very nice, so the link to block/unblock a user is
href="/messages/block/$uid"

ptmkenny’s picture

Version: » 7.x-2.x-dev
Category: task » feature
Priority: Major » Normal
Status: Active » Closed (fixed)