# HG changeset patch # User Richard Laager # Date 1227764941 0 # Node ID d18f44ae1143a12493f8a52fbcdcd15abecbd6e7 # Parent c7d9d10557a92d1ab650e0b45f047cf4b2922d7d Add a comment to clarify code I initially thought was broken. diff -r c7d9d10557a9 -r d18f44ae1143 libpurple/roomlist.c --- a/libpurple/roomlist.c Thu Nov 27 05:32:30 2008 +0000 +++ b/libpurple/roomlist.c Thu Nov 27 05:49:01 2008 +0000 @@ -265,6 +265,11 @@ g_return_if_fail(room != NULL); g_return_if_fail(list->fields != NULL); + /* If this is the first call for this room, grab the first field in + * the Roomlist's fields. Otherwise, grab the field that is one + * more than the number of fields already present for the room. + * (This works because g_list_nth_data() is zero-indexed and + * g_list_length() is one-indexed.) */ if (!room->fields) f = list->fields->data; else