Changeset d860a8d for irc_im.c


Ignore:
Timestamp:
2010-04-01T03:38:50Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
e63507a
Parents:
81e04e1
Message:

Restored "account" root command and restored enough stuff to be able to
send messages. Also started moving stuff out from nogaim.* into bee_* files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_im.c

    r81e04e1 rd860a8d  
    2626#include "bitlbee.h"
    2727
     28
     29/* IM->IRC callbacks */
     30
    2831static const struct irc_user_funcs irc_user_im_funcs;
    29 static const struct bee_ui_funcs irc_ui_funcs;
    3032
    3133static gboolean bee_irc_user_new( bee_t *bee, bee_user_t *bu )
     
    3739        strcpy( nick, nick_get( bu->ic->acc, bu->handle ) );
    3840       
    39         iu = irc_user_new( (irc_t*) bee->ui_data, nick );
     41        bu->ui_data = iu = irc_user_new( (irc_t*) bee->ui_data, nick );
     42        iu->bu = bu;
    4043       
    4144        if( ( s = strchr( bu->handle, '@' ) ) )
     
    6669}
    6770
     71static gboolean bee_irc_user_free( bee_t *bee, bee_user_t *bu )
     72{
     73        return irc_user_free( bee->ui_data, bu->ui_data );
     74}
     75
     76static gboolean bee_irc_user_status( bee_t *bee, bee_user_t *bu, bee_user_t *old )
     77{
     78        return TRUE;
     79}
     80
     81const struct bee_ui_funcs irc_ui_funcs = {
     82        bee_irc_user_new,
     83        bee_irc_user_free,
     84        bee_irc_user_status,
     85};
    6886
    6987
    70 static const struct bee_ui_funcs irc_ui_funcs = {
    71         bee_irc_user_new,
    72 };
     88/* IRC->IM calls */
     89
     90static gboolean bee_irc_user_privmsg( irc_user_t *iu, const char *msg )
     91{
     92        if( iu->bu )
     93                return bee_user_msg( iu->irc->b, iu->bu, msg, 0 );
     94        else
     95                return FALSE;
     96}
    7397
    7498static const struct irc_user_funcs irc_user_im_funcs = {
     99        bee_irc_user_privmsg,
    75100};
Note: See TracChangeset for help on using the changeset viewer.