void
empathy_chatroom_manager_remove (EmpathyChatroomManager *manager,
    EmpathyChatroom        *chatroom)
{
  EmpathyChatroomManagerPriv *priv;
  GList *l;

  g_return_if_fail (EMPATHY_IS_CHATROOM_MANAGER (manager));
  g_return_if_fail (EMPATHY_IS_CHATROOM (chatroom));

  priv = GET_PRIV (manager);

  for (l = priv->chatrooms; l; l = l->next)
    {
      EmpathyChatroom *this_chatroom;

      this_chatroom = l->data;

      if (this_chatroom == chatroom ||
          empathy_chatroom_equal (chatroom, this_chatroom))
        {
          chatroom_manager_remove_link (manager, l);
          break;
        }
    }
}
Example #2
0
static gboolean
chatrooms_window_remove_chatroom_foreach (GtkTreeModel   *model,
        GtkTreePath    *path,
        GtkTreeIter    *iter,
        EmpathyChatroom *chatroom)
{
    EmpathyChatroom *this_chatroom;

    gtk_tree_model_get (model, iter, COL_POINTER, &this_chatroom, -1);

    if (empathy_chatroom_equal (chatroom, this_chatroom)) {
        gtk_list_store_remove (GTK_LIST_STORE (model), iter);
        g_object_unref (this_chatroom);
        return TRUE;
    }

    g_object_unref (this_chatroom);

    return FALSE;
}