# HG changeset patch # User Justin # Date 976070941 0 # Node ID 2e5e20b05bee83b6d53bbb84f28d91649ada47ae # Parent 52431f1710f3a0130b57131f278dc238d2ae2eef [gaim-migrate @ 1219] Thanks, Justin committer: Rob Flynn diff -r 52431f1710f3 -r 2e5e20b05bee ChangeLog --- a/ChangeLog Tue Dec 05 23:37:45 2000 +0000 +++ b/ChangeLog Wed Dec 06 02:49:01 2000 +0000 @@ -1,6 +1,7 @@ GAIM: The Pimpin' Penguin IM Clone thats good for the soul! version 0.11.0: + * Away messages arranged alphabetically (Thanks Justin) version 0.11.0-pre2 (12/04/2000): * Fixed a segfault with a bad util.c diff -r 52431f1710f3 -r 2e5e20b05bee doc/CREDITS --- a/doc/CREDITS Tue Dec 05 23:37:45 2000 +0000 +++ b/doc/CREDITS Wed Dec 06 02:49:01 2000 +0000 @@ -50,6 +50,9 @@ ergofobe: GNOME Url handler patch +Justin M. Ward : + Alphabetical Away Messages patch + G. Sumner Hayes Security Patches Brian Ryner for a little make file patch :) Ryan C. Gordon diff -r 52431f1710f3 -r 2e5e20b05bee src/gaim.h --- a/src/gaim.h Tue Dec 05 23:37:45 2000 +0000 +++ b/src/gaim.h Wed Dec 06 02:49:01 2000 +0000 @@ -721,6 +721,7 @@ extern void load_prefs(); extern void save_prefs(); +gint sort_awaymsg_list(gconstpointer, gconstpointer); /* Functions in dialogs.c */ extern void alias_dialog(struct buddy_show *); diff -r 52431f1710f3 -r 2e5e20b05bee src/gaimrc.c --- a/src/gaimrc.c Tue Dec 05 23:37:45 2000 +0000 +++ b/src/gaimrc.c Wed Dec 06 02:49:01 2000 +0000 @@ -211,7 +211,7 @@ g_snprintf(a->name, sizeof(a->name), "%s", p->value[0]); g_snprintf(a->message, sizeof(a->message), "%s", p->value[1]); filter_break(a->message); - away_messages = g_slist_append(away_messages, a); + away_messages = g_slist_insert_sorted(away_messages, a, sort_awaymsg_list); } /* auto { time } { default message } */ else if (!strcmp(p->option, "auto")) @@ -889,3 +889,20 @@ } } + + +/* This function is called by g_slist_insert_sorted to compare the item + * being compared to the rest of the items on the list. + */ + +gint sort_awaymsg_list(gconstpointer a, gconstpointer b) +{ + struct away_message *msg_a; + struct away_message *msg_b; + + msg_a = (struct away_message *)a; + msg_b = (struct away_message *)b; + + return (strcmp(msg_a->name, msg_b->name)); + +}