Changeset 899c8e8


Ignore:
Timestamp:
2015-05-31T02:40:05Z (5 years ago)
Author:
dequis <dx@…>
Children:
3fb7139
Parents:
ef9ee0e
git-author:
dequis <dx@…> (19-04-15 07:36:06)
git-committer:
dequis <dx@…> (31-05-15 02:40:05)
Message:

msn: misc MSNP24 command format changes

Location:
protocols/msn
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.c

    ref9ee0e r899c8e8  
    191191                "/user", "application/user+xml",
    192192                strlen(body), body);
    193         msn_ns_write(ic, "PUT %d %zd\r\n%s", ++md->trId, strlen(buf), buf);
     193        msn_ns_write_cmd(ic, "PUT", "MSGR\\PRESENCE", buf);
    194194
    195195        g_free(buf);
  • protocols/msn/msn.h

    ref9ee0e r899c8e8  
    199199/* ns.c */
    200200int msn_ns_write(struct im_connection *ic, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
     201int msn_ns_write_cmd(struct im_connection *ic, const char *cmd, const char *params, const char *payload);
    201202gboolean msn_ns_connect(struct im_connection *ic, const char *host, int port);
    202203void msn_ns_close(struct msn_data *handler);
  • protocols/msn/ns.c

    ref9ee0e r899c8e8  
    294294                g_free(resp);
    295295
    296         } else if (strcmp(cmd[0], "ADL") == 0) {
    297                 if (num_parts >= 3 && strcmp(cmd[2], "OK") == 0) {
     296        } else if (strcmp(cmd[0], "PUT") == 0) {
     297                /* We could keep track TrIDs... or we could guess what this PUT means */
     298                if ((md->flags & MSN_DONE_BND) && !(md->flags & MSN_DONE_ADL)) {
    298299                        msn_ns_send_adl(ic);
    299300                        return msn_ns_finish_login(ic);
     
    473474
    474475        } else if ((strcmp(cmd[0], "NFY") == 0) && (action = get_rfc822_header(parts[2], "Uri", 0))) {
    475                 gboolean is_put = (strcmp(cmd[1], "PUT") == 0);
     476                gboolean is_put = (strcmp(cmd[2], "MSGR\\PUT") == 0);
    476477                msn_ns_nfy(md, who, parts, action, is_put);
    477478        }
     
    657658        adls = xt_to_string(adl);
    658659        xt_free_node(adl);
    659         msn_ns_write(ic, "ADL %d %zd\r\n%s", ++md->trId, strlen(adls), adls);
     660        msn_ns_write_cmd(ic, "PUT", "MSGR\\CONTACTS", adls);
    660661        g_free(adls);
    661662}
     
    714715
    715716        buf = g_strdup_printf(MSN_MESSAGE_HEADERS, bu->handle, ic->acc->user, md->uuid, message_type, strlen(text), text);
    716         retval = msn_ns_write(ic, "SDG %d %zd\r\n%s", ++md->trId, strlen(buf), buf);
     717        retval = msn_ns_write_cmd(ic, "SDG", "MSGR", buf);
    717718        g_free(buf);
    718719        return retval;
Note: See TracChangeset for help on using the changeset viewer.