]> git.0d.be Git - empathy.git/commitdiff
Merge branch 'gnome-3-8'
authorXavier Claessens <xavier.claessens@collabora.co.uk>
Tue, 11 Jun 2013 09:34:34 +0000 (11:34 +0200)
committerXavier Claessens <xavier.claessens@collabora.co.uk>
Tue, 11 Jun 2013 09:34:34 +0000 (11:34 +0200)
1  2 
src/empathy-new-chatroom-dialog.c

index 6ff365ce91ef0f3400d9b027bde7113c88104930,cb8f2a1fb526ef584b938fb340e284dd1bb1cba3..5edf45a5a7534905391a684a6c1a0178ad556aca
   */
  
  #include "config.h"
 +#include "empathy-new-chatroom-dialog.h"
  
  #include <glib/gi18n.h>
  
 -#include <libempathy/empathy-utils.h>
 -#include <libempathy/empathy-request-util.h>
 -#include <libempathy/empathy-gsettings.h>
 -
 -#include <libempathy-gtk/empathy-account-chooser.h>
 -#include <libempathy-gtk/empathy-ui-utils.h>
 -
 -#include "empathy-new-chatroom-dialog.h"
 +#include "empathy-account-chooser.h"
 +#include "empathy-gsettings.h"
 +#include "empathy-request-util.h"
 +#include "empathy-ui-utils.h"
 +#include "empathy-utils.h"
  
  #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
 -#include <libempathy/empathy-debug.h>
 +#include "empathy-debug.h"
  
  G_DEFINE_TYPE (EmpathyNewChatroomDialog, empathy_new_chatroom_dialog,
      GTK_TYPE_DIALOG)
@@@ -254,8 -256,8 +254,8 @@@ new_chatroom_dialog_model_setup (Empath
  
    /* Store/Model */
    store = gtk_list_store_new (COL_COUNT,
-       G_TYPE_STRING,       /* Invite */
-       G_TYPE_STRING,       /* Password */
+       G_TYPE_STRING,       /* Need password */
+       G_TYPE_STRING,       /* Invite only */
        G_TYPE_STRING,       /* Name */
        G_TYPE_STRING,       /* Room */
        G_TYPE_STRING,       /* Member count */
@@@ -414,6 -416,12 +414,12 @@@ new_chatroom_dialog_got_room_cb (TpRoom
    const gchar *invite_only;
    gchar *tmp;
  
+   if (tp_str_empty (tp_room_info_get_handle_name (room)))
+     {
+       DEBUG ("Room handle name is empty - Broken CM");
+       return;
+     }
    DEBUG ("New room listed: %s (%s)", tp_room_info_get_name (room),
        tp_room_info_get_handle_name (room));
  
@@@ -494,16 -502,26 +500,26 @@@ new_room_list_cb (GObject *source
      gpointer user_data)
  {
    EmpathyNewChatroomDialog *self = user_data;
+   TpRoomList *room_list;
    GError *error = NULL;
  
-   self->priv->room_list = tp_room_list_new_finish (result, &error);
-   if (self->priv->room_list == NULL)
+   room_list = tp_room_list_new_finish (result, &error);
+   if (room_list == NULL)
      {
        DEBUG ("Failed to create TpRoomList: %s\n", error->message);
        g_error_free (error);
        return;
      }
  
+   if (tp_room_list_get_account (room_list) != self->priv->account)
+     {
+       /* Account changed while we were creating this TpRoomList */
+       g_object_unref (room_list);
+       return;
+     }
+   self->priv->room_list = room_list;
    tp_g_signal_connect_object (self->priv->room_list, "got-room",
        G_CALLBACK (new_chatroom_dialog_got_room_cb), self, 0);
    tp_g_signal_connect_object (self->priv->room_list, "failed",
    gtk_widget_set_sensitive (self->priv->expander_browse, TRUE);
  
    new_chatroom_dialog_update_widgets (self);
  }
  
  static void