Index: accountsservice-0.6.35/data/org.freedesktop.Accounts.User.xml
===================================================================
--- accountsservice-0.6.35.orig/data/org.freedesktop.Accounts.User.xml	2013-11-13 15:17:01.604125597 +0100
+++ accountsservice-0.6.35/data/org.freedesktop.Accounts.User.xml	2013-11-13 15:17:01.592125596 +0100
@@ -331,6 +331,41 @@
     </doc:doc>
   </method>
 
+  <method name="SetXHasMessages">
+    <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+    <arg name="has_messages" direction="in" type="b">
+      <doc:doc>
+        <doc:summary>
+          Whether the user has messages waiting for them.
+        </doc:summary>
+      </doc:doc>
+    </arg>
+    <doc:doc>
+      <doc:description>
+        <doc:para>
+          Sets whether the user has messages waiting for them.
+        </doc:para>
+      </doc:description>
+      <doc:permission>
+        The caller needs one of the following PolicyKit authorizations:
+        <doc:list>
+          <doc:item>
+            <doc:term>org.freedesktop.accounts.change-own-user-data</doc:term>
+            <doc:definition>To change his or her own status</doc:definition>
+          </doc:item>
+          <doc:item>
+            <doc:term>org.freedesktop.accounts.user-administration</doc:term>
+            <doc:definition>To change the status of another user</doc:definition>
+          </doc:item>
+        </doc:list>
+      </doc:permission>
+      <doc:errors>
+        <doc:error name="org.freedesktop.Accounts.Error.PermissionDenied">if the caller lacks the appropriate PolicyKit authorization</doc:error>
+        <doc:error name="org.freedesktop.Accounts.Error.Failed">if the operation failed</doc:error>
+      </doc:errors>
+    </doc:doc>
+  </method>
+
   <method name="SetXKeyboardLayouts">
     <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
     <arg name="layouts" direction="in" type="as">
@@ -793,6 +828,16 @@
         </doc:para>
       </doc:description>
     </doc:doc>
+  </property>
+
+  <property name="XHasMessages" type="b" access="read">
+    <doc:doc>
+      <doc:description>
+        <doc:para>
+           Whether the user has messages waiting for them.
+        </doc:para>
+      </doc:description>
+    </doc:doc>
   </property>
 
   <property name="XKeyboardLayouts" type="as" access="read">
Index: accountsservice-0.6.35/src/libaccountsservice/act-user.c
===================================================================
--- accountsservice-0.6.35.orig/src/libaccountsservice/act-user.c	2013-11-13 15:17:01.604125597 +0100
+++ accountsservice-0.6.35/src/libaccountsservice/act-user.c	2013-11-13 15:17:01.596125596 +0100
@@ -91,6 +91,7 @@
         PROP_LOGIN_FREQUENCY,
         PROP_LOGIN_TIME,
         PROP_LOGIN_HISTORY,
+        PROP_X_HAS_MESSAGES,
         PROP_X_KEYBOARD_LAYOUTS,
         PROP_BACKGROUND_FILE,
         PROP_ICON_FILE,
@@ -140,6 +141,7 @@
 
         guint           uid_set : 1;
 
+        guint           x_has_messages : 1;
         guint           is_loaded : 1;
         guint           locked : 1;
         guint           automatic_login : 1;
@@ -308,6 +310,9 @@
         case PROP_LOCATION:
                 g_value_set_string (value, user->location);
                 break;
+        case PROP_X_HAS_MESSAGES:
+                g_value_set_boolean (value, user->x_has_messages);
+                break;
         case PROP_X_KEYBOARD_LAYOUTS:
                 g_value_set_boxed (value, g_strdupv (user->x_keyboard_layouts));
                 break;
