You are here

function messaging_notify_aftersend in Messaging 6

Messaging aftersend callback

1 string reference to 'messaging_notify_aftersend'
messaging_notify_messaging_methods_alter in messaging_notify/messaging_notify.module
Implementation of hook_messaging_methods_alter()

File

messaging_notify/messaging_notify.module, line 317
Subscriptions to messaging events

Code

function messaging_notify_aftersend($message, $info) {

  // Make sure the message is stored
  $message = messaging_message_store($message);

  // Now trigger notifications event
  $event = array(
    'uid' => $message->sender,
    'oid' => $message->mqid,
    'type' => 'message',
    'action' => 'sent',
    'message' => $message,
    'params' => array(
      'mqid' => $message->mqid,
    ),
  );
  notifications_event($event);
  return $message;
}