diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 821f0d970d..5c0c182f4f 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -55,6 +55,24 @@ class messenger $this->vars = $this->msg = $this->replyto = $this->from = ''; $this->mail_priority = MAIL_NORMAL_PRIORITY; } + + /** + * Set addresses for to/im as available + * + * @param array $user User row + */ + function set_addresses($user) + { + if ($user['user_email']) + { + $this->to($user['user_email'], ($user['username']) ?: ''); + } + + if ($user['user_jabber']) + { + $this->im($user['user_jabber'], ($user['username']) ?: ''); + } + } /** * Sets an email address to send to diff --git a/phpBB/includes/notification/method/messenger_base.php b/phpBB/includes/notification/method/messenger_base.php index 2f9073e80b..4966aa94bc 100644 --- a/phpBB/includes/notification/method/messenger_base.php +++ b/phpBB/includes/notification/method/messenger_base.php @@ -80,7 +80,7 @@ abstract class phpbb_notification_method_messenger_base extends phpbb_notificati $messenger->template($template_dir_prefix . $notification->get_email_template(), $user['user_lang']); - $messenger->to($user['user_email'], $user['username']); + $messenger->set_addresses($user); $messenger->assign_vars(array_merge(array( 'USERNAME' => $user['username'],