aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy-gtk/empathy-contact-selector-dialog.c18
-rw-r--r--libempathy-gtk/empathy-contact-selector-dialog.h3
2 files changed, 19 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-contact-selector-dialog.c b/libempathy-gtk/empathy-contact-selector-dialog.c
index c52ac6c56..6c0448441 100644
--- a/libempathy-gtk/empathy-contact-selector-dialog.c
+++ b/libempathy-gtk/empathy-contact-selector-dialog.c
@@ -230,6 +230,20 @@ entry_activate_cb (GtkEntry *entry,
gtk_dialog_response (GTK_DIALOG (self), GTK_RESPONSE_ACCEPT);
}
+static gboolean
+account_chooser_filter (TpAccount *account,
+ gpointer user_data)
+{
+ EmpathyContactSelectorDialog *self = user_data;
+ EmpathyContactSelectorDialogClass *class = \
+ EMPATHY_CONTACT_SELECTOR_DIALOG_GET_CLASS (self);
+
+ if (class->account_filter == NULL)
+ return empathy_account_chooser_filter_is_connected (account, user_data);
+
+ return class->account_filter (self, account);
+}
+
static void
empathy_contact_selector_dialog_init (EmpathyContactSelectorDialog *dialog)
{
@@ -299,8 +313,8 @@ empathy_contact_selector_dialog_init (EmpathyContactSelectorDialog *dialog)
1, 2, 0, 1);
empathy_account_chooser_set_filter (
EMPATHY_ACCOUNT_CHOOSER (priv->account_chooser),
- empathy_account_chooser_filter_is_connected,
- NULL);
+ account_chooser_filter,
+ dialog);
gtk_widget_show (priv->account_chooser);
contact_selector_dialog_account_changed_cb (priv->account_chooser, dialog);
diff --git a/libempathy-gtk/empathy-contact-selector-dialog.h b/libempathy-gtk/empathy-contact-selector-dialog.h
index 0f5279946..2315bc401 100644
--- a/libempathy-gtk/empathy-contact-selector-dialog.h
+++ b/libempathy-gtk/empathy-contact-selector-dialog.h
@@ -39,6 +39,9 @@ struct _EmpathyContactSelectorDialogClass {
void (*got_response) (EmpathyContactSelectorDialog *self,
TpConnection *connection,
const gchar *contact_id);
+
+ gboolean (*account_filter) (EmpathyContactSelectorDialog *self,
+ TpAccount *account);
};
struct _EmpathyContactSelectorDialog {