diff mcabber/mcabber/roster.c @ 1996:7837d5a3f509

Going back to the first buddy with /roster next_unread when there is no more unread messages.
author Simon Jacquin
date Sun, 22 May 2011 23:30:37 +0200
parents 6febc7d1f760
children 8dc418af3e72
line wrap: on
line diff
--- a/mcabber/mcabber/roster.c	Sat Apr 16 09:25:21 2011 +0200
+++ b/mcabber/mcabber/roster.c	Sun May 22 23:30:37 2011 +0200
@@ -127,6 +127,7 @@
 GList *buddylist;
 GList *current_buddy;
 GList *alternate_buddy;
+GList *last_activity_buddy;
 
 static roster roster_special;
 
@@ -960,6 +961,7 @@
   roster *roster_elt;
   roster *roster_current_buddy = NULL;
   roster *roster_alternate_buddy = NULL;
+  roster *roster_last_activity_buddy = NULL;
   int shrunk_group;
 
   // We need to remember which buddy is selected.
@@ -969,6 +971,9 @@
   if (alternate_buddy)
     roster_alternate_buddy = BUDDATA(alternate_buddy);
   alternate_buddy = NULL;
+  if (last_activity_buddy)
+    roster_last_activity_buddy = BUDDATA(last_activity_buddy);
+  last_activity_buddy = NULL;
 
   // Destroy old buddylist
   if (buddylist) {
@@ -1026,6 +1031,8 @@
     current_buddy = g_list_find(buddylist, roster_current_buddy);
   if (roster_alternate_buddy)
     alternate_buddy = g_list_find(buddylist, roster_alternate_buddy);
+  if (roster_last_activity_buddy)
+    last_activity_buddy = g_list_find(buddylist, roster_last_activity_buddy);
   // current_buddy initialization
   if (!current_buddy || (g_list_position(buddylist, current_buddy) == -1))
     current_buddy = g_list_first(buddylist);