? buddylist_theme_username_181113_1.patch
Index: buddylist.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/buddylist/buddylist.module,v
retrieving revision 1.68.2.34
diff -u -F^f -r1.68.2.34 buddylist.module
--- buddylist.module	21 Sep 2007 21:44:12 -0000	1.68.2.34
+++ buddylist.module	8 Oct 2007 19:26:57 -0000
@@ -751,23 +751,23 @@ function theme_buddylist_cancel_action($
 }
 
 function theme_remove_from_buddylist_link($buddyuser) {
-  return l(t('Remove %name from my @buddylist', array('%name' => $buddyuser->name) + buddylist_translation()), 'buddy/delete/' . $buddyuser->uid, NULL, drupal_get_destination(), NULL, FALSE, TRUE);
+  return l(t('Remove'), 'buddy/delete/' . $buddyuser->uid, array('title' => t('Remove User')), drupal_get_destination(), NULL, FALSE, TRUE);
 }
 
 function theme_add_to_buddylist_link($buddyuser) {
-  return l(t('Add %name to my @buddylist', array('%name' => $buddyuser->name) + buddylist_translation()), 'buddy/add/' . $buddyuser->uid, NULL, drupal_get_destination(), NULL, FALSE, TRUE);
+  return l(t('Add'), 'buddy/add/' . $buddyuser->uid, array('title' => t('Add User')), drupal_get_destination(), NULL, FALSE, TRUE);
 }
 
 function theme_buddylist_accept_request_link($requestee_uid, $requester_uid) {
-  return l(t('Accept'), 'buddylist/' . $requestee_uid . '/buddies/requested/accept/' . $requester_uid, array('title' => 'Accept'), drupal_get_destination(), NULL, FALSE, TRUE);
+  return l(t('Accept'), 'buddylist/' . $requestee_uid . '/buddies/requested/accept/' . $requester_uid, array('title' => t('Accept')), drupal_get_destination(), NULL, FALSE, TRUE);
 }
 
 function theme_buddylist_deny_request_link($requestee_uid, $requester_uid) {
-  return l(t('Deny'), 'buddylist/' . $requestee_uid . '/buddies/requested/deny/' . $requester_uid, array('title' => 'Deny'), drupal_get_destination(), NULL, FALSE, TRUE);
+  return l(t('Deny'), 'buddylist/' . $requestee_uid . '/buddies/requested/deny/' . $requester_uid, array('title' => t('Deny')), drupal_get_destination(), NULL, FALSE, TRUE);
 }
 
 function theme_buddylist_sent_requests_cancel_link($requestee_uid, $requester_uid) {
-  return l(t('Cancel'), 'buddylist/' . $requestee_uid . '/buddies/request/cancel/' . $requester_uid, array('title' => 'Cancel'), drupal_get_destination(), NULL, FALSE, TRUE);
+  return l(t('Cancel'), 'buddylist/' . $requestee_uid . '/buddies/request/cancel/' . $requester_uid, array('title' => t('Cancel')), drupal_get_destination(), NULL, FALSE, TRUE);
 }
 
 /**
@@ -950,7 +950,7 @@ function buddylist_pending_requested_den
   $requester_account = user_load(array('uid' => $requester_uid));
   $output = confirm_form(
     buddylist_confirm_form($requester_account, $requestee_account),
-    t('Accept Request'),
+    t('Deny Request'),
     'buddylist/'.$requestee_uid.'/buddies/requests',
     t("Are you sure you want to deny the request from !name?", array('!name' => theme('username', $requester_account))),
     t('Yes'), t('No'),
@@ -1402,7 +1402,7 @@ function buddylist_addbuddy($uid) {
     $form['name'] = array('#type' => 'hidden', '#value' => $buddy->name);
     $output = confirm_form(
       $form,
-      t('Add user %name to your @buddylist?', array('%name' => $buddy->name) + buddylist_translation()),
+      t('Add user !name to your @buddylist?', array('!name' => theme('username', $buddy)) + buddylist_translation()),
       $_GET['destination'],
       '',
       t('Add'), t('Cancel'),
@@ -1422,7 +1422,8 @@ function buddylist_addbuddy_submit($form
   }
   else {
     buddylist_add($form_values['uid']);
-    drupal_set_message(t('%name will be be notified the next time s/he logs in.', array('%name' => $form_values['name'])));
+    $user = user_load(array('uid' => $form_values['uid']));
+    drupal_set_message(t('!name will be notified the next time s/he logs in.', array('!name' => theme('username', $user))));
   }
   return 'user';
 };
@@ -1446,7 +1447,7 @@ function buddylist_deletebuddy($uid) {
     $form['name'] = array('#type' => 'hidden', '#value' => $buddy->name);
     $output = confirm_form(
       $form,
-      t('Remove user %name from your @buddylist?', array('%name' => $buddy->name) + buddylist_translation()),
+      t('Remove user !name from your @buddylist?', array('!name' => theme('username', $buddy)) + buddylist_translation()),
       $_GET['destination'],
       '',
       t('Remove'), t('Cancel'),
@@ -1460,8 +1461,12 @@ function buddylist_deletebuddy($uid) {
  * Confirm and add a buddy.
  */
 function buddylist_deletebuddy_submit($form_id, $form_values) {
+  $removeuser = user_load(array('uid' => $form_values['uid']));
   buddylist_remove($form_values['uid']);
-  drupal_set_message(t('@name will be be notified of being removed.', array('@name' => $form_values['name'])));
+  if (variable_get('buddylist_send_remove', FALSE))
+    drupal_set_message(t('!username will be notified of being removed.', array('!username' => theme('username', $removeuser))));
+  else
+    drupal_set_message(t('!username has been removed from your @buddylist', array('!username' => theme('username', $removeuser)) + buddylist_translation()));
   return 'user';
 };
 
