Changeset bce78c8


Ignore:
Timestamp:
2010-05-02T18:48:26Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
e54112f
Parents:
a4cdf43
Message:

Restored classical control channel behaviour (the ability to talk to
contacts in there).

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • irc_channel.c

    ra4cdf43 rbce78c8  
    145145static gboolean control_channel_privmsg( irc_channel_t *ic, const char *msg )
    146146{
    147         char cmd[strlen(msg)+1];
     147        irc_t *irc = ic->irc;
     148        const char *s;
    148149       
    149         g_free( ic->irc->last_root_cmd );
    150         ic->irc->last_root_cmd = g_strdup( ic->name );
     150        /* Scan for non-whitespace chars followed by a colon: */
     151        for( s = msg; *s && !isspace( *s ) && *s != ':'; s ++ ) {}
    151152       
    152         strcpy( cmd, msg );
    153         root_command_string( ic->irc, cmd );
     153        if( *s == ':' )
     154        {
     155                char to[s-msg+1];
     156                irc_user_t *iu;
     157               
     158                strncpy( to, msg, s - msg );
     159                while( *(++s) && isspace( *s ) ) {}
     160               
     161                iu = irc_user_by_name( irc, to );
     162                if( iu && iu->f->privmsg )
     163                {
     164                        iu->flags &= ~IRC_USER_PRIVATE;
     165                        iu->f->privmsg( iu, s );
     166                }
     167        }
     168        else
     169        {
     170                /* TODO: Maybe just use root->privmsg here now? */
     171                char cmd[strlen(msg)+1];
     172               
     173                g_free( ic->irc->last_root_cmd );
     174                ic->irc->last_root_cmd = g_strdup( ic->name );
     175               
     176                strcpy( cmd, msg );
     177                root_command_string( ic->irc, cmd );
     178        }
    154179       
    155180        return TRUE;
  • irc_commands.c

    ra4cdf43 rbce78c8  
    288288                }
    289289                else if( iu->f->privmsg )
     290                {
     291                        iu->flags |= IRC_USER_PRIVATE;
    290292                        iu->f->privmsg( iu, cmd[2] );
     293                }
    291294        }
    292295        else
  • irc_im.c

    ra4cdf43 rbce78c8  
    126126        {
    127127                dst = ic->name;
    128                 prefix = g_strdup_printf( "%s%s%s", irc->user->nick, set_getstr( &bee->set, "to_char" ), ts );
     128                prefix = g_strdup_printf( "%s%s%s", irc->user->nick, set_getstr( &bee->set, "to_char" ), ts ? : "" );
    129129        }
    130130       
Note: See TracChangeset for help on using the changeset viewer.