This file .inc support events for private message.

CommentFileSizeAuthor
privatemsg.inc_.txt4.49 KBfagati
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fago’s picture

Status: Active » Needs work

cool to see you working on this!

First off, please submit it as patch to the private message module, as it should provide its own workflow-ng integration.

To the patch:
* you don't need your hook entity info implementation, as it contains nothing
* you don't need handlers for entities that are already passed to the event. just set no #handler. But how is it possible that the same $msg has a lot of different entities?
* clean your code up, add a doxygen for the whole file, remove all debug statements, even one which is commented out. check coding style, e.g. its not
'#saved'=>true,'#entity' => 'pm',
but
'#saved' => TRUE, '#entity' => 'pm',

Anyway, is the pm really saved after the event? Then you should pass it by reference. Otherwise remove #saved.

fagati’s picture

Ok Thanks.
A question on handler. Why i must leave it. Without handler i can't populate the arguments with value.

if i don't use for example the function privatemsg_arguments_message($msg) how can i use in condintion text comparison for match the message body with a regular expression?

$msg is an object not a string

fago’s picture

Component: Code » Module Integration

you could provide token integration for the message or provide an extra condition for that case. The problem with your arguments is that it is X times the same.