# HG changeset patch # User Mark Doliner # Date 1113881380 0 # Node ID de9af04c50ffcae4a212cee64ee5fcab6e226956 # Parent 9c4dca2deb99bbc602947b722aaf01f4e0cded6b [gaim-migrate @ 12514] sf patch #1185433, from Richard Laager "The gestures plugin started giving me compiler warnings. I tracked them down and rewrote the appropriate section of code. Tested and found to work." committer: Tailor Script diff -r 9c4dca2deb99 -r de9af04c50ff plugins/gestures/gestures.c --- a/plugins/gestures/gestures.c Tue Apr 19 03:18:50 2005 +0000 +++ b/plugins/gestures/gestures.c Tue Apr 19 03:29:40 2005 +0000 @@ -57,18 +57,28 @@ { GaimConversation *conv; GaimConvWindow *win; - unsigned int index; + GList *conversations; conv = (GaimConversation *)data; win = gaim_conversation_get_window(conv); - index = gaim_conversation_get_index(conv); - if (index == 0) - index = gaim_conv_window_get_conversation_count(win) - 1; - else - index--; + for (conversations = gaim_conv_window_get_conversations(win); + conversations != NULL; + conversations = conversations->next) + { + if (conversations->data == conv) + { + if (conversations->prev != NULL) { + gaim_conv_window_switch_conversation(win, + conversations->prev->data); + } else { + gaim_conv_window_switch_conversation(win, + g_list_last(conversations)->data); + } - gaim_conv_window_switch_conversation(win, index); + return; + } + } } static void @@ -76,18 +86,28 @@ { GaimConversation *conv; GaimConvWindow *win; - unsigned int index; + GList *conversations; conv = (GaimConversation *)data; win = gaim_conversation_get_window(conv); - index = gaim_conversation_get_index(conv); - if (index == gaim_conv_window_get_conversation_count(win) - 1) - index = 0; - else - index++; + for (conversations = gaim_conv_window_get_conversations(win); + conversations != NULL; + conversations = conversations->next) + { + if (conversations->data == conv) + { + if (conversations->next != NULL) { + gaim_conv_window_switch_conversation(win, + conversations->next->data); + } else { + gaim_conv_window_switch_conversation(win, + g_list_first(conversations)->data); + } - gaim_conv_window_switch_conversation(win, index); + return; + } + } } void