@@ -465,6 +470,13 @@
                                                                NULL,
                                                                G_PARAM_READABLE));
         g_object_class_install_property (gobject_class,
+                                         PROP_X_HAS_MESSAGES,
+                                         g_param_spec_boolean ("xhas-messages",
+                                                             "Has Messages",
+                                                             "Whether the user has messages waiting.",
+                                                             FALSE,
+                                                             G_PARAM_READABLE));
+        g_object_class_install_property (gobject_class,
                                          PROP_X_KEYBOARD_LAYOUTS,
                                          g_param_spec_boxed ("xkeyboard-layouts",
                                                              "Keyboard layouts",
@@ -1059,6 +1071,22 @@
 }
 
 /**
+ * act_user_get_x_has_messages:
+ * @user: a #ActUser
+ *
+ * Returns whether @user has messages waiting for them.
+ *
+ * Returns: whether messages exist
+ */
+gboolean
+act_user_get_x_has_messages (ActUser *user)
+{
+        g_return_val_if_fail (ACT_IS_USER (user), FALSE);
+
+        return user->x_has_messages;
+}
+
+/**
  * act_user_get_x_keyboard_layouts:
  * @user: a #ActUser
  *
@@ -1370,6 +1398,14 @@
                         user->login_history = g_variant_ref (new_login_history);
                         g_object_notify (G_OBJECT (user), "login-history");
                 }
+        } else if (strcmp (key, "XHasMessages") == 0) {
+                gboolean new_has_messages;
+
+                new_has_messages = g_variant_get_boolean (value);
+                if (new_has_messages != user->x_has_messages) {
+                        user->x_has_messages = new_has_messages;
+                        g_object_notify (G_OBJECT (user), "xhas-messages");
+                }
         } else if (strcmp (key, "XKeyboardLayouts") == 0) {
                 const char **new_x_keyboard_layouts;
 
@@ -1741,6 +1777,34 @@
                 g_error_free (error);
                 return;
         }
+}
+
+/**
+ * act_user_set_x_has_messages:
+ * @user: the user object to alter.
+ * @has_messages: whether the user has messages waiting
+ *
+ * Sets a new has-messages status for @user.
+ *
+ * Note this function is synchronous and ignores errors.
+ **/
+void
+act_user_set_x_has_messages (ActUser  *user,
+                             gboolean  has_messages)
+{
+        GError *error = NULL;
+
+        g_return_if_fail (ACT_IS_USER (user));
+        g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy));
+
+        if (!accounts_user_call_set_xhas_messages_sync (user->accounts_proxy,  
+                                                         has_messages,
+                                                         NULL,
+                                                         &error)) {
+                g_warning ("SetXHasMessages call failed: %s", error->message);
+                g_error_free (error);
+                return;
+        }
 }
 
 /**
Index: accountsservice-0.6.35/src/user.c
===================================================================
--- accountsservice-0.6.35.orig/src/user.c	2013-11-13 15:17:01.604125597 +0100
+++ accountsservice-0.6.35/src/user.c	2013-11-13 15:17:01.600125597 +0100
@@ -64,6 +64,7 @@
         PROP_LOGIN_FREQUENCY,
         PROP_LOGIN_TIME,
         PROP_LOGIN_HISTORY,
+        PROP_X_HAS_MESSAGES,
         PROP_X_KEYBOARD_LAYOUTS,
         PROP_BACKGROUND_FILE,
         PROP_ICON_FILE,
@@ -100,6 +101,7 @@
         gchar        *x_session;
         gchar        *location;
         guint64       login_frequency;
+        gboolean      x_has_messages;
         gchar       **x_keyboard_layouts;
         gchar        *background_file;
         gint64        login_time;
@@ -1812,6 +1814,52 @@
 }
 
 static void
+user_change_x_has_messages_authorized_cb (Daemon                *daemon,
+                                          User                  *user,
+                                          GDBusMethodInvocation *context,
+                                          gpointer               data)
+{
+        user->x_has_messages = GPOINTER_TO_INT (data);
+
+        accounts_user_emit_changed (ACCOUNTS_USER (user));
+
+        g_object_notify (G_OBJECT (user), "xhas-messages");
+
+        accounts_user_complete_set_xhas_messages (ACCOUNTS_USER (user), context);
+}
+
+gboolean
+user_set_xhas_messages (AccountsUser          *auser,
+                        GDBusMethodInvocation *context,
+                        gboolean               has_messages)
+{
+        User *user = (User*)auser;
+        int uid;
+        const gchar *action_id;
+
+        if (!get_caller_uid (context, &uid)) {
+                throw_error (context, ERROR_FAILED, "identifying caller failed");
+                return FALSE;
+        }
+
+        if (user->uid == (uid_t) uid)
+                action_id = "org.freedesktop.accounts.change-own-user-data";
+        else
+                action_id = "org.freedesktop.accounts.user-administration";
+
+        daemon_local_check_auth (user->daemon,
+                                 user,
+                                 action_id,
+                                 TRUE,
+                                 user_change_x_has_messages_authorized_cb,
+                                 context,
+                                 GINT_TO_POINTER (has_messages),
+                                 NULL);
+
+        return TRUE;
+}
+
+static void
 user_change_x_keyboard_layouts_authorized_cb (Daemon                *daemon,
                                               User                  *user,
                                               GDBusMethodInvocation *context,
@@ -2860,6 +2908,9 @@
         case PROP_LOCATION:
                 g_value_set_string (value, user->location);
                 break;
+        case PROP_X_HAS_MESSAGES:
+                g_value_set_boolean (value, user->x_has_messages);
+                break;
         case PROP_X_KEYBOARD_LAYOUTS:
                 g_value_set_boxed (value, g_strdupv (user->x_keyboard_layouts));
                 break;
@@ -2935,6 +2986,7 @@
         iface->handle_set_real_name = user_set_real_name;
         iface->handle_set_shell = user_set_shell;
         iface->handle_set_user_name = user_set_user_name;
+        iface->handle_set_xhas_messages = user_set_xhas_messages;
         iface->handle_set_xkeyboard_layouts = user_set_xkeyboard_layouts;
         iface->handle_set_xsession = user_set_x_session;
         iface->get_uid = user_real_get_uid;
@@ -2968,6 +3020,7 @@
         user->account_type = ACCOUNT_TYPE_STANDARD;
         user->home_dir = NULL;
         user->shell = NULL;
+        user->x_has_messages = FALSE;
         user->x_keyboard_layouts = NULL;
         user->background_file = NULL;
         user->icon_file = NULL;
