add/remove somebody to/from some discussion

igorik - August 13, 2009 - 12:36
Project:Privatemsg
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Hi

I would like to see an option to add somebody to some privatemsg discussion
If now I send a privatemsg to some people, there is no chance to add there somebody later (or remove somebody)

It will be great to add this feature to roadmap of privatemsg module.

thanks
Igor
http://www.somvprahe.sk

#1

litwol - August 13, 2009 - 16:08

Please elaborate on this feature more. for example:
1) when adding a new user to conversation, do can they see all previou conversation or only new messages.
2) when removing user from conversation, do they keep old messages in the inbox, do they get notified that they were removed from the thread, etc etc...

Discuss this in more detail.

#2

Berdir - August 14, 2009 - 06:17

I have a working forward module, that allows to to forward a thread to someone and optionally remove yourself. I will release it soon.

#3

Berdir - August 14, 2009 - 14:59
Status:active» needs review

Ok, here is a first version.

Note: This has been tested, but only against a patched version of privatemsg.module. It *should* work with the current -dev version, but It has not been tested.

Features:
- Displays a Forward Thread form below the reply form
- Allows to forward a thread to 1-n users
- Optionally allows to remove yourself from the thread. The checkbox is currently enabled by default.
- It is also possible to write a reply and forward a thread at the same time.

AttachmentSize
privatemsg_forward-1.tar_.gz 1.33 KB

#4

igorik - August 14, 2009 - 19:34

Hi Berdir.

Thanks for your module. It will be probably exactly what I am looking for.

Unfortunately, it doesn't work with latest dev privatemsg.
The only thing which works is removing from thread. But (maybe it is a feature?) there isn't possible to remove myself without forwarding to somebody (there has to be some name in input for forwarding).

What doesn't work at all, is forwarding. I tried to forward some thread to some user (all roles had access for forwarding) but the recipient never got forwarding thread into his messages and he was not added into users in thread.
I am not sure if there is some info message about successfully forwarding(it could be helpful), but I never see anything, after forwarding I was moved to mysite/messages

I will be looking forward to see next version of this your handy module.
thanks and have a nice day
Igor

#5

igorik - August 14, 2009 - 19:53

Hi Litwol
thanks for detailing questions. I didn't think so much about it, now I did it and my opinions are:

1) when adding a new user to conversation, do can they see all previou conversation or only new messages.
I think that a new added user could see all thread of conversation.
But the possible option is to choose (radiobutton) if forwarding user will see
a) all conversation
b), or nothing (in this case would be useful if there will be some small textarea for writing some info about topic of forwarding conversation, for keeping a new recipient in context) and he will see only new conversation after date he join into.

2) when removing user from conversation, do they keep old messages in the inbox, do they get notified that they were removed from the thread, etc etc...
a) This could be wide solution, depends if only user can remove himself from thread, or admin/owner of discussion/man with proper acces could have to remove some other from discussion.
b)if user is removed by himself, I suppose only to show info message that he is removed from the thread and that thhread is removed from his messages. If the user is removed by somebody else, than he could got a message, that he was removed from thread xxx because - reason.

For my needs (and probably generally for most people needs) will be the part 1a and 2a enough, the 1b and 2b are just an ideas.

Have a nice weekend
Igor

#6

Berdir - August 14, 2009 - 21:45
Status:needs review» postponed

Ah, I see.

To avoid a bug when a recipient is added multiple times, it does check if he can already see that message. However, that functionality depends on the changes in _privatemsg_load from #298502: Better access to another user's messages.

Marking this postponed on that issue, but you can of course apply the other patch and then try this again.

Hint: Even as it does not work currently, it should still display a confirmation message.

#7

igorik - August 15, 2009 - 08:10
Status:postponed» active

Hi Berdir,
I applied latest patch from that thread (privatemsg_readall_7.patch) and now your forwarding module works like a charm. Great! Thanks.

The only problem is that the field for forwarding recipients name is required, so you can't remove yourself from thread without typing someone into that field. Btw, I didn't receive any confirmation message after successfully forwarding.

Edit: I change module code, and set required for "To" as false; '#required' => FALSE,
and default value for Remove myself from the thread to false; '#default_value' => FALSE,
So now it works fine for me.

The only thing what doesn't work is that drupal_set_message(drupal_set_message(t('Forwarded thread %subject... ) is not shown to me after forwarding. Maybe there could be yet another one after removing from the thread.

Thanks again and have a nice day.

#8

igorik - August 15, 2009 - 08:24
Status:active» fixed

#9

Berdir - August 15, 2009 - 08:33
Status:fixed» postponed

No, it hasn't :)

This is a new feature, so others might be looking for it too, don't set it to fixed unless it has been added to privatemsg CVS.

#10

igorik - August 15, 2009 - 08:49
Status:postponed» fixed

Maybe one more feature request/bug for this module. When the message has only two recipients - author of the message and 1 recipient, and the recipient (not the author) remove himself from the thread, then the message is removed from it's author messages list too.
I suppose let the message in it's author inbox.

