Closed (won't fix)
Project:
Privatemsg
Version:
6.x-2.x-dev
Component:
Code (pm_block_user)
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2008 at 12:58 UTC
Updated:
26 Jul 2016 at 14:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jonas28 commentedsounds very cool, i´m interested in this feature, too!
Comment #2
bentonboomslang commentedI would like this feature too. Where should I look to in the code if I wanted to write this myself?
B
Comment #3
litwol commentedLook at user relationship module, it has integration with privatemsg that limits name autocompletion to people that you know.
Comment #4
mdih commentedsubscribing...
Comment #5
berdirYou can read about that here:
Introduction to our query builder: http://blog.worldempire.ch/de/api/group/sql/1
This is the hook you need to use: http://blog.worldempire.ch/de/api/function/hook_privatemsg_sql_autocompl...
And this is how the query looks by default: http://blog.worldempire.ch/de/api/function/privatemsg_sql_autocomplete/1
As you can see in the last link, the example hook is outdated, it should be $fragments['query_args']['where'][] instead of just $fragments['query_args'][]
A short example to limit the autocomplete to a specifc role:
I consider this issue a fixed as the question was how to code it. If you are looking for integration with a specific module, I suggest to open a new issue for that module and point to this issue. However, if you have more technical questions, feel free to re-open this.
Comment #7
boobaaAttached is a patch that adds a new submodule:
privatemsg_limitroles. It provides a simple settings form: rows are sender roles, columns are recipient ones, cells are checkboxes, which must be ticked to allow sending private messages in that direction. The (sub)module prohibits sending messages to users that are not members of allowed recipient roles for any of the sender's roles. (Heck, it's much easier to understand the UI than these description...)Comment #8
boobaaAbove patch has one flaw: sending to authenticated users is not handled properly. Here is the corrected patch, now rolled against 6.x-1.2.
Comment #9
boobaaPatch in #8 works fine for 6.x-1.3 as well. Here is the corrected patch for 6.x-2.x-dev.
Comment #10
berdirpm_block_user.module already provides this functionality? What's the difference in your module? The description sounds pretty much the same, except that can set up rules and choose sender/recipient role from a select.
Comment #11
boobaaUh-oh, I wasn't aware of pm_block_user.module's functionality. While skimming through it, I can spot only one difference: while pm_block_user follows the "allow all, then deny some" way, privatemsg_limitroles goes the other: "deny all, then allow some" - which may be easier to set up in some particular use cases. YMMV.
Comment #12
berdirAh, yeah. We originally had the idea that there would be a way to switch between these two principles (not sure what the right word is here..)
:
Would be awesome if you could integrate that somehow into pm_block_user :)
First step before doing any code would be to find a way how the UI would work I guess, I'm not sure about that yet. The issue that added this feature is #267814: Setting to define certain roles (e.g. staff) which a user cannot block PMs from, don't remember the discussion we had there in detail.
Comment #13
berdirSee above...
Comment #14
berdirTrying to give this a better title so that I can more easily find it again.
Comment #15
berdirComment #16
oadaeh commentedThis issue is being closed because it is against a branch for a version of Drupal that is no longer supported.
If you feel that this issue is still valid, feel free to re-open and update it (and any possible patch) to work with the 7.x-1.x branch (bug fixes only) or the 7.x-2.x branch.
Thank you.