Outgoing messages can not be altered by other modules. This is useful to prevent certain messages going out, or certain users from receiving certain messages. It can also be used as a profanity filter, or translator, for "talk like a pirate day", upside down english and other fun things.

The attached patch abstracts bot_message() and bot_action() into bot_message_helper() to improve code re-use, and adds an _alter hook to each of the existing irc_bot_reply_message and irc_bot_reply_action hooks.

Implementations of the hook are called directly from bot_message_helper() instead of via module_invoke_all() in order to allow implementations to receive the parameters by reference.

This is related to #918966: Drupal 6 backport of bot.smartirc.inc & hook_irc_access() but is not duplicate, as hook_irc_access() prevents incoming messages from being processed, while hook_irc_bot_reply_message_alter() lets them be processed but can modify outgoing messages.

CommentFileSizeAuthor
bot-irc_bot_reply_alter.patch2.62 KBBevan
Support from Acquia helps fund testing for Drupal Acquia logo