]> git.0d.be Git - empathy.git/commitdiff
invite-participant-dialog: filter contacts by account
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 12 Mar 2010 17:06:10 +0000 (18:06 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 15 Mar 2010 09:18:01 +0000 (10:18 +0100)
We can't invite contacts from other accounts so we shouldn't display them
(#612718).

src/empathy-chat-window.c
src/empathy-invite-participant-dialog.c
src/empathy-invite-participant-dialog.h

index 2e2f5c003054862e18af70a325e5a5148b40791a..158faa0b17115eefc216bc1470433057955fbd60 100644 (file)
@@ -875,6 +875,7 @@ chat_window_invite_participant_activate_cb (GtkAction         *action,
        EmpathyTpChat         *tp_chat;
        TpChannel             *channel;
        int                    response;
+       TpAccount             *account;
 
        priv = GET_PRIV (window);
 
@@ -882,9 +883,10 @@ chat_window_invite_participant_activate_cb (GtkAction         *action,
 
        tp_chat = empathy_chat_get_tp_chat (priv->current_chat);
        channel = empathy_tp_chat_get_channel (tp_chat);
+       account = empathy_chat_get_account (priv->current_chat);
 
        dialog = empathy_invite_participant_dialog_new (
-                       GTK_WINDOW (priv->dialog));
+                       GTK_WINDOW (priv->dialog), account);
        gtk_widget_show (dialog);
 
        response = gtk_dialog_run (GTK_DIALOG (dialog));
index 70332d1ffe5d2c9724d243978df2022af030f5cf..77fb93738cff75d912fd521ecf61fd58fcba9aed 100644 (file)
@@ -52,9 +52,12 @@ empathy_invite_participant_dialog_init (EmpathyInviteParticipantDialog *self)
 }
 
 GtkWidget *
-empathy_invite_participant_dialog_new (GtkWindow *parent)
+empathy_invite_participant_dialog_new (GtkWindow *parent,
+    TpAccount *account)
 {
-  GtkWidget *self = g_object_new (EMPATHY_TYPE_INVITE_PARTICIPANT_DIALOG, NULL);
+  GtkWidget *self = g_object_new (EMPATHY_TYPE_INVITE_PARTICIPANT_DIALOG,
+      "filter-account", account,
+      NULL);
 
   if (parent != NULL)
     {
index 561e1073829cb761b8f8a9baea3f076dec0e45d0..daacf5192575b41ab20763f8dd6631fab8e8818a 100644 (file)
@@ -39,7 +39,8 @@ struct _EmpathyInviteParticipantDialogClass
 };
 
 GType empathy_invite_participant_dialog_get_type (void);
-GtkWidget *empathy_invite_participant_dialog_new (GtkWindow *parent);
+GtkWidget *empathy_invite_participant_dialog_new (GtkWindow *parent,
+    TpAccount *account);
 
 G_END_DECLS