Index: includes/me_views_handler_argument_user_uid.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/me/includes/me_views_handler_argument_user_uid.inc,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 me_views_handler_argument_user_uid.inc
--- includes/me_views_handler_argument_user_uid.inc	28 Feb 2009 08:29:03 -0000	1.1.2.4
+++ includes/me_views_handler_argument_user_uid.inc	2 Mar 2009 21:16:05 -0000
@@ -30,7 +30,6 @@
     $options = parent::option_definition();
 
     $options['me_alias'] = array('default' => TRUE);
-
     return $options;
   }
 
@@ -72,34 +71,8 @@
     // Whilst we do validate this in the options form, this is here for views that
     // were created before the me module was installed.
     if (!_me_is_alias($this->options['wildcard']) && !empty($this->options['me_alias'])) {
-      $uid_args = array();
-      $seperator = ' ';
-      if (empty($this->options['break_phrase'])) {
-        $uid_args[] = $arg;
-      }
-      else {
-        // Modified from views_break_phrase() to include characters that a 'me' alias
-        // may include.
-        if (preg_match('/^([0-9a-zA-Z]+[+ ])+[0-9a-zA-Z]+$/', $arg)) {
-          // The '+' character in a query string may be parsed as ' '.
-          $uid_args = preg_split('/[+ ]/', $arg);
-        }
-        else if (preg_match('/^([0-9a-zA-Z]+,)*[0-9a-zA-Z]+$/', $arg)) {
-          $seperator = ',';
-          $uid_args = explode(',', $arg);
-        }
-      }
-
-      // The alias could potentially show up more than once. Loop over each argument
-      // and check to be sure.
-      foreach ($uid_args as &$uid_arg) {
-        $uid_arg = _me_check_arg($uid_arg, FALSE);
-      }
-
-      $arg = implode($seperator, $uid_args);
+      return parent::set_argument(_me_views_set_argument($arg, $this->options['break_phrase']));
     }
-
-    return parent::set_argument($arg);
   }
 }
 
Index: includes/me.views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/me/includes/me.views.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 me.views.inc
--- includes/me.views.inc	18 Jan 2009 01:38:16 -0000	1.1.2.3
+++ includes/me.views.inc	2 Mar 2009 21:16:04 -0000
@@ -13,6 +13,7 @@
 function me_views_data_alter(&$cache) {
   // Make our handler the one to use for handling user arguments.
   $cache['users']['uid']['argument']['handler'] = 'me_views_handler_argument_user_uid';
+  $cache['users']['name']['argument']['handler'] = 'me_views_handler_argument_user_name';
 }
 
 /**
@@ -28,5 +29,51 @@
         'parent' => 'views_handler_argument_user_uid',
       ),
     ),
+    'handlers' => array(
+      'me_views_handler_argument_user_name' => array(
+        'parent' => 'views_handler_argument_string',
+      ),
+    ),
   );
 }
+
+/**
+ * Helper function to set the views user arguments we override.
+ *
+ * @param $arg
+ *   The arg(s) we are checking.
+ * @param $break_phase
+ *   Helps us determine if there are multiple arguments.
+ * @param $username
+ *   Wehter or not this is the username argument.
+ *
+ * @return string
+ *   The modified argument list.
+ */
+function _me_views_set_argument($arg, $break_phase, $username = FALSE) {
+  $uid_args = array();
+  $seperator = ' ';
+  if (empty($break_phase)) {
+    $uid_args[] = $arg;
+  }
+  else {
+    // Modified from views_break_phrase() to include characters that a 'me' alias
+    // may include.
+    if (preg_match('/^([0-9a-zA-Z]+[+ ])+[0-9a-zA-Z]+$/', $arg)) {
+      // The '+' character in a query string may be parsed as ' '.
+      $uid_args = preg_split('/[+ ]/', $arg);
+    }
+    else if (preg_match('/^([0-9a-zA-Z]+,)*[0-9a-zA-Z]+$/', $arg)) {
+      $seperator = ',';
+      $uid_args = explode(',', $arg);
+    }
+  }
+
+  // The alias could potentially show up more than once. Loop over each argument
+  // and check to be sure.
+  foreach ($uid_args as &$uid_arg) {
+    $uid_arg = _me_check_arg($uid_arg, $username, FALSE);
+  }
+
+  return implode($seperator, $uid_args);
+}
Index: me.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/me/me.module,v
retrieving revision 1.5.2.8
diff -u -r1.5.2.8 me.module
--- me.module	28 Feb 2009 08:28:05 -0000	1.5.2.8
+++ me.module	2 Mar 2009 21:16:04 -0000
@@ -389,6 +389,8 @@
  *
  * @param $arg
  *   The argument to check.
