Mercurial > pidgin.yaz
comparison src/protocols/irc/irc.c @ 2167:edf8c5a70e5b
[gaim-migrate @ 2177]
limiting chat message lengths
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sun, 26 Aug 2001 20:21:45 +0000 |
parents | a464da684307 |
children | c24595d3c364 |
comparison
equal
deleted
inserted
replaced
2166:dbd74f49dabb | 2167:edf8c5a70e5b |
---|---|
306 g_free(chat); | 306 g_free(chat); |
307 return b; | 307 return b; |
308 } | 308 } |
309 | 309 |
310 static void irc_chat_leave(struct gaim_connection *gc, int id); | 310 static void irc_chat_leave(struct gaim_connection *gc, int id); |
311 static void irc_chat_send(struct gaim_connection *gc, int id, char *message) | 311 static int irc_chat_send(struct gaim_connection *gc, int id, char *message) |
312 { | 312 { |
313 | 313 |
314 struct irc_data *idata = (struct irc_data *)gc->proto_data; | 314 struct irc_data *idata = (struct irc_data *)gc->proto_data; |
315 struct irc_channel *channel = NULL; | 315 struct irc_channel *channel = NULL; |
316 gchar *buf = (gchar *) g_malloc(IRC_BUF_LEN + 1); | 316 gchar *buf = (gchar *) g_malloc(IRC_BUF_LEN + 1); |
321 | 321 |
322 | 322 |
323 if (!channel) { | 323 if (!channel) { |
324 /* If for some reason we've lost our channel, let's bolt */ | 324 /* If for some reason we've lost our channel, let's bolt */ |
325 g_free(buf); | 325 g_free(buf); |
326 return; | 326 return -EINVAL; |
327 } | 327 } |
328 | 328 |
329 | 329 |
330 /* Before we actually send this, we should check to see if they're trying | 330 /* Before we actually send this, we should check to see if they're trying |
331 * To issue a command and handle it properly. */ | 331 * To issue a command and handle it properly. */ |
414 * if (convo) close (convo), but I'll let you decide where to put it. | 414 * if (convo) close (convo), but I'll let you decide where to put it. |
415 */ | 415 */ |
416 | 416 |
417 irc_chat_leave(gc, id); | 417 irc_chat_leave(gc, id); |
418 is_command = TRUE; | 418 is_command = TRUE; |
419 return; | 419 return 0; |
420 | 420 |
421 | 421 |
422 } | 422 } |
423 | 423 |
424 else if (!g_strncasecmp(message, "/join ", 6) && (strlen(message) > 6)) { | 424 else if (!g_strncasecmp(message, "/join ", 6) && (strlen(message) > 6)) { |
429 | 429 |
430 | 430 |
431 irc_join_chat(gc, 0, temp); | 431 irc_join_chat(gc, 0, temp); |
432 g_free(temp); | 432 g_free(temp); |
433 is_command = TRUE; | 433 is_command = TRUE; |
434 return; | 434 return 0; |
435 } | 435 } |
436 | 436 |
437 else if (!g_strncasecmp(message, "/raw ", 5) && (strlen(message) > 5)) { | 437 else if (!g_strncasecmp(message, "/raw ", 5) && (strlen(message) > 5)) { |
438 gchar *temp = (gchar *) g_malloc(IRC_BUF_LEN + 1); | 438 gchar *temp = (gchar *) g_malloc(IRC_BUF_LEN + 1); |
439 strcpy(temp, message + 5); | 439 strcpy(temp, message + 5); |
522 if (is_command == FALSE) | 522 if (is_command == FALSE) |
523 serv_got_chat_in(gc, id, gc->username, 0, message, time((time_t) NULL)); | 523 serv_got_chat_in(gc, id, gc->username, 0, message, time((time_t) NULL)); |
524 | 524 |
525 g_free(buf); | 525 g_free(buf); |
526 | 526 |
527 | 527 return 0; |
528 } | 528 } |
529 | |
529 static struct conversation *find_conversation_by_id(struct gaim_connection *gc, int id) | 530 static struct conversation *find_conversation_by_id(struct gaim_connection *gc, int id) |
530 { | 531 { |
531 GSList *bc = gc->buddy_chats; | 532 GSList *bc = gc->buddy_chats; |
532 struct conversation *b = NULL; | 533 struct conversation *b = NULL; |
533 | 534 |