Hello,

I believe the attached patch fixes the problem correctly.

Thanks,

-- 
[EMAIL PROTECTED]: Gustavo Noronha <http://people.debian.org/~kov>
Debian:  <http://www.debian.org>  *  <http://www.debian-br.org>

--- xchat-2.4.3.old/src/fe-gtk/fkeys.c	2005-03-11 03:32:28.000000000 -0300
+++ xchat-2.4.3/src/fe-gtk/fkeys.c	2005-08-06 12:16:04.471235317 -0300
@@ -1393,6 +1393,22 @@
 /* Used in the followig completers */
 #define COMP_BUF 2048
 
+/* For use in sorting the user list for completion */
+static int
+talked_recent_cmp (gconstpointer a, gconstpointer b)
+{
+  struct User *x, *y;
+  x = (struct User*)a;
+  y = (struct User*)b;
+
+  if (x->lasttalk < y->lasttalk)
+    return -1;
+  else if (x->lasttalk > y->lasttalk)
+    return 1;
+  else
+    return 0;
+}
+
 static int
 key_action_tab_comp (GtkWidget *t, GdkEventKey *entry, char *d1, char *d2,
 							struct session *sess)
@@ -1483,6 +1499,7 @@
 		{
 			gcomp = g_completion_new((GCompletionFunc)gcomp_nick_func);
 			tmp_list = userlist_double_list(sess); /* create a temp list so we can free the memory */
+			tmp_list = g_list_sort (tmp_list, talked_recent_cmp);
 		}
 		else
 		{

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to