Mercurial > pidgin
comparison src/server.c @ 248:cfc73b8501a7
[gaim-migrate @ 258]
Oscar chat is there now. Adam will be happy, that's the only thing he asked
me specifically about.
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Sun, 21 May 2000 11:58:18 +0000 |
| parents | f6e8ea29b24f |
| children | 810c595258c8 |
comparison
equal
deleted
inserted
replaced
| 247:f6e8ea29b24f | 248:cfc73b8501a7 |
|---|---|
| 440 { | 440 { |
| 441 char buf[BUF_LONG]; | 441 char buf[BUF_LONG]; |
| 442 #ifndef USE_OSCAR | 442 #ifndef USE_OSCAR |
| 443 g_snprintf(buf, sizeof(buf)/2, "toc_chat_join %d \"%s\"", exchange, name); | 443 g_snprintf(buf, sizeof(buf)/2, "toc_chat_join %d \"%s\"", exchange, name); |
| 444 sflap_send(buf, -1, TYPE_DATA); | 444 sflap_send(buf, -1, TYPE_DATA); |
| 445 #else | |
| 446 aim_chat_join(gaim_sess, gaim_conn, 0x0004, name); | |
| 445 #endif | 447 #endif |
| 446 } | 448 } |
| 447 | 449 |
| 448 void serv_chat_invite(int id, char *message, char *name) | 450 void serv_chat_invite(int id, char *message, char *name) |
| 449 { | 451 { |
| 459 #ifndef USE_OSCAR | 461 #ifndef USE_OSCAR |
| 460 char *buf = g_malloc(256); | 462 char *buf = g_malloc(256); |
| 461 g_snprintf(buf, 255, "toc_chat_leave %d", id); | 463 g_snprintf(buf, 255, "toc_chat_leave %d", id); |
| 462 sflap_send(buf, -1, TYPE_DATA); | 464 sflap_send(buf, -1, TYPE_DATA); |
| 463 g_free(buf); | 465 g_free(buf); |
| 466 #else | |
| 467 GList *bcs = buddy_chats; | |
| 468 struct buddy_chat *b = NULL; | |
| 469 | |
| 470 while (bcs) { | |
| 471 b = (struct buddy_chat *)bcs->data; | |
| 472 if (id == b->id) | |
| 473 break; | |
| 474 bcs = bcs->next; | |
| 475 b = NULL; | |
| 476 } | |
| 477 | |
| 478 if (!b) | |
| 479 return; | |
| 480 | |
| 481 aim_chat_leaveroom(gaim_sess, b->name); | |
| 464 #endif | 482 #endif |
| 465 } | 483 } |
| 466 | 484 |
| 467 void serv_chat_whisper(int id, char *who, char *message) | 485 void serv_chat_whisper(int id, char *who, char *message) |
| 468 { | 486 { |
| 469 char buf2[MSG_LEN]; | 487 char buf2[MSG_LEN]; |
| 470 #ifndef USE_OSCAR | 488 #ifndef USE_OSCAR |
| 471 g_snprintf(buf2, sizeof(buf2), "toc_chat_whisper %d %s \"%s\"", id, who, message); | 489 g_snprintf(buf2, sizeof(buf2), "toc_chat_whisper %d %s \"%s\"", id, who, message); |
| 472 sflap_send(buf2, -1, TYPE_DATA); | 490 sflap_send(buf2, -1, TYPE_DATA); |
| 491 #else | |
| 492 /* FIXME : libfaim doesn't whisper */ | |
| 493 serv_chat_send(id, message); | |
| 473 #endif | 494 #endif |
| 474 } | 495 } |
| 475 | 496 |
| 476 void serv_chat_send(int id, char *message) | 497 void serv_chat_send(int id, char *message) |
| 477 { | 498 { |
| 478 char buf[MSG_LEN]; | 499 char buf[MSG_LEN]; |
| 479 #ifndef USE_OSCAR | 500 #ifndef USE_OSCAR |
| 480 g_snprintf(buf, sizeof(buf), "toc_chat_send %d \"%s\"",id, message); | 501 g_snprintf(buf, sizeof(buf), "toc_chat_send %d \"%s\"",id, message); |
| 481 sflap_send(buf, -1, TYPE_DATA); | 502 sflap_send(buf, -1, TYPE_DATA); |
| 503 #else | |
| 504 struct aim_conn_t *cn; | |
| 505 GList *bcs = buddy_chats; | |
| 506 struct buddy_chat *b = NULL; | |
| 507 | |
| 508 while (bcs) { | |
| 509 b = (struct buddy_chat *)bcs->data; | |
| 510 if (id == b->id) | |
| 511 break; | |
| 512 bcs = bcs->next; | |
| 513 b = NULL; | |
| 514 } | |
| 515 if (!b) | |
| 516 return; | |
| 517 | |
| 518 cn = aim_chat_getconn(gaim_sess, b->name); | |
| 519 aim_chat_send_im(gaim_sess, cn, message); | |
| 482 #endif | 520 #endif |
| 483 } | 521 } |
| 484 | 522 |
| 485 | 523 |
| 486 | 524 |
