account, room);
if (chatroom == NULL)
{
- DEBUG ("Failed to get chatroom '%s' on '%s': %s",
- room, path, error->message);
- g_error_free (error);
+ DEBUG ("Failed to get chatroom '%s' on '%s'",
+ room, path);
goto out;
}
g_menu_item_set_action_and_target (item, "win.join", "(ss)",
name, account_path);
g_menu_item_set_attribute (item, "room-name", "s", name);
+ g_menu_item_set_attribute (item, "account-path", "s", account_path);
g_menu_append_item (self->priv->rooms_section, item);
g_free (label);
EmpathyRosterWindow *self)
{
GList *chatrooms;
- gint i;
+ guint i, n;
+ TpAccount *account;
+ const gchar *account_path;
+
+ account = empathy_chatroom_get_account (chatroom);
+ account_path = tp_proxy_get_object_path (account);
- for (i = 0; i < g_menu_model_get_n_items (
- G_MENU_MODEL (self->priv->rooms_section)); i++)
+ n = g_menu_model_get_n_items (G_MENU_MODEL (self->priv->rooms_section));
+
+ for (i = 0; i < n; i++)
{
- const gchar *name;
+ gchar *tmp;
+
+ if (!g_menu_model_get_item_attribute (
+ G_MENU_MODEL (self->priv->rooms_section), i,
+ "room-name", "s", &tmp))
+ continue;
- if (g_menu_model_get_item_attribute (
- G_MENU_MODEL (self->priv->rooms_section), i, "room-name",
- "s", &name)
- && !tp_strdiff (name, empathy_chatroom_get_name (chatroom)))
+ if (tp_strdiff (tmp, empathy_chatroom_get_name (chatroom)))
{
- g_menu_remove (self->priv->rooms_section, i);
- break;
+ g_free (tmp);
+ continue;
}
+
+ g_free (tmp);
+
+ if (!g_menu_model_get_item_attribute (
+ G_MENU_MODEL (self->priv->rooms_section), i,
+ "account-path", "s", &tmp))
+ continue;
+
+ if (tp_strdiff (tmp, account_path))
+ {
+ g_free (tmp);
+ continue;
+ }
+
+ g_menu_remove (self->priv->rooms_section, i);
+ g_free (tmp);
+ break;
}
chatrooms = empathy_chatroom_manager_get_chatrooms (
{
if (g_settings_get_boolean (self->priv->gsettings_ui,
EMPATHY_PREFS_UI_SHOW_OFFLINE))
- display_page_message (self, _("You haven't added any contact yet"),
+ display_page_message (self, _("You haven't added any contacts yet"),
PAGE_MESSAGE_FLAG_ADD_CONTACT);
else
display_page_message (self, _("No online contacts"),