comparison mcabber/mcabber/screen.c @ 2160:798baf5db4eb

Add /roster next_open_buffer Not documented yet. This command only applies to non-hidden entries; hidden buffers are ignored.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 05 Oct 2014 11:30:35 +0200
parents 1b3add57c912
children 038c4d601011
comparison
equal deleted inserted replaced
2159:96427d9e993c 2160:798baf5db4eb
2676 if (chatmode) scr_show_buddy_window(); 2676 if (chatmode) scr_show_buddy_window();
2677 } else 2677 } else
2678 scr_LogPrint(LPRINT_LOGNORM, "Error: nbuddy == NULL"); // should not happen 2678 scr_LogPrint(LPRINT_LOGNORM, "Error: nbuddy == NULL"); // should not happen
2679 } 2679 }
2680 2680
2681 // scr_roster_next_open_buffer()
2682 // Jump to the next open buffer (experimental XXX)
2683 // This implementation ignores the hidden entries (folded groups).
2684 void scr_roster_next_open_buffer(void)
2685 {
2686 GList *bud = current_buddy;
2687
2688 if (!current_buddy) return;
2689
2690 for (;;) {
2691 guint budtype;
2692 bud = g_list_next(bud);
2693 // End of list: jump to the first entry
2694 if (!bud)
2695 bud = buddylist;
2696 // Check if we're back to the initial position
2697 if (bud == current_buddy)
2698 break;
2699 // Ignore the special buffer(s), groups
2700 budtype = buddy_gettype(BUDDATA(bud));
2701 if (budtype & (ROSTER_TYPE_GROUP | ROSTER_TYPE_SPECIAL))
2702 continue;
2703
2704 // Check if a buffer/window exists
2705 if (scr_search_window(buddy_getjid(BUDDATA(bud)), 0)) {
2706 set_current_buddy(bud);
2707 if (chatmode) {
2708 last_activity_buddy = current_buddy;
2709 scr_show_buddy_window();
2710 }
2711 break;
2712 }
2713 }
2714 }
2715
2681 // scr_roster_jump_alternate() 2716 // scr_roster_jump_alternate()
2682 // Try to jump to alternate (== previous) buddy 2717 // Try to jump to alternate (== previous) buddy
2683 void scr_roster_jump_alternate(void) 2718 void scr_roster_jump_alternate(void)
2684 { 2719 {
2685 if (!alternate_buddy || g_list_position(buddylist, alternate_buddy) == -1) 2720 if (!alternate_buddy || g_list_position(buddylist, alternate_buddy) == -1)