- Timestamp:
- 2010-04-07T18:27:04Z (15 years ago)
- Branches:
- master
- Children:
- 3291700
- Parents:
- ac423d0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
skype/skype.c
rac423d0 r7825f58 509 509 *info = '\0'; 510 510 info++; 511 if (!strcmp(info, "STATUS RECEIVED") || 512 !strncmp(info, "EDITED_TIMESTAMP", 16)) { 511 if (!strcmp(info, "STATUS RECEIVED") || !strncmp(info, "EDITED_TIMESTAMP", 16)) { 513 512 /* New message ID: 514 513 * (1) Request its from field … … 548 547 g_free(sd->type); 549 548 sd->type = g_strdup(info); 550 } else if (strncmp(info, "CHATNAME ", 9)) 551 return; 552 if (!sd->handle || !sd->body || !sd->type) 553 return; 554 info += 9; 555 struct groupchat *gc = skype_chat_by_name(ic, info); 556 int i; 557 for (i = 0; i < g_list_length(sd->body); i++) { 558 char *body = g_list_nth_data(sd->body, i); 559 if (!strcmp(sd->type, "SETTOPIC") && gc) 560 imcb_chat_topic(gc, 561 sd->handle, body, 0); 562 else if (!strcmp(sd->type, "LEFT") && gc) 563 imcb_chat_remove_buddy(gc, 564 sd->handle, NULL); 565 if (strcmp(sd->type, "SAID") && 566 strcmp(sd->type, "EMOTED")) 567 continue; 568 if (!strcmp(sd->type, "SAID")) { 569 if (!sd->is_edit) 570 g_snprintf(buf, IRC_LINE_SIZE, "%s", 571 body); 572 else { 573 account_t *acc = ic->acc; 574 g_snprintf(buf, IRC_LINE_SIZE, "%s %s", 575 set_getstr(&acc->set, "edit_prefix"), 576 body); 577 sd->is_edit = 0; 549 } else if (!strncmp(info, "CHATNAME ", 9)) { 550 info += 9; 551 if (sd->handle && sd->body && sd->type) { 552 struct groupchat *gc = skype_chat_by_name(ic, info); 553 int i; 554 for (i = 0; i < g_list_length(sd->body); i++) { 555 char *body = g_list_nth_data(sd->body, i); 556 if (!strcmp(sd->type, "SAID") || 557 !strcmp(sd->type, "EMOTED")) { 558 if (!strcmp(sd->type, "SAID")) { 559 if (!sd->is_edit) 560 g_snprintf(buf, IRC_LINE_SIZE, "%s", 561 body); 562 else { 563 g_snprintf(buf, IRC_LINE_SIZE, "%s %s", 564 set_getstr(&ic->acc->set, "edit_prefix"), 565 body); 566 sd->is_edit = 0; 567 } 568 } else 569 g_snprintf(buf, IRC_LINE_SIZE, "/me %s", 570 body); 571 if (!gc) 572 /* Private message */ 573 imcb_buddy_msg(ic, 574 sd->handle, buf, 0, 0); 575 else 576 /* Groupchat message */ 577 imcb_chat_msg(gc, 578 sd->handle, buf, 0, 0); 579 } else if (!strcmp(sd->type, "SETTOPIC") && gc) 580 imcb_chat_topic(gc, 581 sd->handle, body, 0); 582 else if (!strcmp(sd->type, "LEFT") && gc) 583 imcb_chat_remove_buddy(gc, 584 sd->handle, NULL); 578 585 } 579 } else 580 g_snprintf(buf, IRC_LINE_SIZE, "/me %s", 581 body); 582 if (!gc) 583 /* Private message */ 584 imcb_buddy_msg(ic, 585 sd->handle, buf, 0, 0); 586 else 587 /* Groupchat message */ 588 imcb_chat_msg(gc, 589 sd->handle, buf, 0, 0); 586 g_list_free(sd->body); 587 sd->body = NULL; 588 } 590 589 } 591 g_list_free(sd->body);592 sd->body = NULL;593 590 } 594 591
Note: See TracChangeset
for help on using the changeset viewer.