Changeset 99fe030 for protocols/msn/ns.c
- Timestamp:
- 2015-05-13T08:05:01Z (9 years ago)
- Branches:
- master
- Children:
- a6bed1a
- Parents:
- a733669
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/ns.c
ra733669 r99fe030 724 724 } 725 725 726 // TODO: typing notifications, nudges lol, etc 727 int msn_ns_sendmessage(struct im_connection *ic, bee_user_t *bu, const char *text) 726 static int msn_ns_send_sdg(struct im_connection *ic, bee_user_t *bu, const char *message_type, const char *text) 728 727 { 729 728 struct msn_data *md = ic->proto_data; … … 731 730 char *buf; 732 731 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); 732 buf = g_strdup_printf(MSN_MESSAGE_HEADERS, bu->handle, ic->acc->user, md->uuid, message_type, strlen(text), text); 740 733 retval = msn_ns_write(ic, -1, "SDG %d %zd\r\n%s", ++md->trId, strlen(buf), buf); 741 734 g_free(buf); 742 735 return retval; 743 736 } 737 738 int msn_ns_send_typing(struct im_connection *ic, bee_user_t *bu) 739 { 740 return msn_ns_send_sdg(ic, bu, "Control/Typing", ""); 741 } 742 743 int msn_ns_send_message(struct im_connection *ic, bee_user_t *bu, const char *text) 744 { 745 return msn_ns_send_sdg(ic, bu, "Text", text); 746 } 747
Note: See TracChangeset
for help on using the changeset viewer.