Changeset b75671d for protocols/msn/ns.c
- Timestamp:
- 2015-06-17T22:47:26Z (9 years ago)
- Children:
- b441614
- Parents:
- d832164 (diff), 2f99f23 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/ns.c
rd832164 rb75671d 181 181 imcb_error(ic, "Error while reading from server"); 182 182 imc_logout(ic, TRUE); 183 g_free(bytes); 183 184 return FALSE; 184 185 } … … 188 189 g_free(bytes); 189 190 190 /* Ignore ret == 0, it's already disconnected then. */ 191 msn_handler(md); 192 193 return TRUE; 194 191 return msn_handler(md); 195 192 } 196 193 … … 397 394 398 395 if (inbox && folders) { 399 imcb_ log(ic,400 401 396 imcb_notify_email(ic, 397 "INBOX contains %s new messages, plus %s messages in other folders.", inbox, 398 folders); 402 399 } 403 400 … … 411 408 412 409 if (from && fromname) { 413 imcb_log(ic, "Received an e-mail message from %s <%s>.", fromname, 414 from); 410 imcb_notify_email(ic, "Received an e-mail message from %s <%s>.", fromname, from); 415 411 } 416 412 … … 420 416 } else if (g_strncasecmp(ct, "text/x-msmsgsactivemailnotification", 35) == 0) { 421 417 /* Notification that a message has been read... Ignore it */ 422 } else {423 debug("Can't handle %s packet from notification server", ct);424 418 } 425 419 … … 626 620 char l[4]; 627 621 628 if ((bd->flags & 7) == 0 || (bd->flags & MSN_BUDDY_ADL_SYNCED)) {622 if ((bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)) == 0 || (bd->flags & MSN_BUDDY_ADL_SYNCED)) { 629 623 return FALSE; 630 624 } … … 644 638 } 645 639 646 g_snprintf(l, sizeof(l), "%d", bd->flags & 7);640 g_snprintf(l, sizeof(l), "%d", bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)); 647 641 c = xt_new_node("c", NULL, NULL); 648 642 xt_add_attr(c, "n", handle); … … 697 691 struct msn_buddy_data *bd = bu->data; 698 692 699 if (bu->ic != ic || (bd->flags & 7) == 0) {693 if (bu->ic != ic || (bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)) == 0) { 700 694 continue; 701 695 } … … 727 721 } 728 722 729 // TODO: typing notifications, nudges lol, etc 730 int msn_ns_sendmessage(struct im_connection *ic, bee_user_t *bu, const char *text) 723 static int msn_ns_send_sdg(struct im_connection *ic, bee_user_t *bu, const char *message_type, const char *text) 731 724 { 732 725 struct msn_data *md = ic->proto_data; … … 734 727 char *buf; 735 728 736 if (strncmp(text, "\r\r\r", 3) == 0) { 737 /* Err. Shouldn't happen but I guess it can. Don't send others 738 any of the "SHAKE THAT THING" messages. :-D */ 739 return 1; 740 } 741 742 buf = g_strdup_printf(MSN_MESSAGE_HEADERS, bu->handle, ic->acc->user, md->uuid, strlen(text), text); 729 buf = g_strdup_printf(MSN_MESSAGE_HEADERS, bu->handle, ic->acc->user, md->uuid, message_type, strlen(text), text); 743 730 retval = msn_ns_write(ic, -1, "SDG %d %zd\r\n%s", ++md->trId, strlen(buf), buf); 744 731 g_free(buf); 745 732 return retval; 746 733 } 734 735 int msn_ns_send_typing(struct im_connection *ic, bee_user_t *bu) 736 { 737 return msn_ns_send_sdg(ic, bu, "Control/Typing", ""); 738 } 739 740 int msn_ns_send_message(struct im_connection *ic, bee_user_t *bu, const char *text) 741 { 742 return msn_ns_send_sdg(ic, bu, "Text", text); 743 } 744
Note: See TracChangeset
for help on using the changeset viewer.