Changeset debe871


Ignore:
Timestamp:
2010-07-09T21:06:38Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
c5bff81
Parents:
9595d2b
Message:

Inform IPC master about nick changes.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ipc.c

    r9595d2b rdebe871  
    5050        }
    5151       
     52        /* CLIENT == On initial connects, HELLO is after /RESTARTs. */
    5253        if( g_strcasecmp( cmd[0], "CLIENT" ) == 0 )
    5354                ipc_to_children_str( "OPERMSG :Client connecting (PID=%d): %s@%s (%s)\r\n",
    5455                                     (int) ( child ? child->pid : -1 ), cmd[2], cmd[1], cmd[3] );
     56}
     57
     58static void ipc_master_cmd_nick( irc_t *data, char **cmd )
     59{
     60        struct bitlbee_child *child = (void*) data;
     61       
     62        if( child && cmd[1] )
     63        {
     64                g_free( child->nick );
     65                child->nick = g_strdup( cmd[1] );
     66        }
    5567}
    5668
     
    208220        { "client",     3, ipc_master_cmd_client,     0 },
    209221        { "hello",      0, ipc_master_cmd_client,     0 },
     222        { "nick",       1, ipc_master_cmd_nick,       0 },
    210223        { "die",        0, ipc_master_cmd_die,        0 },
    211224        { "deaf",       0, ipc_master_cmd_deaf,       0 },
  • irc_user.c

    r9595d2b rdebe871  
    2525
    2626#include "bitlbee.h"
     27#include "ipc.h"
    2728
    2829irc_user_t *irc_user_new( irc_t *irc, const char *nick )
     
    158159        irc->users = g_slist_insert_sorted( irc->users, iu, irc_user_cmp );
    159160       
     161        if( iu == irc->user )
     162                ipc_to_master_str( "NICK :%s\r\n", new );
     163       
    160164        return 1;
    161165}
Note: See TracChangeset for help on using the changeset viewer.