+static void
+button_online_clicked_cb (GtkButton *button,
+ EmpathyRosterWindow *self)
+{
+ EmpathyPresenceManager *mgr;
+
+ mgr = empathy_presence_manager_dup_singleton ();
+
+ empathy_presence_manager_set_state (mgr,
+ TP_CONNECTION_PRESENCE_TYPE_AVAILABLE);
+
+ g_object_unref (mgr);
+}
+
+static void
+button_show_offline_clicked_cb (GtkButton *button,
+ EmpathyRosterWindow *self)
+{
+ g_settings_set_boolean (self->priv->gsettings_ui,
+ EMPATHY_PREFS_UI_SHOW_OFFLINE, TRUE);
+}
+
+static void
+button_add_contact_clicked_cb (GtkButton *button,
+ EmpathyRosterWindow *self)
+{
+ empathy_new_individual_dialog_show (GTK_WINDOW (self));
+}
+
+typedef enum
+{
+ PAGE_MESSAGE_FLAG_NONE = 0,
+ PAGE_MESSAGE_FLAG_ACCOUNTS = 1 << 0,
+ PAGE_MESSAGE_FLAG_SPINNER = 1 << 2,
+ PAGE_MESSAGE_FLAG_ONLINE = 1 << 3,
+ PAGE_MESSAGE_FLAG_SHOW_OFFLINE = 1 << 4,
+ PAGE_MESSAGE_FLAG_ADD_CONTACT = 1 << 5,
+} PageMessageFlags;
+
+static gboolean
+can_add_contact (EmpathyRosterWindow *self)
+{
+ GList *accounts, *l;
+ gboolean result = FALSE;
+
+ accounts = tp_account_manager_dup_valid_accounts (
+ self->priv->account_manager);
+ for (l = accounts; l != NULL && !result; l = g_list_next (l))
+ {
+ TpAccount *account = TP_ACCOUNT (l->data);
+ TpConnection *conn;
+
+ conn = tp_account_get_connection (account);
+ if (conn == NULL)
+ continue;
+
+ if (tp_connection_get_can_change_contact_list (conn))
+ result = TRUE;
+ }
+
+ g_list_free_full (accounts, g_object_unref);
+ return result;
+}
+