Changeset bce78c8 for irc_channel.c
- Timestamp:
- 2010-05-02T18:48:26Z (11 years ago)
- Branches:
- master
- Children:
- e54112f
- Parents:
- a4cdf43
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_channel.c
ra4cdf43 rbce78c8 145 145 static gboolean control_channel_privmsg( irc_channel_t *ic, const char *msg ) 146 146 { 147 char cmd[strlen(msg)+1]; 147 irc_t *irc = ic->irc; 148 const char *s; 148 149 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 ++ ) {} 151 152 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 } 154 179 155 180 return TRUE;
Note: See TracChangeset
for help on using the changeset viewer.