diff mcabber/src/screen.c @ 330:a9013124ede6

Add "/roster alternate"
author Mikael Berthe <mikael@lilotux.net>
date Sun, 17 Jul 2005 21:17:52 +0100
parents 7c53bf62a2a2
children a1901741890e
line wrap: on
line diff
--- a/mcabber/src/screen.c	Sun Jul 17 21:16:15 2005 +0100
+++ b/mcabber/src/screen.c	Sun Jul 17 21:17:52 2005 +0100
@@ -823,6 +823,8 @@
 
   prev_st = buddy_getstatus(BUDDATA(current_buddy));
   buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE);
+  if (chatmode)
+    alternate_buddy = current_buddy;
   current_buddy = newbuddy;
   // Lock the buddy in the buddylist if we're in chat mode
   if (chatmode)
@@ -913,6 +915,17 @@
   } else scr_LogPrint("Error: nbuddy == NULL");
 }
 
+//  scr_RosterJumpAlternate()
+// Try to jump to alternate (== previous) buddy
+void scr_RosterJumpAlternate(void)
+{
+  if (!alternate_buddy || g_list_position(buddylist, alternate_buddy) == -1)
+    return;
+  set_current_buddy(alternate_buddy);
+  if (chatmode)
+    scr_ShowBuddyWindow();
+}
+
 //  scr_ScrollUp()
 // Scroll up the current buddy window, half a screen.
 void scr_ScrollUp(void)