Changeset aea8b68 for irc_im.c


Ignore:
Timestamp:
2010-05-06T00:28:56Z (11 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
f1a0890
Parents:
9438323
Message:

Starting to restore chatroom stuff. Only enough to create and be joined
into a room. More will follow soon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_im.c

    r9438323 raea8b68  
    203203}
    204204
     205
     206/* Groupchats */
     207gboolean bee_irc_chat_new( bee_t *bee, struct groupchat *c )
     208{
     209        irc_t *irc = bee->ui_data;
     210        irc_channel_t *ic;
     211        char *topic;
     212        int i;
     213       
     214        for( i = 0; i <= 999; i ++ )
     215        {
     216                char name[16];
     217                sprintf( name, "&chat_%03d", i );
     218                if( ( ic = irc_channel_new( irc, name ) ) )
     219                        break;
     220        }
     221       
     222        if( ic == NULL )
     223                return FALSE;
     224       
     225        c->ui_data = ic;
     226        ic->data = c;
     227       
     228        topic = g_strdup_printf( "BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", c->title );
     229        irc_channel_set_topic( ic, topic, irc->root );
     230        g_free( topic );
     231       
     232        return TRUE;
     233}
     234
     235gboolean bee_irc_chat_free( bee_t *bee, struct groupchat *c )
     236{
     237        irc_channel_t *ic = c->ui_data;
     238       
     239        if( ic->flags & IRC_CHANNEL_JOINED )
     240                irc_channel_printf( ic, "Cleaning up channel, bye!" );
     241       
     242        irc_channel_free( ic );
     243       
     244        return TRUE;
     245}
     246
     247gboolean bee_irc_chat_log( bee_t *bee, struct groupchat *c, const char *format, ... )
     248{
     249}
     250
     251gboolean bee_irc_chat_msg( bee_t *bee, struct groupchat *c, const char *who, const char *msg, time_t sent_at )
     252{
     253}
     254
     255gboolean bee_irc_chat_add_user( bee_t *bee, struct groupchat *c, bee_user_t *bu )
     256{
     257        irc_t *irc = bee->ui_data;
     258       
     259        irc_channel_add_user( c->ui_data, bu == bee->user ? irc->user : bu->ui_data );
     260}
     261
     262gboolean bee_irc_chat_remove_user( bee_t *bee, struct groupchat *c, bee_user_t *bu )
     263{
     264}
     265
     266
    205267/* File transfers */
    206268static file_transfer_t *bee_irc_ft_in_start( bee_t *bee, bee_user_t *bu, const char *file_name, size_t file_size )
     
    237299        bee_irc_user_typing,
    238300       
     301        bee_irc_chat_new,
     302        bee_irc_chat_free,
     303        NULL,
     304        NULL,
     305        bee_irc_chat_add_user,
     306        NULL,
     307       
    239308        bee_irc_ft_in_start,
    240309        bee_irc_ft_out_start,
Note: See TracChangeset for help on using the changeset viewer.