Changeset a97a336


Ignore:
Timestamp:
2010-12-07T23:14:30Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
83f1bd1d
Parents:
d76e12f
Message:

Add CTCP HELP code. Also cleaning up some noop handlers in the Twitter
module (chat_with and send_typing) that suggested support for features
that obviously don't exist.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • irc_im.c

    rd76e12f ra97a336  
    513513                }
    514514        }
     515        else if( g_strcasecmp( ctcp[0], "HELP" ) == 0 && iu->bu )
     516        {
     517                GString *supp = g_string_new( "Supported CTCPs:" );
     518                GList *l;
     519               
     520                if( iu->bu->ic && iu->bu->ic->acc->prpl->transfer_request )
     521                        g_string_append( supp, " DCC SEND," );
     522                if( iu->bu->ic && iu->bu->ic->acc->prpl->send_typing )
     523                        g_string_append( supp, " TYPING," );
     524                if( iu->bu->ic->acc->prpl->buddy_action_list )
     525                        for( l = iu->bu->ic->acc->prpl->buddy_action_list( iu->bu ); l; l = l->next )
     526                        {
     527                                struct buddy_action *ba = l->data;
     528                                g_string_append_printf( supp, " %s (%s),",
     529                                                        ba->name, ba->description );
     530                        }
     531                g_string_truncate( supp, supp->len - 1 );
     532                irc_send_msg_f( iu, "NOTICE", iu->irc->user->nick, "\001HELP %s\001", supp->str );
     533                g_string_free( supp, TRUE );
     534        }
    515535        else if( iu->bu && iu->bu->ic && iu->bu->ic->acc->prpl->buddy_action )
    516536        {
  • protocols/jabber/jabber.c

    rd76e12f ra97a336  
    570570        if( ret == NULL )
    571571        {
    572                 struct buddy_action ba[2] = {
     572                static const struct buddy_action ba[2] = {
    573573                        { "VERSION", "Get client (version) information" },
    574574                };
    575575               
    576                 ret = g_list_prepend( ret, ba + 0 );
     576                ret = g_list_prepend( ret, (void*) ba + 0 );
    577577        }
    578578       
  • protocols/twitter/twitter.c

    rd76e12f ra97a336  
    377377}
    378378
    379 static struct groupchat *twitter_chat_with( struct im_connection *ic, char *who )
    380 {
    381         return NULL;
    382 }
    383 
    384379static void twitter_keepalive( struct im_connection *ic )
    385380{
     
    400395static void twitter_rem_deny( struct im_connection *ic, char *who )
    401396{
    402 }
    403 
    404 static int twitter_send_typing( struct im_connection *ic, char *who, int typing )
    405 {
    406         return( 1 );
    407397}
    408398
     
    552542        ret->chat_invite = twitter_chat_invite;
    553543        ret->chat_leave = twitter_chat_leave;
    554         ret->chat_with = twitter_chat_with;
    555544        ret->keepalive = twitter_keepalive;
    556545        ret->add_permit = twitter_add_permit;
     
    558547        ret->add_deny = twitter_add_deny;
    559548        ret->rem_deny = twitter_rem_deny;
    560         ret->send_typing = twitter_send_typing;
    561549        ret->buddy_data_add = twitter_buddy_data_add;
    562550        ret->buddy_data_free = twitter_buddy_data_free;
Note: See TracChangeset for help on using the changeset viewer.