Mercurial > pidgin.yaz
comparison src/server.c @ 258:1eeece1c7b7b
[gaim-migrate @ 268]
Small changes to chat.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 24 May 2000 10:07:01 +0000 |
parents | 7615d22ad227 |
children | 325d9804df10 |
comparison
equal
deleted
inserted
replaced
257:a93e273ca1d6 | 258:1eeece1c7b7b |
---|---|
471 { | 471 { |
472 char buf[BUF_LONG]; | 472 char buf[BUF_LONG]; |
473 #ifndef USE_OSCAR | 473 #ifndef USE_OSCAR |
474 g_snprintf(buf, sizeof(buf)/2, "toc_chat_invite %d \"%s\" %s", id, message, normalize(name)); | 474 g_snprintf(buf, sizeof(buf)/2, "toc_chat_invite %d \"%s\" %s", id, message, normalize(name)); |
475 sflap_send(buf, -1, TYPE_DATA); | 475 sflap_send(buf, -1, TYPE_DATA); |
476 #endif | |
477 } | |
478 | |
479 void serv_chat_leave(int id) | |
480 { | |
481 #ifndef USE_OSCAR | |
482 char *buf = g_malloc(256); | |
483 g_snprintf(buf, 255, "toc_chat_leave %d", id); | |
484 sflap_send(buf, -1, TYPE_DATA); | |
485 g_free(buf); | |
486 #else | 476 #else |
487 GList *bcs = buddy_chats; | 477 GList *bcs = buddy_chats; |
488 struct buddy_chat *b = NULL; | 478 struct buddy_chat *b = NULL; |
489 | 479 |
490 while (bcs) { | 480 while (bcs) { |
495 b = NULL; | 485 b = NULL; |
496 } | 486 } |
497 | 487 |
498 if (!b) | 488 if (!b) |
499 return; | 489 return; |
490 | |
491 aim_chat_invite(gaim_sess, gaim_conn, name, message, 0x4, b->name, 0x1); | |
492 #endif | |
493 } | |
494 | |
495 void serv_chat_leave(int id) | |
496 { | |
497 #ifndef USE_OSCAR | |
498 char *buf = g_malloc(256); | |
499 g_snprintf(buf, 255, "toc_chat_leave %d", id); | |
500 sflap_send(buf, -1, TYPE_DATA); | |
501 g_free(buf); | |
502 #else | |
503 GList *bcs = buddy_chats; | |
504 struct buddy_chat *b = NULL; | |
505 | |
506 while (bcs) { | |
507 b = (struct buddy_chat *)bcs->data; | |
508 if (id == b->id) | |
509 break; | |
510 bcs = bcs->next; | |
511 b = NULL; | |
512 } | |
513 | |
514 if (!b) | |
515 return; | |
500 | 516 |
501 aim_chat_leaveroom(gaim_sess, b->name); | 517 aim_chat_leaveroom(gaim_sess, b->name); |
502 #endif | 518 #endif |
503 } | 519 } |
504 | 520 |
507 char buf2[MSG_LEN]; | 523 char buf2[MSG_LEN]; |
508 #ifndef USE_OSCAR | 524 #ifndef USE_OSCAR |
509 g_snprintf(buf2, sizeof(buf2), "toc_chat_whisper %d %s \"%s\"", id, who, message); | 525 g_snprintf(buf2, sizeof(buf2), "toc_chat_whisper %d %s \"%s\"", id, who, message); |
510 sflap_send(buf2, -1, TYPE_DATA); | 526 sflap_send(buf2, -1, TYPE_DATA); |
511 #else | 527 #else |
512 /* FIXME : libfaim doesn't whisper */ | 528 do_error_dialog("Sorry, Oscar doesn't whisper. Send an IM.", |
513 serv_chat_send(id, message); | 529 "Gaim - Chat"); |
514 #endif | 530 #endif |
515 } | 531 } |
516 | 532 |
517 void serv_chat_send(int id, char *message) | 533 void serv_chat_send(int id, char *message) |
518 { | 534 { |