function messaging_message_callbacks in Messaging 6.2
Same name and namespace in other branches
- 6 messaging.module \messaging_message_callbacks()
- 6.3 messaging.module \messaging_message_callbacks()
Invoke ordered list of callbacks on message
For each callback name this function will search existing callbacks in $info ('[name] callback') and if not existing will try the default callback 'messaging_message_[name]'
Parameters
$callback_keys: Array of callbacks to invoke, ordered list
$message: Message object
$info: Messaging method info which may contain callbacks
See also
_messaging_callback() for callback structure
3 calls to messaging_message_callbacks()
- Messaging_API_Tests::testMessagingBasicAPI in tests/
messaging_api.test - Exercise basic API functions
- messaging_message_send in ./
messaging.module - Send message to array of destinations. The message is rendered just once.
- messaging_store_queue_process_step in ./
messaging.store.inc - Retrieve and send queued messages
File
- ./
messaging.module, line 1111
Code
function messaging_message_callbacks($callback_keys, $message, $info) {
while (!empty($message->process) && ($key = array_shift($callback_keys))) {
if ($callback = _messaging_callback_get($info, $key)) {
$message = messaging_message_invoke($callback, $message, $info);
}
elseif (function_exists('messaging_message_' . $key)) {
$message = call_user_func('messaging_message_' . $key, $message, $info);
}
}
return $message;
}