]> git.0d.be Git - empathy.git/commitdiff
empathy_contact_selector_dialog_get_selected: allow to get the account as well
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 10 Aug 2010 14:58:45 +0000 (16:58 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 10 Aug 2010 15:02:54 +0000 (17:02 +0200)
libempathy-gtk/empathy-contact-selector-dialog.c
libempathy-gtk/empathy-contact-selector-dialog.h
libempathy-gtk/empathy-new-call-dialog.c
libempathy-gtk/empathy-new-message-dialog.c
src/empathy-chat-window.c

index b04e56daa678cf9a42a343757889d8ff20ff064e..47a8402405e070863a1bff4784cec0a72294a453 100644 (file)
@@ -492,7 +492,8 @@ empathy_contact_selector_dialog_class_init (
 const gchar *
 empathy_contact_selector_dialog_get_selected (
     EmpathyContactSelectorDialog *self,
-    TpConnection **connection)
+    TpConnection **connection,
+    TpAccount **account)
 {
   EmpathyContactSelectorDialogPriv *priv;
   const char *id;
@@ -501,7 +502,7 @@ empathy_contact_selector_dialog_get_selected (
 
   priv = GET_PRIV (self);
 
-  if (connection)
+  if (connection != NULL)
     {
       if (priv->show_account_chooser)
         *connection = empathy_account_chooser_get_connection (
@@ -510,6 +511,16 @@ empathy_contact_selector_dialog_get_selected (
         *connection = NULL;
     }
 
+  if (account != NULL)
+    {
+      if (priv->show_account_chooser)
+        *account = empathy_account_chooser_get_account (
+            EMPATHY_ACCOUNT_CHOOSER (priv->account_chooser));
+      else
+        *account = NULL;
+    }
+
+
   id = gtk_entry_get_text (GTK_ENTRY (priv->entry_id));
   return id;
 }
index 318a9bcac31e7542f2399a41995b995f936538cd..402f1c766f94214dc0db981e3043441d5257d9c2 100644 (file)
@@ -55,7 +55,8 @@ struct _EmpathyContactSelectorDialog {
 GType empathy_contact_selector_dialog_get_type (void);
 const gchar *empathy_contact_selector_dialog_get_selected (
     EmpathyContactSelectorDialog *self,
-    TpConnection **connection);
+    TpConnection **connection,
+    TpAccount **account);
 void empathy_contact_selector_dialog_set_show_account_chooser (
     EmpathyContactSelectorDialog *self,
     gboolean show_account_chooser);
index 27ec3a2cd8684d9d58ef6f17b4016aa3c700bab7..b92cf50c8af30a8683e99f645a5c00d99d243f46 100644 (file)
@@ -107,7 +107,7 @@ empathy_new_call_dialog_response (GtkDialog *dialog, int response_id)
   if (response_id != GTK_RESPONSE_ACCEPT) goto out;
 
   contact_id = empathy_contact_selector_dialog_get_selected (
-      EMPATHY_CONTACT_SELECTOR_DIALOG (dialog), &connection);
+      EMPATHY_CONTACT_SELECTOR_DIALOG (dialog), &connection, NULL);
 
   if (EMP_STR_EMPTY (contact_id) || connection == NULL) goto out;
 
index 5094385750c37e42306ee5cece8ecb0b4a98284c..21480a787918499eede6f19716667b14adc2acd5 100644 (file)
@@ -66,7 +66,7 @@ empathy_new_message_dialog_response (GtkDialog *dialog, int response_id)
   if (response_id != GTK_RESPONSE_ACCEPT) goto out;
 
   contact_id = empathy_contact_selector_dialog_get_selected (
-      EMPATHY_CONTACT_SELECTOR_DIALOG (dialog), &connection);
+      EMPATHY_CONTACT_SELECTOR_DIALOG (dialog), &connection, NULL);
 
   if (EMP_STR_EMPTY (contact_id) || connection == NULL) goto out;
 
index 8c2eed6b14a7a558a8fecec8c75399f0c1699419..e80d38298e974026527fc8738b506c0254ffdfbb 100644 (file)
@@ -934,7 +934,7 @@ chat_window_invite_participant_activate_cb (GtkAction         *action,
                const char *id;
 
                id = empathy_contact_selector_dialog_get_selected (
-                               EMPATHY_CONTACT_SELECTOR_DIALOG (dialog), NULL);
+                               EMPATHY_CONTACT_SELECTOR_DIALOG (dialog), NULL, NULL);
                if (EMP_STR_EMPTY (id)) goto out;
 
                connection = tp_channel_borrow_connection (channel);