comparison mcabber/src/screen.c @ 123:1bdf882bed98

[/trunk] Changeset 136 by mikael * Fix a display problem when there is only one buddy connected and hide_offline is set and this buddy goes offline.
author mikael
date Tue, 26 Apr 2005 10:11:57 +0000
parents 94b251102069
children d3ee9abe9ca6
comparison
equal deleted inserted replaced
122:235fdd5bfd5d 123:1bdf882bed98
444 int maxx, maxy; 444 int maxx, maxy;
445 GList *buddy; 445 GList *buddy;
446 int i, n; 446 int i, n;
447 int rOffset; 447 int rOffset;
448 448
449 // We can reset update_roster
450 update_roster = FALSE;
451
449 getmaxyx(rosterWnd, maxy, maxx); 452 getmaxyx(rosterWnd, maxy, maxx);
450 maxx --; // last char is for vertical border 453 maxx --; // last char is for vertical border
451 name[ROSTER_WIDTH-7] = 0; 454 name[ROSTER_WIDTH-7] = 0;
452 455
453 // cleanup of roster window 456 // cleanup of roster window
459 } 462 }
460 463
461 // Leave now if buddylist is empty 464 // Leave now if buddylist is empty
462 if (!buddylist) { 465 if (!buddylist) {
463 offset = 0; 466 offset = 0;
467 update_panels();
468 doupdate();
464 return; 469 return;
465 } 470 }
466 471
467 // Update offset if necessary 472 // Update offset if necessary
468 i = g_list_position(buddylist, current_buddy); 473 i = g_list_position(buddylist, current_buddy);
469 if (i == -1) { // This is bad 474 if (i == -1) { // This is bad
470 scr_LogPrint("Doh! Can't find current selected buddy!!"); 475 scr_LogPrint("Doh! Can't find current selected buddy!!");
476 update_panels();
477 doupdate();
471 return; 478 return;
472 } else if (i < offset) { 479 } else if (i < offset) {
473 offset = i; 480 offset = i;
474 } else if (i+1 > offset + maxy) { 481 } else if (i+1 > offset + maxy) {
475 offset = i + 1 - maxy; 482 offset = i + 1 - maxy;
514 i++; 521 i++;
515 } 522 }
516 523
517 update_panels(); 524 update_panels();
518 doupdate(); 525 doupdate();
519 update_roster = FALSE;
520 } 526 }
521 527
522 void scr_WriteMessage(const char *jid, const char *text, char *prefix) 528 void scr_WriteMessage(const char *jid, const char *text, char *prefix)
523 { 529 {
524 scr_WriteInWindow(jid, text, TRUE, prefix, FALSE); 530 scr_WriteInWindow(jid, text, TRUE, prefix, FALSE);