#11

Berdir - August 15, 2009 - 09:06
Status:fixed» postponed

#12

igorik - August 15, 2009 - 11:36

sorry for changing status, I didn't know you wrote reply between my two replies.

#13

igorik - August 15, 2009 - 12:02

Hi Berdir,
please note that forwarding doesn't respect user blocking.
Although I can't send a message to someone who block messages of me, I still can add this user into any thread using forwarding.

#14

Berdir - September 12, 2009 - 09:34
Status:postponed» needs work

read all has been commited, setting this back to needs work.

#15

Berdir - September 15, 2009 - 23:49
Version:6.x-2.x-dev» 6.x-1.x-dev
Status:needs work» needs review

Ok, updated the the module and made a few changes..

- to field is optional now, to make replying work again. Not sure if it should be allowed to remove themself from a thread without forwarding. maybe different permissions for forward/remove self?

- blocking rules are now checked when forwarding

Not that there is a small bug related to blocking, the recipients are currently validated even if no message is sent, so a warning is displayed if the thread contains participants that block you. This can be fixed with the attached patch.

AttachmentSize
privatemsg_forward-2.tar_.gz 1.59 KB
privatemsg_validate_fix.patch 1.37 KB

#16

jaron - October 29, 2009 - 17:44

with the newest 6.x-1.x-dev i'm getting the following error whenever i try to forward a thread:

Fatal error: Call to undefined function _privatemsg_load() in /Applications/MAMP/htdocs/10_27ddoMirror/sites/all/modules/privatemsg/privatemsg_forward/privatemsg_forward.module on line 113

does this have something to do with my setup or is there a new conflict with the newest dev build?

thanks.

#17

Berdir - October 29, 2009 - 17:48
Status:needs review» needs work

This is a conflict. I'll re-roll this soon.

You can simply replace "_privatemsg_load" with "privatemsg_message_load" but there might be other conflicts as well.

#18

jaron - October 29, 2009 - 18:17

that did solve the error. i will let you know if i see any other conflicts.

i also am noticing that if someone removes themselves from a thread when forwarding, any message they have written is not included in the forwarded message. if they are simply forwarding the thread to include a new participant, the message is included, but when the "remove myself" box is enabled, the newly typed message is not included. this is a very nuanced difference for a user to intuit. i think it would make more sense for the module to check if there is anything in the message box and include it in the thread prior to making either of the participant side changes. from a user perspective it is much simpler that way.

#19

Berdir - October 29, 2009 - 23:19

Updates:

- Rerolled against latest -dev release of privatemsg
- Forwarding a message could result in a strange order of the messages for the "new" user. Requires a patch.
- Added a few test cases as it seems that I'm always breaking a feature when fixing a bug :)

As said already in other places, the sub-module won't make it into the 1.0 release but I will most probably include the patch once that has been tested a bit more. So please report if everything works.

AttachmentSize
privatemsg_forward-3.tar_.gz 2.59 KB
privatemsg_validate_sorting.patch 2.2 KB

#20

Berdir - October 29, 2009 - 23:20
Status:needs work» needs review

#21

jaron - October 30, 2009 - 00:53
Status:needs review» needs work

hi berdir,

the new build seems really good. i'm noticing one issue. if the sender selects to remove themselves from the thread without forwarding it to anyone (just to remove themselves from a multiple participant thread), any comment is lost. however, if the sender selects to remove themselves and selects someone to forward it to, their comment is saved into the thread. is there anyway to just have the comment always saved into the thread?
i think it will be useful for people in multiple participant threads to be able to comment and remove themselves.

everything else seems to be working great.

thanks.

#22

Berdir - October 30, 2009 - 08:20
Status:needs work» needs review

Yeah, I missed those two use cases in my tests. Fixed the bug and updated the tests.

#23

Berdir - October 30, 2009 - 08:21

Uploading the module would help a lot.

AttachmentSize
privatemsg_forward-4.tar_.gz 2.64 KB

#24

jaron - October 30, 2009 - 15:38

do we still need to use the patch on privatmsg.module with the current -4 build?

#25

Berdir - October 30, 2009 - 15:44

Yes, the patch does fix two bugs in privatemsg.module that are only visible when using this module.

#26

jfulton - November 2, 2009 - 22:58

Thanks for this submodule. But why is forwarding a separate action rather than adding a person to the message when replying? Is it possible to allow for the addition of users ON the actual message or response?

#27

Berdir - November 3, 2009 - 00:35

you can combine add participant/remove me/reply in any way you want, just enter a reply and press "Forward thread".

#28

Berdir - November 12, 2009 - 14:36

Commited the patch in #19 against 6.x-1.x-dev and 7.x-1.x-dev, this module should now work correctly without the need of a patch.

Hint: The D7 Port also contained a few other bugfixes that were necessary due to changes in Drupal 7.

 
 

Drupal is a registered trademark of Dries Buytaert.