- Timestamp:
- 2010-10-09T18:41:19Z (14 years ago)
- Branches:
- master
- Children:
- d150a9d
- Parents:
- 23b29c6 (diff), 27b407f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_im.c
r23b29c6 r6197702 192 192 } 193 193 194 static gboolean bee_irc_user_msg( bee_t *bee, bee_user_t *bu, const char *msg , time_t sent_at )194 static gboolean bee_irc_user_msg( bee_t *bee, bee_user_t *bu, const char *msg_, time_t sent_at ) 195 195 { 196 196 irc_t *irc = bee->ui_data; … … 199 199 char *wrapped, *ts = NULL; 200 200 irc_channel_t *ic = NULL; 201 char *msg = g_strdup( msg_ ); 202 GSList *l; 201 203 202 204 if( sent_at > 0 && set_getbool( &irc->b->set, "display_timestamps" ) ) … … 224 226 } 225 227 228 for( l = irc_plugins; l; l = l->next ) 229 { 230 irc_plugin_t *p = l->data; 231 if( p->filter_msg_in ) 232 { 233 char *s = p->filter_msg_in( iu, msg, 0 ); 234 if( s ) 235 { 236 if( s != msg ) 237 g_free( msg ); 238 msg = s; 239 } 240 else 241 { 242 /* Modules can swallow messages. */ 243 return TRUE; 244 } 245 } 246 } 247 248 if( ( g_strcasecmp( set_getstr( &bee->set, "strip_html" ), "always" ) == 0 ) || 249 ( ( bu->ic->flags & OPT_DOES_HTML ) && set_getbool( &bee->set, "strip_html" ) ) ) 250 { 251 char *s = g_strdup( msg ); 252 strip_html( s ); 253 g_free( msg ); 254 msg = s; 255 } 256 226 257 wrapped = word_wrap( msg, 425 ); 227 258 irc_send_msg( iu, "PRIVMSG", dst, wrapped, prefix ); … … 229 260 g_free( wrapped ); 230 261 g_free( prefix ); 262 g_free( msg ); 231 263 g_free( ts ); 232 264 … … 349 381 } 350 382 383 if( iu->pastebuf == NULL ) 384 iu->pastebuf = g_string_new( msg ); 385 else 386 { 387 b_event_remove( iu->pastebuf_timer ); 388 g_string_append_printf( iu->pastebuf, "\n%s", msg ); 389 } 390 351 391 if( set_getbool( &iu->irc->b->set, "paste_buffer" ) ) 352 392 { 353 393 int delay; 354 355 if( iu->pastebuf == NULL )356 iu->pastebuf = g_string_new( msg );357 else358 {359 b_event_remove( iu->pastebuf_timer );360 g_string_append_printf( iu->pastebuf, "\n%s", msg );361 }362 394 363 395 if( ( delay = set_getint( &iu->irc->b->set, "paste_buffer_delay" ) ) <= 5 ) … … 369 401 } 370 402 else 371 return bee_user_msg( iu->irc->b, iu->bu, msg, 0 ); 403 { 404 bee_irc_user_privmsg_cb( iu, 0, 0 ); 405 406 return TRUE; 407 } 372 408 } 373 409 … … 375 411 { 376 412 irc_user_t *iu = data; 377 378 bee_user_msg( iu->irc->b, iu->bu, iu->pastebuf->str, 0 ); 379 380 g_string_free( iu->pastebuf, TRUE ); 381 iu->pastebuf = 0; 413 char *msg = g_string_free( iu->pastebuf, FALSE ); 414 GSList *l; 415 416 for( l = irc_plugins; l; l = l->next ) 417 { 418 irc_plugin_t *p = l->data; 419 if( p->filter_msg_out ) 420 { 421 char *s = p->filter_msg_out( iu, msg, 0 ); 422 if( s ) 423 { 424 if( s != msg ) 425 g_free( msg ); 426 msg = s; 427 } 428 else 429 { 430 /* Modules can swallow messages. */ 431 iu->pastebuf = NULL; 432 g_free( msg ); 433 return FALSE; 434 } 435 } 436 } 437 438 bee_user_msg( iu->irc->b, iu->bu, msg, 0 ); 439 440 g_free( msg ); 441 iu->pastebuf = NULL; 382 442 iu->pastebuf_timer = 0; 383 443
Note: See TracChangeset
for help on using the changeset viewer.