@@ -1477,11 +1482,11 @@ function buddylist_add($id) {
     if (variable_get('buddylist_send_add', FALSE)) {
       buddylist_mail_user('add', $user_to_add);
     }
-    drupal_set_message(t('%username has been added to your @buddylist', array('%username' => $user_to_add->name) + buddylist_translation()));
+    drupal_set_message(t('!username has been added to your @buddylist', array('!username' => theme('username', $user_to_add)) + buddylist_translation()));
     module_invoke_all('buddylist', 'add', $user_to_add, $user, true);
   }
   else {
-    drupal_set_message(t('%username is already on your @buddylist', array('%username' => $user_to_add->name) + buddylist_translation()));
+    drupal_set_message(t('!username is already on your @buddylist', array('!username' => theme('username', $user_to_add)) + buddylist_translation()));
   }
 }
 
@@ -1498,17 +1503,17 @@ function buddylist_add_request($id) {
     if (variable_get('buddylist_send_request', FALSE)) {
       buddylist_mail_user('request', $user_to_add);
     }
-    drupal_set_message(t('Your request to add %username to your @buddylist has been submitted.  %username will be notified.', array('%username' => $user_to_add->name) + buddylist_translation()));
+    drupal_set_message(t('Your request to add !username to your @buddylist has been submitted.  !username will be notified.', array('!username' => theme('username', $user_to_add)) + buddylist_translation()));
 
     module_invoke_all('buddylist', 'request', $user_to_add, $user, false);
   }
   else {
     if ($already_requested) {
-      drupal_set_message(t('You have already requested to add %username to your @buddylist', array('%username' => $user_to_add->name) + buddylist_translation()));
+      drupal_set_message(t('You have already requested to add !username to your @buddylist', array('!username' => theme('username', $user_to_add)) + buddylist_translation()));
     }
 
     if ($already_buddies) {
-      drupal_set_message(t('%username is already on your @buddylist', array('%username' => $user_to_add->name) + buddylist_translation()));
+      drupal_set_message(t('!username is already on your @buddylist', array('!username' => theme('username', $user_to_add)) + buddylist_translation()));
     }
   }
 }
@@ -1521,7 +1526,6 @@ function buddylist_remove($id) {
   if (variable_get('buddylist_send_remove', FALSE)) {
     buddylist_mail_user('remove', $removeuser);
   }
-  drupal_set_message(t('%username has been removed from your @buddylist', array('%username' => $removeuser->name) + buddylist_translation()));
 
   if (variable_get('buddylist_require_approval', 0)) {
     db_query('DELETE FROM {buddylist} WHERE uid = %d AND buddy = %d', $id, $user->uid);
@@ -1530,16 +1534,6 @@ function buddylist_remove($id) {
   module_invoke_all('buddylist', 'remove', $removeuser, $user, !variable_get('buddylist_require_approval', 0));
 }
 
-function buddylist_cancel_add($id) {
-  $thisuser = user_load(array('uid' => $id));
-  drupal_set_message(t('User %name was NOT added to your @buddylist.', array('%name' => $thisuser->name) + buddylist_translation()));
-}
-
-function buddylist_cancel_remove($id) {
-  $thisuser = user_load(array('uid' => $id));
-  drupal_set_message(t('User %name was NOT removed from your @buddylist.', array('%name' => $thisuser->name) + buddylist_translation()));
-}
-
 function theme_buddylist_online($online) {
   return $online ? t('yes') : t('no');
 }
