EmpathyChatroom *chatroom;
xmlNodePtr node;
const gchar *account_id;
- gboolean favorite;
chatroom = l->data;
- g_object_get (chatroom, "favorite", &favorite, NULL);
- if (!favorite) {
+ if (!empathy_chatroom_is_favorite (chatroom)) {
continue;
}
}
chatroom = empathy_chatroom_new_full (account, room, name, auto_connect);
- g_object_set (chatroom, "favorite", TRUE, NULL);
+ empathy_chatroom_set_favorite (chatroom, TRUE);
add_chatroom (manager, chatroom);
g_signal_emit (manager, signals[CHATROOM_ADDED], 0, chatroom);
empathy_chatroom_get_account (chatroom),
empathy_chatroom_get_room (chatroom)))
{
- gboolean favorite;
-
- g_object_get (chatroom, "favorite", &favorite, NULL);
add_chatroom (manager, chatroom);
- if (favorite)
+ if (empathy_chatroom_is_favorite (chatroom))
reset_save_timeout (manager);
g_signal_emit (manager, signals[CHATROOM_ADDED], 0, chatroom);
if (this_chatroom == chatroom ||
empathy_chatroom_equal (chatroom, this_chatroom))
{
- gboolean favorite;
-
priv->chatrooms = g_list_delete_link (priv->chatrooms, l);
- g_object_get (chatroom, "favorite", &favorite, NULL);
- if (favorite)
+ if (empathy_chatroom_is_favorite (chatroom))
reset_save_timeout (manager);
g_signal_emit (manager, signals[CHATROOM_REMOVED], 0, this_chatroom);
gpointer manager)
{
EmpathyChatroomManagerPriv *priv = GET_PRIV (manager);
- McAccount *account;
- TpConnection *connection;
- EmpathyChatroom *chatroom;
- const gchar *roomname;
- gboolean favorite;
-
- connection = empathy_tp_chat_get_connection (chat);
- account = empathy_account_manager_get_account (priv->account_manager,
- connection);
- roomname = empathy_tp_chat_get_id (chat);
- chatroom = empathy_chatroom_manager_find (manager, account, roomname);
+ GList *l;
- if (chatroom == NULL)
- return;
+ for (l = priv->chatrooms; l; l = l->next)
+ {
+ EmpathyChatroom *chatroom = l->data;
- g_object_set (chatroom, "tp-chat", NULL, NULL);
- g_object_get (chatroom, "favorite", &favorite, NULL);
+ if (empathy_chatroom_get_tp_chat (chatroom) != chat)
+ continue;
- if (!favorite)
- {
- /* Remove the chatroom from the list, unless it's in the list of
- * favourites..
- * FIXME this policy should probably not be in libempathy */
- empathy_chatroom_manager_remove (manager, chatroom);
+ empathy_chatroom_set_tp_chat (chatroom, NULL);
+ if (!empathy_chatroom_is_favorite (chatroom))
+ {
+ /* Remove the chatroom from the list, unless it's in the list of
+ * favourites..
+ * FIXME this policy should probably not be in libempathy */
+ empathy_chatroom_manager_remove (manager, chatroom);
+ }
}
}
{
chatroom = empathy_chatroom_new_full (account, roomname, roomname,
FALSE);
- g_object_set (G_OBJECT (chatroom), "tp-chat", chat, NULL);
+ empathy_chatroom_set_tp_chat (chatroom, chat);
empathy_chatroom_manager_add (manager, chatroom);
g_object_unref (chatroom);
}
else
{
- g_object_set (G_OBJECT (chatroom), "tp-chat", chat, NULL);
+ empathy_chatroom_set_tp_chat (chatroom, chat);
}
/* A TpChat is always destroyed as it only gets unreffed after the channel