Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/ns.c

    r0864a52 r2fe8297  
    181181                imcb_error(ic, "Error while reading from server");
    182182                imc_logout(ic, TRUE);
    183                 g_free(bytes);
    184183                return FALSE;
    185184        }
     
    189188        g_free(bytes);
    190189
    191         return msn_handler(md);
     190        /* Ignore ret == 0, it's already disconnected then. */
     191        msn_handler(md);
     192
     193        return TRUE;
     194       
    192195}
    193196
     
    394397
    395398                                        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);
    399402                                        }
    400403
     
    408411
    409412                                        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);
    411415                                        }
    412416
     
    416420                        } else if (g_strncasecmp(ct, "text/x-msmsgsactivemailnotification", 35) == 0) {
    417421                                /* Notification that a message has been read... Ignore it */
     422                        } else {
     423                                debug("Can't handle %s packet from notification server", ct);
    418424                        }
    419425
     
    620626        char l[4];
    621627
    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)) {
    623629                return FALSE;
    624630        }
     
    638644        }
    639645
    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);
    641647        c = xt_new_node("c", NULL, NULL);
    642648        xt_add_attr(c, "n", handle);
     
    691697                struct msn_buddy_data *bd = bu->data;
    692698
    693                 if (bu->ic != ic || (bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)) == 0) {
     699                if (bu->ic != ic || (bd->flags & 7) == 0) {
    694700                        continue;
    695701                }
     
    721727}
    722728
    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
     730int msn_ns_sendmessage(struct im_connection *ic, bee_user_t *bu, const char *text)
    724731{
    725732        struct msn_data *md = ic->proto_data;
     
    727734        char *buf;
    728735
    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);
    730743        retval = msn_ns_write(ic, -1, "SDG %d %zd\r\n%s", ++md->trId, strlen(buf), buf);
    731744        g_free(buf);
    732745        return retval;
    733746}
    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.