Privatemsg for 6.x
Rick Nashleanas - December 8, 2008 - 16:25
| Project: | User Relationships |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | mansspams |
| Status: | needs review |
Description
It looks like privatemsg http://drupal.org/project/privatemsg is getting close to beta.
Once they release a beta, we can test the integration of user relationships with privatemsg.
Rick Nashleanas
www.monarchdigital.com

#1
I'd really like to see Privatemsg for 6.x
#2
It's getting close to RC3 now... :)
Michelle
#3
#4
subscribing
#5
oh yeah, since i know (for about 6 hours :) that i need both modules (UR and privatemsg) for my current project, it would be really great to have the implementation.
of course i'll helping out with testing and reporting.
regards and thanks a lot for your great work! :)
#6
subscribe
#7
subscribe
#8
subscribe
#9
Hell, yeah, I subscribe!
#10
Any news of progress? privatemsg is rc2 already, guess thats pretty close to release. Any social site built with User Relationships could benefit from integration.
#11
Sorry but realistically I won't be able to work on it in the near future, unless something changes. Perhaps someone with an itch to scratch can take it on and port the 5.x version. Thanks.
#12
Since I don't use UR on a D5 site, could someone explain what the integration does? Is it some sort of security where only your friends can PM you? I might be able to take a look at it if I knew what you were going for. No promises, though.
Michelle
#13
Michelle, UR-Privatemsg integration allows sending request/accept/reject notifications to the privatemsg inbox, instead of by email. IIRC it's not for privacy i.e. restricting who can contact a user based on their relationships. Although, thanks for this cool use case.
#14
Ah... Hmm... I wonder, in that case, if it might not be better to integrate with the notifications module? That module has a framework that allows you to choose where you want your notifications to go and I'm fairly sure PM is an option.
Michelle
#15
That would also allow us to scrap user_relationships_mailer module, too, as well as allow XMPP and SMS alerts.
Reading http://drupal.org/project/messaging however,
I'd rather go the notifications/messaging framework route, as I use it and not Privatemsg. But it doesn't solve the problem of this issue.
#16
Ah, darn. My site is still on D5 so I didn't realize that. Well, my feeling is integrating UR with notifications and then notifications with PM would be the way to go since it provides the most flexibility. But given that I'm all talk at this point, it is, of course, up to whoever ends up doing the coding. :)
Michelle
#17
We can rephrase today's exchanges thusly then: If someone implements Privatemsg 6.x for the Messaging framework, then I'll pitch in and help move UR to it, too. :)
#18
Ok, I went looking for an existing issue on noti/pm for D6 to link this to and found http://drupal.org/node/340676 which implies it's done but untested. If some of the people subscribed here could go test that out, that would be a good first step. :)
Michelle
#19
Tested. Privatemesg works with Notifications/Messaging. I can subscribe and receive information to PM on node changes/comments etc. Fresh install of D6.10 and -dev versions of Notifications, Messaging, Privatemsg, Token and admin_menu.
But... isn't what original poster was asking by integration meant that User Relations module would feed Privatemsg information on who is friends with whom and would allow private messages ONLY BETWEEN users related? I think they (and I) want this module to be ported to D6...
User Relationship Privatemsg (5.x only) integration with the privatemsg module showing your relationships in the quick select list.
(except drop the select list, autocomplete is the way to go imho)
#20
subscribe
#21
subscribing.
#22
subscribe.
#23
suscribing
#24
subscribing
#25
Im sorry, ported (a little, so i can see UI) this module and it turns out that it is what alex.k told it is. And its not what I have imagined it is.
This is actually what I imagined it is http://drupal.org/node/458046.
#26
@mannsspams could you post your port so that it can be integrated into UR? I think most other people in this issue were looking just for a straight port. So it would help a lot.
Thanks.
#27
@alex.k Im sorry, port is just Deadwood+some manual edit to see UI, nothing more is ported since I am beginner. You need that here?
#28
// offtopic on
Yes! I did it! My first contribution! Damn, that was not easy, lets just hope next ones comes with less pain :) I had to look up most simple php syntax and commands like print_r to see whats inside arrays, do copy paste over 200 times, stare at code for 50 hours, read tutorials, watch videos and yesterday I even shaved my head first time in my life (not because of this module, but because of heat). But i managed to find those 3 lines of code that do the magic! :)
// offtopic off
I attached module that lets UR integrate with Messaging module that in turn integrates with Privatemsg, Mail, SMS, Twitter etc. It is basically Mailer module with send method changed. Also I adjusted UI text so it reflects not only emails, but other kind of possible channels.
Known issues:
1) line brakes in emails are gone, message are delivered properly but in one block of text
2) Somebody has to test if in user_relationship_messages.module on line 95 $target and $message arrays has enough data for different send methods provided by Messaging. For reference see this page http://drupal.org/node/252684 and modules http://drupal.org/project/notifications and http://drupal.org/project/messaging_sendto
3) i could not test privatemsg, because latest versions of privatemsg and messaging does not play together again, they did in the beginning of April, but now somebody changed something i guess. Mail worked thou.
4) I am beginner, so doublecheck. Suggestion on "proper way to do stuff" welcome. Later ill learn to make patches and do fancy stuff like that, for now please accept .zip
#29
@mansspams thank you! The code looks pretty good at a first glance. Anyone who is watching the issue, please test.
#30
there is patch for messaging module (http://drupal.org/node/458366), so once again it plays nice with privatemsg and UR messages are sent successfully via messaging to privatemsg account, with no line brakes thou :) will test some more.
#31
@mansspams nice start. However, if I understand correctly you are trying to expose UR to Notifications and Messaging in order to gain PM capability (among the other channels that are supported by Messaging). So you really need to look at Notifications integration. Best place to look that I can think of is in the Organic Groups module. There is a sub-module that integrates OG with Notifications and thus Messaging. I think you have a good start but I do not think you want to focus on Messaging because what you are really trying to do is allow for user subscriptions to trigger notifications based on some event occurring with UR. There are some parameters that need to be set for Messaging, which it looks like you have in your code, but you really need to define the hooks for how you want the Notifications to work.
I think when you are done: When a user goes to their account settings there should be a new secondary tab under the Notifications tab that allows the user to choose what UR events they want to subscribe to and what sending method they prefer for each event - if Private Messaging with Notifications and Messaging is installed then that will be one of the options.
In short, I think you are missing a couple hooks for notifications and subscriptions. This would not be a patch but a sub module to UR in my opinion.
Hope that makes sense. And please do not get discouraged because I think you have a fantastic start for a first contribution. And I am still not sure after reading this thread several times if you really want Notifications and Messaging integrations. I think it would be cool and would give you Private Messaging but also adds a dependency to a couple other modules. I think the title of this issue should be changed if you really want Notifications and Messaging integration because it has bigger implications for UR than just PM.
R,
Coby
#32
and after all that i forgot to mention that integration with Notifications and Messaging does not (yet) give you the ability for two-way PM's between say users with some relationship. if that is what you are after it seems that it would make more sense to hook directly to the PM module???
and perhaps another place to look for examples would be the XMPP module - http://drupal.org/project/xmppframework since it has UR/Messaging/Notifications support.
r,
c
#33
ill see how far ill get and will post questions/code on the way. Thanks.
#34
subscribing
#35
Integration with notifications as described in #31 sounds like the way to go, resulting in a submodule for UR which you could enable if you need notification/messaging integration.
I think this could be fairly quickly integrated using the notification lite API. This is a submodule in the notifications module.
#36
Why has the functionality changed suddenly to only allowing private messages between friends? In my opinion it should be a sub-module or a setting so that it can be possible between all/friends/relationship types. I think private messages are the best way to contact strangers, asking if they know each other etc.
Currently this is possible when I look at someones profile, there is a "send pm" link, although it shouldn't be visible. At least that's how I read somewhere. If I try to write a message using the form and adding with auto-complete, I can only see my friends, but I can type a strangers name and the message will be sent.
#37
Yes, I am also encountering the problem of non-friends being able to manually type another user's name and successfully sending a pm. Is it possible to restrict private messages to only between friends?
Thank you.
#38
Autocomplete issue is captured in #522078: privatemsg autocomplete works only for relationships.
Not sure what you mean. There is a new feature that makes this a setting in the user profile. So individual users can decide if they want to limit PM only to their relationships. I'm not aware of other restrictions besides the autocomplete issue.
#39
Thanks for the link to "#522078: privatemsg autocomplete works only for relationships".
Like you said, no problems now with restricting PMs only to their relationships now.
#40
Hi,
what is the actual state concerning sending methods for UR-requests?
I would like to send / receive those notifications as private messages.
Thanks in advance for that lot of work!
Best regards,
Ralf
Subscribing...
#41
Ralf,
No one has implemented delivery via PM yet. As discussed above one way would be to add hooks for Notifications module to UR. Then it would send PMs via Messaging module.
The other way would be to clean up Rules integration module posted in #468764: Rules integration and send PMs from a rule (probably quite a bit less work to go this route).