286 if (win_entry != NULL) { |
286 if (win_entry != NULL) { |
287 top_panel(win_entry->panel); |
287 top_panel(win_entry->panel); |
288 currentWindow = win_entry; |
288 currentWindow = win_entry; |
289 chatmode = TRUE; |
289 chatmode = TRUE; |
290 roster_setflags(winId, ROSTER_FLAG_MSG, FALSE); |
290 roster_setflags(winId, ROSTER_FLAG_MSG, FALSE); |
|
291 roster_setflags(winId, ROSTER_FLAG_LOCK, TRUE); |
291 update_roster = TRUE; |
292 update_roster = TRUE; |
292 |
293 |
293 // Refresh the window |
294 // Refresh the window |
294 scr_UpdateWindow(win_entry); |
295 scr_UpdateWindow(win_entry); |
295 |
296 |
562 return inputWnd; |
563 return inputWnd; |
563 } |
564 } |
564 |
565 |
565 void scr_RosterTop(void) |
566 void scr_RosterTop(void) |
566 { |
567 { |
|
568 enum imstatus prev_st; |
|
569 |
|
570 if (current_buddy) { |
|
571 prev_st = buddy_getstatus(BUDDATA(current_buddy)); |
|
572 if (chatmode) |
|
573 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); |
|
574 } |
567 current_buddy = buddylist; |
575 current_buddy = buddylist; |
568 // XXX We should rebuild the buddylist but perhaps not everytime? |
576 if (chatmode && current_buddy) |
|
577 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE); |
|
578 |
|
579 // We should rebuild the buddylist but not everytime |
|
580 if (current_buddy && prev_st == offline) |
|
581 buddylist_build(); |
569 if (chatmode) |
582 if (chatmode) |
570 scr_ShowBuddyWindow(); |
583 scr_ShowBuddyWindow(); |
571 } |
584 } |
572 |
585 |
573 void scr_RosterBottom(void) |
586 void scr_RosterBottom(void) |
574 { |
587 { |
|
588 enum imstatus prev_st; |
|
589 |
|
590 if (current_buddy) { |
|
591 prev_st = buddy_getstatus(BUDDATA(current_buddy)); |
|
592 if (chatmode) |
|
593 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); |
|
594 } |
575 current_buddy = g_list_last(buddylist); |
595 current_buddy = g_list_last(buddylist); |
576 // XXX We should rebuild the buddylist but perhaps not everytime? |
596 if (chatmode && current_buddy) |
|
597 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE); |
|
598 |
|
599 // We should rebuild the buddylist but not everytime |
|
600 if (current_buddy && prev_st == offline) |
|
601 buddylist_build(); |
577 if (chatmode) |
602 if (chatmode) |
578 scr_ShowBuddyWindow(); |
603 scr_ShowBuddyWindow(); |
579 } |
604 } |
580 |
605 |
581 void scr_RosterUp(void) |
606 void scr_RosterUp(void) |
582 { |
607 { |
|
608 enum imstatus prev_st; |
|
609 |
583 if (current_buddy) { |
610 if (current_buddy) { |
|
611 prev_st = buddy_getstatus(BUDDATA(current_buddy)); |
584 if (g_list_previous(current_buddy)) { |
612 if (g_list_previous(current_buddy)) { |
|
613 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); |
585 current_buddy = g_list_previous(current_buddy); |
614 current_buddy = g_list_previous(current_buddy); |
|
615 if (chatmode) |
|
616 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE); |
|
617 // We should rebuild the buddylist but not everytime |
|
618 if (prev_st == offline) |
|
619 buddylist_build(); |
586 scr_DrawRoster(); |
620 scr_DrawRoster(); |
587 } |
621 } |
588 } |
622 } |
589 // XXX We should rebuild the buddylist but perhaps not everytime? |
|
590 |
623 |
591 if (chatmode) |
624 if (chatmode) |
592 scr_ShowBuddyWindow(); |
625 scr_ShowBuddyWindow(); |
593 } |
626 } |
594 |
627 |
595 void scr_RosterDown(void) |
628 void scr_RosterDown(void) |
596 { |
629 { |
|
630 enum imstatus prev_st; |
|
631 |
597 if (current_buddy) { |
632 if (current_buddy) { |
|
633 prev_st = buddy_getstatus(BUDDATA(current_buddy)); |
598 if (g_list_next(current_buddy)) { |
634 if (g_list_next(current_buddy)) { |
|
635 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); |
599 current_buddy = g_list_next(current_buddy); |
636 current_buddy = g_list_next(current_buddy); |
|
637 if (chatmode) |
|
638 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE); |
|
639 // We should rebuild the buddylist but not everytime |
|
640 if (prev_st == offline) |
|
641 buddylist_build(); |
600 scr_DrawRoster(); |
642 scr_DrawRoster(); |
601 } |
643 } |
602 } |
644 } |
603 // XXX We should rebuild the buddylist but perhaps not everytime? |
|
604 |
645 |
605 if (chatmode) |
646 if (chatmode) |
606 scr_ShowBuddyWindow(); |
647 scr_ShowBuddyWindow(); |
607 } |
648 } |
608 |
649 |