Changeset eb50495


Ignore:
Timestamp:
2010-05-04T08:45:10Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
9438323
Parents:
9893da3
Message:

Show offline/away status better in /WHO and /WHOIS.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • irc.h

    r9893da3 reb50495  
    9191{
    9292        IRC_USER_PRIVATE = 1,
     93        IRC_USER_AWAY = 2,
    9394} irc_user_flags_t;
    9495
  • irc_im.c

    r9893da3 reb50495  
    8282        irc_user_t *iu = bu->ui_data;
    8383        irc_channel_t *ic = irc->channels->data; /* For now, just pick the first channel. */
     84       
     85        /* Do this outside the if below since away state can change without
     86           the online state changing. */
     87        iu->flags &= ~IRC_USER_AWAY;
     88        if( bu->flags & BEE_USER_AWAY || !( bu->flags & BEE_USER_ONLINE ) )
     89                iu->flags |= IRC_USER_AWAY;
    8490       
    8591        if( ( bu->flags & BEE_USER_ONLINE ) != ( old->flags & BEE_USER_ONLINE ) )
  • irc_send.c

    r9893da3 reb50495  
    231231                                irc_send_num( irc, num, "%s :%s", iu->nick, bu->status ? : bu->status_msg );
    232232                }
     233                else if( !( bu->flags & BEE_USER_ONLINE ) )
     234                {
     235                        irc_send_num( irc, 301, "%s :%s", iu->nick, "User is offline" );
     236                }
    233237        }
    234238        else
     
    252256                irc_send_num( irc, 352, "%s %s %s %s %s %c :0 %s",
    253257                              channel ? : "*", iu->user, iu->host, irc->root->host,
    254                               iu->nick, 'H', iu->fullname );
     258                              iu->nick, iu->flags & IRC_USER_AWAY ? 'G' : 'H',
     259                              iu->fullname );
    255260                l = l->next;
    256261        }
  • protocols/bee_user.c

    r9893da3 reb50495  
    4242        if( bee->ui->user_new )
    4343                bee->ui->user_new( bee, bu );
     44       
     45        /* Offline by default. This will set the right flags. */
     46        imcb_buddy_status( ic, handle, 0, NULL, NULL );
    4447       
    4548        return bu;
Note: See TracChangeset for help on using the changeset viewer.