diff src/gaimrc.c @ 1209:7aec3f881c98

[gaim-migrate @ 1219] Thanks, Justin committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Wed, 06 Dec 2000 02:49:01 +0000
parents f4d4a14752ee
children 0baf39dc5437
line wrap: on
line diff
--- 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));
+	
+}