Changes in protocols/msn/ns.c [0864a52:2fe8297]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/ns.c
r0864a52 r2fe8297 181 181 imcb_error(ic, "Error while reading from server"); 182 182 imc_logout(ic, TRUE); 183 g_free(bytes);184 183 return FALSE; 185 184 } … … 189 188 g_free(bytes); 190 189 191 return msn_handler(md); 190 /* Ignore ret == 0, it's already disconnected then. */ 191 msn_handler(md); 192 193 return TRUE; 194 192 195 } 193 196 … … 394 397 395 398 if (inbox && folders) { 396 imcb_ notify_email(ic,397 "INBOX contains %s new messages, plus %s messages in other folders.", inbox,398 folders);399 imcb_log(ic, 400 "INBOX contains %s new messages, plus %s messages in other folders.", inbox, 401 folders); 399 402 } 400 403 … … 408 411 409 412 if (from && fromname) { 410 imcb_notify_email(ic, "Received an e-mail message from %s <%s>.", fromname, from); 413 imcb_log(ic, "Received an e-mail message from %s <%s>.", fromname, 414 from); 411 415 } 412 416 … … 416 420 } else if (g_strncasecmp(ct, "text/x-msmsgsactivemailnotification", 35) == 0) { 417 421 /* Notification that a message has been read... Ignore it */ 422 } else { 423 debug("Can't handle %s packet from notification server", ct); 418 424 } 419 425 … … 620 626 char l[4]; 621 627 622 if ((bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)) == 0 || (bd->flags & MSN_BUDDY_ADL_SYNCED)) {628 if ((bd->flags & 7) == 0 || (bd->flags & MSN_BUDDY_ADL_SYNCED)) { 623 629 return FALSE; 624 630 } … … 638 644 } 639 645 640 g_snprintf(l, sizeof(l), "%d", bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL));646 g_snprintf(l, sizeof(l), "%d", bd->flags & 7); 641 647 c = xt_new_node("c", NULL, NULL); 642 648 xt_add_attr(c, "n", handle); … … 691 697 struct msn_buddy_data *bd = bu->data; 692 698 693 if (bu->ic != ic || (bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)) == 0) {699 if (bu->ic != ic || (bd->flags & 7) == 0) { 694 700 continue; 695 701 } … … 721 727 } 722 728 723 static int msn_ns_send_sdg(struct im_connection *ic, bee_user_t *bu, const char *message_type, const char *text) 729 // TODO: typing notifications, nudges lol, etc 730 int msn_ns_sendmessage(struct im_connection *ic, bee_user_t *bu, const char *text) 724 731 { 725 732 struct msn_data *md = ic->proto_data; … … 727 734 char *buf; 728 735 729 buf = g_strdup_printf(MSN_MESSAGE_HEADERS, bu->handle, ic->acc->user, md->uuid, message_type, strlen(text), text); 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); 730 743 retval = msn_ns_write(ic, -1, "SDG %d %zd\r\n%s", ++md->trId, strlen(buf), buf); 731 744 g_free(buf); 732 745 return retval; 733 746 } 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.