+ * @param $username
+ *   If TRUE, will return the username instead of the users id.
  * @param $redirect
  *   When TRUE, anonymous users will be redirected if a path is available.
  *
@@ -396,12 +398,12 @@
  *   The current user id if a match is found, or the given argument
  *   if no match.
  */
-function _me_check_arg($arg, $redirect = TRUE) {
-  $return = _me_is_alias($arg) ? $GLOBALS['user']->uid : $arg;
+function _me_check_arg($arg, $username = FALSE, $redirect = TRUE) {
+  $return = _me_is_alias($arg) ? $username ? $GLOBALS['user']->name : $GLOBALS['user']->uid : $arg;
 
   $redirect_path = me_variable_get('me_redirect_anonymous');
 
-  if ($redirect && $return == 0 &&  !empty($redirect_path)) {
+  if ($redirect && $GLOBALS['user']->uid == 0 &&  !empty($redirect_path)) {
     // Copied from menu_get_item(). We can't call that here as it might cause a recursion loop.
     $original_map = arg(NULL, $_GET['q']);
     $parts = array_slice($original_map, 0, MENU_MAX_PARTS);
Index: includes/me_views_handler_argument_user_name.inc
===================================================================
RCS file: includes/me_views_handler_argument_user_name.inc
diff -N includes/me_views_handler_argument_user_name.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ includes/me_views_handler_argument_user_name.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,79 @@
+<?php
+// $Id: me_views_handler_argument_user_uid.inc,v 1.1.2.4 2009/02/28 08:29:03 cdale Exp $
+/**
+ * @file
+ * Provide user name argument handler.
+ */
+
+/**
+ * Argument handler to accept a user id.
+ */
+class me_views_handler_argument_user_name extends views_handler_argument_string {
+  /**
+   * Information about options for all kinds of purposes will be held here.
+   * @code
+   * 'option_name' => array(
+   *  - 'default' => default value,
+   *  - 'translatable' => TRUE/FALSE (wrap in t() on export if true),
+   *  - 'contains' => array of items this contains, with its own defaults, etc.
+   *      If contains is set, the default will be ignored and assumed to
+   *      be array()
+   *
+   *  ),
+   *  @endcode
+   * Each option may have any of the following functions:
+   *  - export_option_OPTIONNAME -- Special export handling if necessary.
+   *  - translate_option_OPTIONNAME -- Special handling for translating data
+   *    within the option, if necessary.
+   */
+  function option_definition() {
+    $options = parent::option_definition();
+
+    $options['me_alias'] = array('default' => FALSE);
+    return $options;
+  }
+
+  /**
+   * Present options for the user.
+   */
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+
+    // Allow the view creator to decide how the 'me' alias will be handled.
+    $form['me_alias'] = array(
+      '#type' => 'checkbox',
+      '#title' => t("Let users enter the 'me' alias instead of their user name."),
+      '#description' => t("If selected, users can enter the 'me' alias inplace of their user name. When this option is selected, "
+        ."the wildcard can not be the same as the 'me' alias and you will not be able to select a user whos name is the same "
+        ."as the 'me' alias."),
+      '#default_value' => !empty($this->options['me_alias']),
+    );
+  }
+
+  /**
+   * Validate the options form.
+   */
+  function options_validate($form, &$form_state) {
+    parent::options_validate($form, $form_state);
+
+    // Make sure the wildcard is not the same as the 'me' alias.
+    if (!empty($form_state['values']['options']['me_alias']) && _me_is_alias($form_state['values']['options']['wildcard'])) {
+      form_set_error('wildcard', t("When using the 'me' alias option, the wildcard can not be the same as the 'me' alias."));
+    }
+  }
+
+  /**
+   * Set the input for this argument
+   *
+   * @return TRUE if it successfully validates; FALSE if it does not.
+   */
+  function set_argument($arg) {
+    // Only modify the argument when the wildcard does not equal the 'me' alias.
+    // Whilst we do validate this in the options form, this is here for views that
+    // were created before the me module was installed.
+    if (!_me_is_alias($this->options['wildcard']) && !empty($this->options['me_alias'])) {
+      return parent::set_argument(_me_views_set_argument($arg, $this->options['break_phrase'], TRUE));
+    }
+  }
+}
+
