Changeset a1d30c5 for protocols/msn/ns.c
- Timestamp:
- 2015-05-28T04:12:23Z (9 years ago)
- Children:
- d2d2b80
- Parents:
- ec8b369 (diff), 3d31618 (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
rec8b369 ra1d30c5 417 417 } else if (g_strncasecmp(ct, "text/x-msmsgsactivemailnotification", 35) == 0) { 418 418 /* Notification that a message has been read... Ignore it */ 419 } else {420 debug("Can't handle %s packet from notification server", ct);421 419 } 422 420 … … 623 621 char l[4]; 624 622 625 if ((bd->flags & 7) == 0 || (bd->flags & MSN_BUDDY_ADL_SYNCED)) {623 if ((bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)) == 0 || (bd->flags & MSN_BUDDY_ADL_SYNCED)) { 626 624 return FALSE; 627 625 } … … 641 639 } 642 640 643 g_snprintf(l, sizeof(l), "%d", bd->flags & 7);641 g_snprintf(l, sizeof(l), "%d", bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)); 644 642 c = xt_new_node("c", NULL, NULL); 645 643 xt_add_attr(c, "n", handle); … … 694 692 struct msn_buddy_data *bd = bu->data; 695 693 696 if (bu->ic != ic || (bd->flags & 7) == 0) {694 if (bu->ic != ic || (bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)) == 0) { 697 695 continue; 698 696 } … … 724 722 } 725 723 726 // TODO: typing notifications, nudges lol, etc 727 int msn_ns_sendmessage(struct im_connection *ic, bee_user_t *bu, const char *text) 724 static int msn_ns_send_sdg(struct im_connection *ic, bee_user_t *bu, const char *message_type, const char *text) 728 725 { 729 726 struct msn_data *md = ic->proto_data; … … 731 728 char *buf; 732 729 733 if (strncmp(text, "\r\r\r", 3) == 0) { 734 /* Err. Shouldn't happen but I guess it can. Don't send others 735 any of the "SHAKE THAT THING" messages. :-D */ 736 return 1; 737 } 738 739 buf = g_strdup_printf(MSN_MESSAGE_HEADERS, bu->handle, ic->acc->user, md->uuid, strlen(text), text); 730 buf = g_strdup_printf(MSN_MESSAGE_HEADERS, bu->handle, ic->acc->user, md->uuid, message_type, strlen(text), text); 740 731 retval = msn_ns_write(ic, -1, "SDG %d %zd\r\n%s", ++md->trId, strlen(buf), buf); 741 732 g_free(buf); 742 733 return retval; 743 734 } 735 736 int msn_ns_send_typing(struct im_connection *ic, bee_user_t *bu) 737 { 738 return msn_ns_send_sdg(ic, bu, "Control/Typing", ""); 739 } 740 741 int msn_ns_send_message(struct im_connection *ic, bee_user_t *bu, const char *text) 742 { 743 return msn_ns_send_sdg(ic, bu, "Text", text); 744 } 745
Note: See TracChangeset
for help on using the changeset viewer.