comparison mcabber/src/screen.c @ 149:9f74832eb4f8

[/trunk] Changeset 161 by mikael * Do not show message flag for unfolded groups. * Add _GNU_SOURCE to main.c, for the getline() prototype...
author mikael
date Sat, 30 Apr 2005 23:06:42 +0000
parents c3624b2a7059
children b69c0b7a23e3
comparison
equal deleted inserted replaced
148:c3624b2a7059 149:9f74832eb4f8
448 scrollok(logWnd, TRUE); 448 scrollok(logWnd, TRUE);
449 449
450 inputWnd = newwin(1, maxX, maxY-1, 0); 450 inputWnd = newwin(1, maxX, maxY-1, 0);
451 inputPanel = new_panel(inputWnd); 451 inputPanel = new_panel(inputWnd);
452 452
453 scr_DrawRoster(); 453 update_roster = TRUE;
454 return; 454 return;
455 } 455 }
456 456
457 // scr_DrawRoster() 457 // scr_DrawRoster()
458 // Actually, display the buddylist on the screen. 458 // Actually, display the buddylist on the screen.
507 for (i=0; i<maxy && buddy; buddy = g_list_next(buddy)) { 507 for (i=0; i<maxy && buddy; buddy = g_list_next(buddy)) {
508 508
509 char status = '?'; 509 char status = '?';
510 char pending = ' '; 510 char pending = ' ';
511 enum imstatus budstate; 511 enum imstatus budstate;
512 unsigned short ismsg = buddy_getflags(BUDDATA(buddy)) & ROSTER_FLAG_MSG;
513 unsigned short isgrp = buddy_gettype(BUDDATA(buddy)) & ROSTER_TYPE_GROUP;
514 unsigned short ishid = buddy_getflags(BUDDATA(buddy)) & ROSTER_FLAG_HIDE;
512 515
513 if (rOffset > 0) { 516 if (rOffset > 0) {
514 rOffset--; 517 rOffset--;
515 continue; 518 continue;
516 } 519 }
517 520
518 if (buddy_getflags(BUDDATA(buddy)) & ROSTER_FLAG_MSG) { 521 // Display message notice if there is a message flag, but not
522 // for unfolded groups.
523 if (ismsg && (!isgrp || ishid)) {
519 pending = '#'; 524 pending = '#';
520 } 525 }
521 526
522 budstate = buddy_getstatus(BUDDATA(buddy)); 527 budstate = buddy_getstatus(BUDDATA(buddy));
523 if (budstate >= 0 && budstate < imstatus_size) 528 if (budstate >= 0 && budstate < imstatus_size)
527 // The 3 following lines aim to color the whole line 532 // The 3 following lines aim to color the whole line
528 wmove(rosterWnd, i, 0); 533 wmove(rosterWnd, i, 0);
529 for (n = 0; n < maxx; n++) 534 for (n = 0; n < maxx; n++)
530 waddch(rosterWnd, ' '); 535 waddch(rosterWnd, ' ');
531 } else { 536 } else {
532 if (buddy_getflags(BUDDATA(buddy)) & ROSTER_FLAG_MSG) 537 if (pending == '#')
533 wattrset(rosterWnd, COLOR_PAIR(COLOR_NMSG)); 538 wattrset(rosterWnd, COLOR_PAIR(COLOR_NMSG));
534 else 539 else
535 wattrset(rosterWnd, COLOR_PAIR(COLOR_BD_DES)); 540 wattrset(rosterWnd, COLOR_PAIR(COLOR_BD_DES));
536 } 541 }
537 542
538 strncpy(name, buddy_getname(BUDDATA(buddy)), ROSTER_WIDTH-7); 543 strncpy(name, buddy_getname(BUDDATA(buddy)), ROSTER_WIDTH-7);
539 if (buddy_gettype(BUDDATA(buddy)) & ROSTER_TYPE_GROUP) { 544 if (isgrp) {
540 char *sep; 545 char *sep;
541 if (buddy_getflags(BUDDATA(buddy)) & ROSTER_FLAG_HIDE) 546 if (ishid)
542 sep = "+++"; 547 sep = "+++";
543 else 548 else
544 sep = "---"; 549 sep = "---";
545 mvwprintw(rosterWnd, i, 0, " %c%s %s", pending, sep, name); 550 mvwprintw(rosterWnd, i, 0, " %c%s %s", pending, sep, name);
546 } 551 }