=== modified file 'sites/all/modules/messaging/includes/messaging_destination.class.inc'
--- sites/all/modules/messaging/includes/messaging_destination.class.inc	2010-06-29 10:25:58 +0000
+++ sites/all/modules/messaging/includes/messaging_destination.class.inc	2010-08-08 00:43:08 +0000
@@ -94,8 +94,11 @@ class Messaging_Destination extends Mess
    *   Address value
    * @param $account
    *   Optional user id or account object the destination is intended for
+   * @param $error
+   *   IF the function's return value is FALSE, MAY contain an error message.
+   *   The input value is not used. Pass empty value to prevent confusion.
    */
-  public static function validate_method($method, $address, $account = NULL) {
+  public static function validate_method($method, $address, $account = NULL, &$error = '') {
     // First validate address and check permission
     $send_method = messaging_send_method($method);
     if (!$send_method || !$send_method->address_validate($address)) {
@@ -108,7 +111,7 @@ class Messaging_Destination extends Mess
       }
     }
     if ($type = messaging_method_info($method, 'address_type')) {
-      return self::validate_type($type, $address, $account);
+      return self::validate_type($type, $address, $account, $error);
     }
   }
   /**
@@ -121,7 +124,7 @@ class Messaging_Destination extends Mess
    * @param $account
    *   Optional user id or account object
    */
-  public static function validate_type($type, $address, $account = NULL) {
+  public static function validate_type($type, $address, $account = NULL, &$error = '') {
     // First try validate callback for this address type
     if (!self::validate_address($type, $address)) {
       return FALSE;
@@ -131,12 +134,17 @@ class Messaging_Destination extends Mess
       if ($existing = self::get_by_address($type, $address)) {
         // There's already a destination with these parameters, check user
         // It will be ok if users match or it was anonymous before
-        return !isset($account) || !$existing->uid || $existing->uid == $uid;
+        $ok = (!$existing->uid || $existing->uid == $uid);
       }
-      elseif ($address_uid = self::address2uid($type, $address)) {
+      else {
         // Ok if this address belongs to the same user or to no user 
-        return !$address_uid || $address_uid == $uid;
+        $address_uid = self::address2uid($type, $address);
+        $ok = (!$address_uid || $address_uid == $uid);
+      }
+      if (!$ok) {
+        $error = 'This address belongs to another already-registered user.';
       }
+      return $ok;
     }
     return TRUE;
   }

=== modified file 'sites/all/modules/notifications/includes/destination.inc'
--- sites/all/modules/notifications/includes/destination.inc	2010-07-22 20:43:55 +0000
+++ sites/all/modules/notifications/includes/destination.inc	2010-08-07 22:14:29 +0000
@@ -27,10 +27,10 @@ function notifications_destination_get_s
 /**
  * Validate destination for method
  */
-function notifications_destination_validate($method, $address, $account) {
+function notifications_destination_validate($method, $address, $account, &$error = '') {
   // Check the method is valid for this account
   $valid_methods = notifications_send_methods($account);
-  return isset($valid_methods[$method]) && Messaging_Destination::validate_method($method, $address, $account);
+  return isset($valid_methods[$method]) && Messaging_Destination::validate_method($method, $address, $account, $error);
 }
 
 /**
@@ -175,11 +175,12 @@ function notifications_destination_parse
     'uid' => messaging_user_uid($account),
   );
   if ($validate) {
+    $error = '';
     if (!$method || !$address) {
       form_set_error($field, t('You need to enter exactly one destination address.'));
     }
-    elseif (!notifications_destination_validate($method, $address, $account)) {
-      form_set_error($field, t('This destination address is not valid.'));
+    elseif (!notifications_destination_validate($method, $address, $account, $error)) {
+      form_set_error($field, $error ? t($error) : t('This destination address is not valid.'));
     }
     else {
       // If this is a valid one, we store it on the form values

