Changeset fa29d093 for root_commands.c


Ignore:
Timestamp:
2007-03-28T05:53:11Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
0da65d5
Parents:
723e611
Message:

Preparing for Jabber conference room support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r723e611 rfa29d093  
    883883                else
    884884                        irc_usermsg( irc, "%d, BitlBee: %s", num, q->question );
     885}
     886
     887static void cmd_join_chat( irc_t *irc, char **cmd )
     888{
     889        account_t *a;
     890        struct gaim_connection *gc;
     891        char *chat, *channel, *nick = NULL, *password = NULL;
     892        struct conversation *c;
     893       
     894        if( !( a = account_get( irc, cmd[1] ) ) )
     895        {
     896                irc_usermsg( irc, "Invalid account" );
     897                return;
     898        }
     899        else if( !( a->gc && ( a->gc->flags & OPT_LOGGED_IN ) ) )
     900        {
     901                irc_usermsg( irc, "That account is not on-line" );
     902                return;
     903        }
     904        else if( a->prpl->chat_join == NULL )
     905        {
     906                irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] );
     907                return;
     908        }
     909        gc = a->gc;
     910       
     911        chat = cmd[2];
     912        if( cmd[3] )
     913        {
     914                channel = g_strdup( cmd[3] );
     915        }
     916        else
     917        {
     918                char *s;
     919               
     920                channel = g_strdup( chat );
     921                if( ( s = strchr( channel, '@' ) ) )
     922                        *s = 0;
     923        }
     924        if( cmd[3] && cmd[4] )
     925                nick = cmd[4];
     926        if( cmd[3] && cmd[4] && cmd[5] )
     927                password = cmd[5];
     928       
     929        c = a->prpl->chat_join( gc, chat, nick, password );
     930       
     931        g_free( channel );
    885932}
    886933
     
    904951        { "nick",           1, cmd_nick,           0 },
    905952        { "qlist",          0, cmd_qlist,          0 },
     953        { "join_chat",      2, cmd_join_chat,      0 },
    906954        { NULL }
    907955};
Note: See TracChangeset for help on using the changeset viewer.