comparison mcabber/src/screen.c @ 120:cfd3df636d5f

[/trunk] Changeset 133 by mikael * Small optimization.
author mikael
date Mon, 25 Apr 2005 20:56:23 +0000
parents d7fbd5293385
children 94b251102069
comparison
equal deleted inserted replaced
119:d7fbd5293385 120:cfd3df636d5f
575 current_buddy = buddylist; 575 current_buddy = buddylist;
576 if (chatmode && current_buddy) 576 if (chatmode && current_buddy)
577 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE); 577 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE);
578 578
579 // We should rebuild the buddylist but not everytime 579 // We should rebuild the buddylist but not everytime
580 if (current_buddy && prev_st == offline) 580 if (current_buddy && prev_st == offline &&
581 buddylist_get_hide_offline_buddies())
581 buddylist_build(); 582 buddylist_build();
582 if (chatmode) 583 if (chatmode)
583 scr_ShowBuddyWindow(); 584 scr_ShowBuddyWindow();
584 } 585 }
585 586
595 current_buddy = g_list_last(buddylist); 596 current_buddy = g_list_last(buddylist);
596 if (chatmode && current_buddy) 597 if (chatmode && current_buddy)
597 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE); 598 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE);
598 599
599 // We should rebuild the buddylist but not everytime 600 // We should rebuild the buddylist but not everytime
600 if (current_buddy && prev_st == offline) 601 if (current_buddy && prev_st == offline &&
602 buddylist_get_hide_offline_buddies())
601 buddylist_build(); 603 buddylist_build();
602 if (chatmode) 604 if (chatmode)
603 scr_ShowBuddyWindow(); 605 scr_ShowBuddyWindow();
604 } 606 }
605 607
606 void scr_RosterUp(void) 608 void scr_RosterUp(void)
607 { 609 {
608 enum imstatus prev_st; 610 enum imstatus prev_st;
609 611
610 if (current_buddy) { 612 if (current_buddy) {
611 prev_st = buddy_getstatus(BUDDATA(current_buddy));
612 if (g_list_previous(current_buddy)) { 613 if (g_list_previous(current_buddy)) {
614 prev_st = buddy_getstatus(BUDDATA(current_buddy));
613 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); 615 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE);
614 current_buddy = g_list_previous(current_buddy); 616 current_buddy = g_list_previous(current_buddy);
615 if (chatmode) 617 if (chatmode)
616 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE); 618 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE);
617 // We should rebuild the buddylist but not everytime 619 // We should rebuild the buddylist but not everytime
618 if (prev_st == offline) 620 if (prev_st == offline && buddylist_get_hide_offline_buddies())
619 buddylist_build(); 621 buddylist_build();
620 scr_DrawRoster(); 622 scr_DrawRoster();
621 } 623 }
622 } 624 }
623 625
628 void scr_RosterDown(void) 630 void scr_RosterDown(void)
629 { 631 {
630 enum imstatus prev_st; 632 enum imstatus prev_st;
631 633
632 if (current_buddy) { 634 if (current_buddy) {
633 prev_st = buddy_getstatus(BUDDATA(current_buddy));
634 if (g_list_next(current_buddy)) { 635 if (g_list_next(current_buddy)) {
636 prev_st = buddy_getstatus(BUDDATA(current_buddy));
635 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); 637 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE);
636 current_buddy = g_list_next(current_buddy); 638 current_buddy = g_list_next(current_buddy);
637 if (chatmode) 639 if (chatmode)
638 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE); 640 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE);
639 // We should rebuild the buddylist but not everytime 641 // We should rebuild the buddylist but not everytime
640 if (prev_st == offline) 642 if (prev_st == offline && buddylist_get_hide_offline_buddies())
641 buddylist_build(); 643 buddylist_build();
642 scr_DrawRoster(); 644 scr_DrawRoster();
643 } 645 }
644 } 646 }
645 647