Changeset 619dd18
- Timestamp:
- 2010-06-07T18:40:08Z (14 years ago)
- Branches:
- master
- Children:
- 6ef9065
- Parents:
- a4d920b
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
ra4d920b r619dd18 109 109 irc_user_flags_t flags; 110 110 111 char *sendbuf; 112 int sendbuf_len; 113 guint sendbuf_timer; 114 //int sendbuf_flags; 111 GString *pastebuf; 112 guint pastebuf_timer; 115 113 116 114 struct bee_user *bu; … … 150 148 GSList *users; 151 149 struct set *set; 150 151 GString *pastebuf; 152 guint pastebuf_timer; 152 153 153 154 const struct irc_channel_funcs *f; -
irc_im.c
ra4d920b r619dd18 273 273 /* IRC->IM calls */ 274 274 275 static gboolean bee_irc_user_privmsg_cb( gpointer data, gint fd, b_input_condition cond ); 276 275 277 static gboolean bee_irc_user_privmsg( irc_user_t *iu, const char *msg ) 276 278 { 277 if( iu->bu ) 279 if( iu->bu == NULL ) 280 return FALSE; 281 else if( set_getbool( &iu->irc->b->set, "paste_buffer" ) ) 282 { 283 int delay; 284 285 if( iu->pastebuf == NULL ) 286 iu->pastebuf = g_string_new( msg ); 287 else 288 { 289 b_event_remove( iu->pastebuf_timer ); 290 g_string_append_printf( iu->pastebuf, "\n%s", msg ); 291 } 292 293 if( ( delay = set_getint( &iu->irc->b->set, "paste_buffer_delay" ) ) <= 5 ) 294 delay *= 1000; 295 296 iu->pastebuf_timer = b_timeout_add( delay, bee_irc_user_privmsg_cb, iu ); 297 298 return TRUE; 299 } 300 else 278 301 return bee_user_msg( iu->irc->b, iu->bu, msg, 0 ); 279 else 280 return FALSE; 302 } 303 304 static gboolean bee_irc_user_privmsg_cb( gpointer data, gint fd, b_input_condition cond ) 305 { 306 irc_user_t *iu = data; 307 308 bee_user_msg( iu->irc->b, iu->bu, iu->pastebuf->str, 0 ); 309 310 g_string_free( iu->pastebuf, TRUE ); 311 iu->pastebuf = 0; 312 iu->pastebuf_timer = 0; 313 314 return FALSE; 281 315 } 282 316 … … 468 502 469 503 /* IRC->IM */ 504 static gboolean bee_irc_channel_chat_privmsg_cb( gpointer data, gint fd, b_input_condition cond ); 505 470 506 static gboolean bee_irc_channel_chat_privmsg( irc_channel_t *ic, const char *msg ) 471 507 { … … 474 510 if( c == NULL ) 475 511 return FALSE; 476 477 bee_chat_msg( ic->irc->b, c, msg, 0 ); 478 479 return TRUE; 512 else if( set_getbool( &ic->irc->b->set, "paste_buffer" ) ) 513 { 514 int delay; 515 516 if( ic->pastebuf == NULL ) 517 ic->pastebuf = g_string_new( msg ); 518 else 519 { 520 b_event_remove( ic->pastebuf_timer ); 521 g_string_append_printf( ic->pastebuf, "\n%s", msg ); 522 } 523 524 if( ( delay = set_getint( &ic->irc->b->set, "paste_buffer_delay" ) ) <= 5 ) 525 delay *= 1000; 526 527 ic->pastebuf_timer = b_timeout_add( delay, bee_irc_channel_chat_privmsg_cb, ic ); 528 529 return TRUE; 530 } 531 else 532 bee_chat_msg( ic->irc->b, c, msg, 0 ); 533 534 return TRUE; 535 } 536 537 static gboolean bee_irc_channel_chat_privmsg_cb( gpointer data, gint fd, b_input_condition cond ) 538 { 539 irc_channel_t *ic = data; 540 541 bee_chat_msg( ic->irc->b, ic->data, ic->pastebuf->str, 0 ); 542 543 g_string_free( ic->pastebuf, TRUE ); 544 ic->pastebuf = 0; 545 ic->pastebuf_timer = 0; 546 547 return FALSE; 480 548 } 481 549 -
irc_user.c
ra4d920b r619dd18 104 104 if( iu->nick != iu->host ) g_free( iu->host ); 105 105 if( iu->nick != iu->fullname ) g_free( iu->fullname ); 106 g_free( iu-> sendbuf );107 if( iu-> sendbuf_timer ) b_event_remove( iu->sendbuf_timer );106 g_free( iu->pastebuf ); 107 if( iu->pastebuf_timer ) b_event_remove( iu->pastebuf_timer ); 108 108 g_free( iu->key ); 109 109
Note: See TracChangeset
for help on using the changeset viewer.