Closed (fixed)
Project:
User Relationships
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 May 2009 at 06:51 UTC
Updated:
7 Nov 2009 at 22:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
henrijs.seso commentedYes, its possible, i did some digging and here are my take one on this issue. This module will block messages to users who has no relationships with sender. It uses universal_relation_api.
Todo:
1) autocomplete field in message forms should be populated with friends only
2) send message to user link in profiles must not display for users with no relations
Known issues:
1) it displays Failed to send to ID 0 in user profiles, must add some line to check if uid = 0 and stop the script
If anyone cares, please take a look at code and see if things could be done better way, i am beginner and could use some advice.
Comment #2
henrijs.seso commentedComment #3
henrijs.seso commentedNew, proper code, thanks to Berdir (http://drupal.org/node/371034).
No more known issues, just works. Will try to fix autocomplete.
Comment #4
henrijs.seso commentedOne more change in code...
Comment #5
henrijs.seso commentedUpdated with working autocomplete field.
Now this module does 2 things
1) blocks messages to users that has no relationships with sender and
2) feeds list of usernames with relationships to sender into new privatemsg To: autocomplete field.
Please test if you need something like this.
Comment #6
alex.k commentedWorks great, thank you. One question: should privatemsg be allowed in both directions when relationship is one-way? Currently, if A is a fan of B, that gives A the right to write to B, but B cannot reply back to A.
Two possibilities:
* allow privatemsg in both directions even if relationship is one-way
* allow replies only from requestee back to requester (this would be really cool, but I don't know privatemsg enough to see if it's easy to do)
Other than that, great code.
Comment #7
SuleymanK commentedi need this module for 5.x
do you have time to backport this module?
Comment #8
alex.k commentedCommitted code in #5, see http://drupal.org/cvs?commit=228152. Moved it into an include file in UR-API module, and also merged with a patch from #257748: Allow users to only accept PMs from people on their buddylist providing a checkbox in the user profile that allows users to choose if they want to restrict PMs to just relationships or allow everyone. The question in #6 remains open, if anyone wants to work on it. Thanks again @mansspams
Comment #9
alex.k commentedComment #11
alex.k commentedFollow-up bug in #514012: User Relationships integration with Privatemsg autocomplete error.
Comment #12
alex.k commentedA ticket that requests a switch to turn the autocomplete portion on/off is #522078: privatemsg autocomplete works only for relationships
Comment #13
kvvnn commentedWhat do you think about adding an admin-side switch like this :
1) Let users decide to allow PM's for only friends or for all users (current)
2) Allow all users to PM each other (previous)
3) Allow the following relationship types to PM each other : (i guess a previous bug)
list of Relationships Types
Comment #14
vinoth.3v commented+1 for this request and Thanks for the fix. This switch greatly reduces the spam pms.
Now,
1, lets see one situation.
for any community site, there will be admin, moderators, etc. They must have a chance to send private messages regarding site ploicy, terms etc to others regardless of the User relationships they have.
for example, admin could send message to any user and they have to reply to. In that case we can't check user relationships.
ok, My idea is to have a permission 'send privatemsg to any'. so that, based on the roles we can set this permission.
2, what you think about 'receive privatemsg from any' ?
3, Admin have the default option to set is "allow to all, but users can change"
is any option to set default to "only confirmed relations" and lets users to change?
4, I think for admin:
option to set default method : "only to relations" / "to any users"
for users:
option to enable/disable
a new permission:
"allow override pm settings" (or some other best suitable term)
what you think?
Comment #16
alex.k commented@4vinoth
Those would be nice features, for sure. The problem is, I don't use privatemsg and don't have the time to put towards that direction :( If somebody wants to co-own development of UR-Privatemsg integration that would surely be great.
Comment #18
alex.k commentedA bugfix for #597112: Private Message autocomplete to multiple friends not working rewrote the way the autocomplete query is constructed, so testing that it still works for everyone would be appreciated. Please post any feedback in that issue.