Changeset 85dabae for protocols


Ignore:
Timestamp:
2015-05-31T02:40:04Z (9 years ago)
Author:
dequis <dx@…>
Children:
4107fea
Parents:
6a89740
git-author:
dequis <dx@…> (18-04-15 21:07:02)
git-committer:
dequis <dx@…> (31-05-15 02:40:04)
Message:

msn: add msn_ns_write_cmd to write MSNP24-formatted commands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/ns.c

    r6a89740 r85dabae  
    7676
    7777        return 1;
     78}
     79
     80int msn_ns_write_cmd(struct im_connection *ic, const char *cmd, const char *params, const char *payload)
     81{
     82        struct msn_data *md = ic->proto_data;
     83        int trid = ++md->trId;
     84        const char *headers = "\r\n"; /* not needed yet */
     85        size_t len = strlen(headers) + strlen(payload);
     86
     87        if (params && *params) {
     88                return msn_ns_write(ic, "%s %d %s %zd\r\n%s%s", cmd, trid, params, len, headers, payload);
     89        } else {
     90                return msn_ns_write(ic, "%s %d %zd\r\n%s%s", cmd, trid, len, headers, payload);
     91        }
    7892}
    7993
Note: See TracChangeset for help on using the changeset viewer.