Mercurial > pidgin.yaz
diff src/conversation.c @ 10824:8d52201620d0
[gaim-migrate @ 12488]
This changes gaim_conv_window_remove_conversation to take a GaimConversion
pointer to remore instead of an index. Every place just called a function
to get the index before calling it anyway.
This may or may not help the contact aware convo bugs, I didn't test it
yet, but I believe it to be a step in the right direction.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Fri, 15 Apr 2005 00:28:54 +0000 |
parents | 4151d16f6348 |
children | 53e7884c549a |
line wrap: on
line diff
--- a/src/conversation.c Thu Apr 14 04:08:10 2005 +0000 +++ b/src/conversation.c Fri Apr 15 00:28:54 2005 +0000 @@ -468,7 +468,7 @@ if (gaim_conversation_get_window(conv) != NULL) { gaim_conv_window_remove_conversation( gaim_conversation_get_window(conv), - gaim_conversation_get_index(conv)); + conv); } ops = gaim_conv_window_get_ui_ops(win); @@ -492,20 +492,21 @@ } GaimConversation * -gaim_conv_window_remove_conversation(GaimConvWindow *win, unsigned int index) +gaim_conv_window_remove_conversation(GaimConvWindow *win, GaimConversation *conv) { GaimConvWindowUiOps *ops; - GaimConversation *conv; GList *node; g_return_val_if_fail(win != NULL, NULL); - g_return_val_if_fail(index < gaim_conv_window_get_conversation_count(win), NULL); + g_return_val_if_fail(conv != NULL, NULL); ops = gaim_conv_window_get_ui_ops(win); - node = g_list_nth(gaim_conv_window_get_conversations(win), index); - conv = (GaimConversation *)node->data; - + node = g_list_find(gaim_conv_window_get_conversations(win), conv); + + if (!node) + return NULL; + if (ops != NULL && ops->remove_conversation != NULL) ops->remove_conversation(win, conv); @@ -1019,8 +1020,7 @@ conv->data = NULL; if (win != NULL) { - gaim_conv_window_remove_conversation(win, - gaim_conversation_get_index(conv)); + gaim_conv_window_remove_conversation(win, conv); } if (ops != NULL && ops->destroy_conversation != NULL)