--- a/libpurple/protocols/msn/Makefile.am Thu Mar 12 23:59:20 2015 -0400
+++ b/libpurple/protocols/msn/Makefile.am Fri Mar 13 00:09:51 2015 -0400
@@ -32,8 +32,6 @@
--- a/libpurple/protocols/msn/notification.c Thu Mar 12 23:59:20 2015 -0400
+++ b/libpurple/protocols/msn/notification.c Fri Mar 13 00:09:51 2015 -0400
@@ -2141,7 +2141,7 @@
- const char *mdata, *unread;
session = cmdproc->session;
gc = session->account->gc;
@@ -2152,11 +2152,6 @@
table = msn_message_get_hashtable_from_body(msg);
- mdata = g_hash_table_lookup(table, "Mail-Data");
- msn_parse_oim_msg(session->oim, mdata);
if (g_hash_table_lookup(table, "Inbox-URL") == NULL)
g_hash_table_destroy(table);
@@ -2200,13 +2195,6 @@
g_hash_table_destroy(table);
-/*offline Message Notification*/
-delete_oim_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
- purple_debug_misc("msn", "Delete OIM message.\n");
email_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
@@ -2491,20 +2479,12 @@
msn_table_add_msg_type(cbs_table,
"text/x-msmsgsinitialmdatanotification",
- /*OIM notification when user online*/
- msn_table_add_msg_type(cbs_table,
- "text/x-msmsgsoimnotification",
msn_table_add_msg_type(cbs_table,
"text/x-msmsgsinitialemailnotification",
msn_table_add_msg_type(cbs_table,
"text/x-msmsgsemailnotification",
- /*delete an offline Message notification*/
- msn_table_add_msg_type(cbs_table,
- "text/x-msmsgsactivemailnotification",
msn_table_add_msg_type(cbs_table,
"application/x-msmsgssystemmessage",
--- a/libpurple/protocols/msn/oim.c Thu Mar 12 23:59:20 2015 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,886 +0,0 @@
- * get and send MSN offline Instant Message via SOAP request
- * MaYuan<mayuan2006@gmail.com>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-typedef struct _MsnOimSendReq {
-/*Local Function Prototype*/
-static void msn_parse_oim_xml(MsnOim *oim, xmlnode *node);
-static void msn_oim_free_send_req(MsnOimSendReq *req);
-static void msn_oim_recv_data_free(MsnOimRecvData *data);
-static void msn_oim_post_single_get_msg(MsnOim *oim, MsnOimRecvData *data);
-msn_oim_new(MsnSession *session)
- oim = g_new0(MsnOim, 1);
- oim->session = session;
- oim->run_id = rand_guid();
- oim->send_queue = g_queue_new();
-/*destroy the oim object*/
-msn_oim_destroy(MsnOim *oim)
- MsnOimSendReq *request;
- purple_debug_info("msn", "destroy the OIM %p\n", oim);
- g_free(oim->challenge);
- while ((request = g_queue_pop_head(oim->send_queue)) != NULL)
- msn_oim_free_send_req(request);
- g_queue_free(oim->send_queue);
- while (oim->oim_list != NULL)
- msn_oim_recv_data_free((MsnOimRecvData *)oim->oim_list->data);
-msn_oim_new_send_req(const char *from_member, const char*friendname,
- const char* to_member, const char *msg)
- MsnOimSendReq *request;
- request = g_new0(MsnOimSendReq, 1);
- request->from_member = g_strdup(from_member);
- request->friendname = g_strdup(friendname);
- request->to_member = g_strdup(to_member);
- request->oim_msg = g_strdup(msg);
-msn_oim_free_send_req(MsnOimSendReq *req)
- g_return_if_fail(req != NULL);
- g_free(req->from_member);
- g_free(req->friendname);
- g_free(req->to_member);
-msn_oim_recv_data_new(MsnOim *oim, char *msg_id)
- data = g_new0(MsnOimRecvData, 1);
- oim->oim_list = g_list_append(oim->oim_list, data);
-/* Probably only good for g_list_find_custom */
-msn_recv_data_equal(MsnOimRecvData *a, const char *msg_id)
- return strcmp(a->msg_id, msg_id);
-msn_oim_recv_data_free(MsnOimRecvData *data)
- data->oim->oim_list = g_list_remove(data->oim->oim_list, data);
-/****************************************
- ****************************************/
-typedef struct _MsnOimRequestData {
-static gboolean msn_oim_request_helper(MsnOimRequestData *data);
-msn_oim_request_cb(MsnSoapMessage *request, MsnSoapMessage *response,
- MsnOimRequestData *data = (MsnOimRequestData *)req_data;
- xmlnode *faultcode = NULL;
- fault = xmlnode_get_child(response->xml, "Body/Fault");
- if (fault && (faultcode = xmlnode_get_child(fault, "faultcode"))) {
- gchar *faultcode_str = xmlnode_get_data(faultcode);
- gboolean need_token_update = FALSE;
- if (g_str_equal(faultcode_str, "q0:BadContextToken") ||
- g_str_equal(faultcode_str, "AuthenticationFailed") ||
- g_str_equal(faultcode_str, "s:AuthenticationFailed"))
- need_token_update = TRUE;
- else if (g_str_equal(faultcode_str, "q0:AuthenticationFailed") &&
- xmlnode_get_child(fault, "detail/RequiredAuthPolicy") != NULL)
- need_token_update = TRUE;
- if (need_token_update) {
- purple_debug_warning("msn", "OIM Request Error, Updating token now.\n");
- msn_nexus_update_token(data->oim->session->nexus,
- data->send ? MSN_AUTH_LIVE_SECURE : MSN_AUTH_MESSENGER_WEB,
- (GSourceFunc)msn_oim_request_helper, data);
- data->cb(request, response, data->cb_data);
- xmlnode_free(data->body);
-msn_oim_request_helper(MsnOimRequestData *data)
- MsnSession *session = data->oim->session;
- /* The Sending of OIM's uses a different token for some reason. */
- ticket = xmlnode_get_child(data->body, "Header/Ticket");
- xmlnode_set_attrib(ticket, "passport",
- msn_nexus_get_token_str(session->nexus, MSN_AUTH_LIVE_SECURE));
- token = msn_nexus_get_token(session->nexus, MSN_AUTH_MESSENGER_WEB);
- g_return_val_if_fail(token != NULL, FALSE);
- msn_t = g_hash_table_lookup(token, "t");
- msn_p = g_hash_table_lookup(token, "p");
- g_return_val_if_fail(msn_t != NULL, FALSE);
- g_return_val_if_fail(msn_p != NULL, FALSE);
- passport = xmlnode_get_child(data->body, "Header/PassportCookie");
- xml_t = xmlnode_get_child(passport, "t");
- xml_p = xmlnode_get_child(passport, "p");
- /* frees old token text, or the 'EMPTY' text if first time */
- xmlnode_free(xml_t->child);
- xmlnode_free(xml_p->child);
- xmlnode_insert_data(xml_t, msn_t, -1);
- xmlnode_insert_data(xml_p, msn_p, -1);
- msn_soap_message_send(session,
- msn_soap_message_new(data->action, xmlnode_copy(data->body)),
- data->host, data->url, FALSE,
- msn_oim_request_cb, data);
-msn_oim_make_request(MsnOim *oim, gboolean send, const char *action,
- const char *host, const char *url, xmlnode *body, MsnSoapCallback cb,
- MsnOimRequestData *data = g_new0(MsnOimRequestData, 1);
- data->cb_data = cb_data;
- msn_oim_request_helper(data);
-/****************************************
- * OIM GetMetadata request
- * **************************************/
-msn_oim_get_metadata_cb(MsnSoapMessage *request, MsnSoapMessage *response,
- xmlnode_get_child(response->xml, "Body/GetMetadataResponse/MD"));
-/* Post to get the OIM Metadata */
-msn_oim_get_metadata(MsnOim *oim)
- msn_oim_make_request(oim, FALSE, MSN_OIM_GET_METADATA_ACTION,
- MSN_OIM_RETRIEVE_HOST, MSN_OIM_RETRIEVE_URL,
- xmlnode_from_str(MSN_OIM_GET_METADATA_TEMPLATE, -1),
- msn_oim_get_metadata_cb, oim);
-/****************************************
- * OIM send SOAP request
- * **************************************/
-/*encode the message to OIM Message Format*/
-msn_oim_msg_to_str(MsnOim *oim, const char *body)
- purple_debug_info("msn", "Encoding OIM Message...\n");
- c = oim_base64 = purple_base64_encode((const guchar *)body, len);
- base64_len = strlen(oim_base64);
- purple_debug_info("msn", "Encoded base64 body:{%s}\n", oim_base64);
- oim_body = g_string_new(NULL);
- g_string_printf(oim_body, MSN_OIM_MSG_TEMPLATE,
- oim->run_id, oim->send_seq);
- while (base64_len > OIM_LINE_LEN) {
- g_string_append_len(oim_body, c, OIM_LINE_LEN);
- g_string_append_c(oim_body, '\n');
- base64_len -= OIM_LINE_LEN;
- g_string_append(oim_body, c);
- return g_string_free(oim_body, FALSE);
- * Process the send return SOAP string
- * If got SOAP Fault,get the lock key,and resend it.
-msn_oim_send_read_cb(MsnSoapMessage *request, MsnSoapMessage *response,
- MsnOimSendReq *msg = g_queue_pop_head(oim->send_queue);
- g_return_if_fail(msg != NULL);
- if (response == NULL) {
- purple_debug_info("msn", "cannot send OIM: %s\n", msg->oim_msg);
- xmlnode *faultNode = xmlnode_get_child(response->xml, "Body/Fault");
- if (faultNode == NULL) {
- purple_debug_info("msn", "sent OIM: %s\n", msg->oim_msg);
- xmlnode *faultcode = xmlnode_get_child(faultNode, "faultcode");
- char *faultcode_str = xmlnode_get_data(faultcode);
- if (faultcode_str && g_str_equal(faultcode_str, "q0:AuthenticationFailed")) {
- xmlnode *challengeNode = xmlnode_get_child(faultNode,
- "detail/LockKeyChallenge");
- char *challenge = NULL;
- if (challengeNode == NULL || (challenge = xmlnode_get_data(challengeNode)) == NULL) {
- g_free(oim->challenge);
- purple_debug_info("msn", "Resending OIM: %s\n",
- g_queue_push_head(oim->send_queue, msg);
- purple_debug_info("msn",
- "Can't find lock key for OIM: %s\n",
- msn_handle_chl(challenge, buf);
- g_free(oim->challenge);
- oim->challenge = g_strndup(buf, sizeof(buf));
- purple_debug_info("msn", "Found lockkey:{%s}\n", oim->challenge);
- purple_debug_info("msn", "Resending OIM: %s\n", msg->oim_msg);
- g_queue_push_head(oim->send_queue, msg);
- const char *str_reason = NULL;
- if (g_str_equal(faultcode_str, "q0:SystemUnavailable")) {
- str_reason = _("Message was not sent because the system is "
- "unavailable. This normally happens when the "
- "user is blocked or does not exist.");
- } else if (g_str_equal(faultcode_str, "q0:SenderThrottleLimitExceeded")) {
- str_reason = _("Message was not sent because messages "
- "are being sent too quickly.");
- } else if (g_str_equal(faultcode_str, "q0:InvalidContent")) {
- str_reason = _("Message was not sent because an unknown "
- "encoding error occurred.");
- if (str_reason == NULL) {
- str_reason = _("Message was not sent because an unknown "
- msn_session_report_user(oim->session, msg->to_member,
- str_reason, PURPLE_MESSAGE_ERROR);
- msn_session_report_user(oim->session, msg->to_member,
- msg->oim_msg, PURPLE_MESSAGE_RAW);
- msn_oim_free_send_req(msg);
-msn_oim_prep_send_msg_info(MsnOim *oim, const char *membername,
- const char* friendname, const char *tomember,
- g_return_if_fail(oim != NULL);
- g_queue_push_tail(oim->send_queue,
- msn_oim_new_send_req(membername, friendname, tomember, msg));
-/*post send single message request to oim server*/
-msn_oim_send_msg(MsnOim *oim)
- MsnOimSendReq *oim_request;
- g_return_if_fail(oim != NULL);
- oim_request = g_queue_peek_head(oim->send_queue);
- g_return_if_fail(oim_request != NULL);
- purple_debug_info("msn", "Sending OIM: %s\n", oim_request->oim_msg);
- /* if we got the challenge lock key, we compute it
- * else we go for the SOAP fault and resend it.
- if (oim->challenge == NULL){
- purple_debug_info("msn", "No lock key challenge, waiting for SOAP Fault and Resend\n");
- msg_body = msn_oim_msg_to_str(oim, oim_request->oim_msg);
- soap_body = g_strdup_printf(MSN_OIM_SEND_TEMPLATE,
- oim_request->from_member,
- oim_request->friendname,
- oim_request->to_member,
- oim->challenge ? oim->challenge : "",
- msn_oim_make_request(oim, TRUE, MSN_OIM_SEND_SOAP_ACTION, MSN_OIM_SEND_HOST,
- MSN_OIM_SEND_URL, xmlnode_from_str(soap_body, -1), msn_oim_send_read_cb,
- /*increase the offline Sequence control*/
- if (oim->challenge != NULL) {
-/****************************************
- * OIM delete SOAP request
- * **************************************/
-msn_oim_delete_read_cb(MsnSoapMessage *request, MsnSoapMessage *response,
- MsnOimRecvData *rdata = data;
- if (response && xmlnode_get_child(response->xml, "Body/Fault") == NULL)
- purple_debug_info("msn", "Delete OIM success\n");
- purple_debug_info("msn", "Delete OIM failed\n");
- msn_oim_recv_data_free(rdata);
-/*Post to get the Offline Instant Message*/
-msn_oim_post_delete_msg(MsnOimRecvData *rdata)
- MsnOim *oim = rdata->oim;
- char *msgid = rdata->msg_id;
- purple_debug_info("msn", "Delete single OIM Message {%s}\n",msgid);
- soap_body = g_strdup_printf(MSN_OIM_DEL_TEMPLATE, msgid);
- msn_oim_make_request(oim, FALSE, MSN_OIM_DEL_SOAP_ACTION, MSN_OIM_RETRIEVE_HOST,
- MSN_OIM_RETRIEVE_URL, xmlnode_from_str(soap_body, -1), msn_oim_delete_read_cb, rdata);
-/****************************************
- * **************************************/
-/* like purple_str_to_time, but different. The format of the timestamp
- * is like this: 5 Sep 2007 21:42:12 -0700 */
-msn_oim_parse_timestamp(const char *timestamp)
- char month_str[4], tz_str[6];
- static const char *months[] = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", NULL
- memset(&t, 0, sizeof(t));
- localtime_r(&tval, &t);
- if (sscanf(timestamp, "%02d %03s %04d %02d:%02d:%02d %05s",
- &t.tm_mday, month_str, &t.tm_year,
- &t.tm_hour, &t.tm_min, &t.tm_sec, tz_str) == 7) {
- gboolean offset_positive = TRUE;
- months[t.tm_mon] != NULL &&
- strcmp(months[t.tm_mon], month_str) != 0; t.tm_mon++);
- if (months[t.tm_mon] != NULL) {
- offset_positive = FALSE;
- } else if (*tz_str == '+') {
- if (sscanf(tz_ptr, "%02d%02d", &tzhrs, &tzmins) == 2) {
- time_t tzoff = tzhrs * 60 * 60 + tzmins * 60;
- if ((sys_tzoff = wpurple_get_tz_offset()) != -1)
- tzset(); /* making sure */
- return mktime(&t) + tzoff;
- purple_debug_info("msn", "Can't parse timestamp %s\n", timestamp);
-/*Post the Offline Instant Message to User Conversation*/
-msn_oim_report_to_user(MsnOimRecvData *rdata, const char *msg_str)
- char *decode_msg = NULL, *clean_msg = NULL;
- const char *charset = NULL;
- message = msn_message_new(MSN_MSG_UNKNOWN);
- msn_message_parse_payload(message, msg_str, strlen(msg_str),
- MSG_OIM_LINE_DEM, MSG_OIM_BODY_DEM);
- purple_debug_info("msn", "oim body:{%s}\n", message->body);
- boundary = msn_message_get_header_value(message, "boundary");
- if (boundary != NULL) {
- bounds = g_strdup_printf("--%s" MSG_OIM_LINE_DEM, boundary);
- tokens = g_strsplit(message->body, bounds, 0);
- /* tokens+1 to skip the "This is a multipart message..." text */
- for (part = tokens+1; *part != NULL; part++) {
- multipart = msn_message_new(MSN_MSG_UNKNOWN);
- msn_message_parse_payload(multipart, *part, strlen(*part),
- MSG_OIM_LINE_DEM, MSG_OIM_BODY_DEM);
- type = msn_message_get_content_type(multipart);
- if (type && !strcmp(type, "text/plain")) {
- decode_msg = (char *)purple_base64_decode(multipart->body, &body_len);
- charset = msn_message_get_charset(multipart);
- msn_message_unref(multipart);
- msn_message_unref(multipart);
- if (decode_msg == NULL) {
- purple_debug_error("msn", "Couldn't find text/plain OIM message.\n");
- msn_message_unref(message);
- decode_msg = (char *)purple_base64_decode(message->body, &body_len);
- charset = msn_message_get_charset(message);
- if (charset && !((g_ascii_strncasecmp(charset, "UTF-8", 5) == 0) || (g_ascii_strncasecmp(charset, "UTF8", 4) == 0))) {
- clean_msg = g_convert(decode_msg, body_len, "UTF-8", charset, NULL, NULL, NULL);
- char *clean = purple_utf8_salvage(decode_msg);
- purple_debug_error("msn", "Failed to convert charset from %s to UTF-8 for OIM message: %s\n", charset, clean);
- clean_msg = g_strdup_printf(_("%s (There was an error receiving this message. "
- "Converting the encoding from %s to UTF-8 failed.)"),
- } else if (!g_utf8_validate(decode_msg, body_len, NULL)) {
- char *clean = purple_utf8_salvage(decode_msg);
- purple_debug_error("msn", "Received an OIM message that is not UTF-8,"
- " and no encoding specified: %s\n", clean);
- clean_msg = g_strdup_printf(_("%s (There was an error receiving this message."
- " The charset was %s, but it was not valid UTF-8.)"),
- clean_msg = g_strdup_printf(_("%s (There was an error receiving this message."
- " The charset was missing, but it was not valid UTF-8.)"),
- clean_msg = decode_msg;
- from = msn_message_get_header_value(message, "X-OIM-originatingSource");
- /* Match number to user's mobile number, FROM is a phone number
- if the other side pages you using your phone number */
- if (from && !strncmp(from, "tel:+", 5)) {
- MsnUser *user = msn_userlist_find_user_with_mobile_phone(
- rdata->oim->session->userlist, from + 4);
- if (user && user->passport)
- passport = g_strdup(user->passport);
- if (passport == NULL) {
- from = msn_message_get_header_value(message, "From");
- tokens = g_strsplit(from, " ", 2);
- from = (const char *)tokens[1];
- start = strchr(from, '<');
- end = strchr(from, '>');
- passport = g_strndup(start, end - start);
- passport = g_strdup(_("Unknown"));
- date = msn_message_get_header_value(message, "Date");
- stamp = msn_oim_parse_timestamp(date);
- purple_debug_info("msn", "oim Date:{%s},passport{%s}\n",
- serv_got_im(purple_account_get_connection(rdata->oim->session->account), passport, clean_msg, 0,
- /*Now get the oim message ID from the oim_list.
- * and append to read list to prepare for deleting the Offline Message when sign out
- msn_oim_post_delete_msg(rdata);
- msn_message_unref(message);
- * prepare to report the OIM to user
-msn_oim_get_read_cb(MsnSoapMessage *request, MsnSoapMessage *response,
- MsnOimRecvData *rdata = data;
- if (response != NULL) {
- xmlnode *msg_node = xmlnode_get_child(response->xml,
- "Body/GetMessageResponse/GetMessageResult");
- char *msg_str = xmlnode_get_data(msg_node);
- msn_oim_report_to_user(rdata, msg_str);
- char *str = xmlnode_to_str(response->xml, NULL);
- purple_debug_info("msn", "Unknown OIM response: %s\n", str);
- msn_oim_recv_data_free(rdata);
- purple_debug_info("msn", "Failed to get OIM\n");
- msn_oim_recv_data_free(rdata);
-/* parse the oim XML data
- * and post it to the soap server to get the Offline Message
-msn_parse_oim_msg(MsnOim *oim,const char *xmlmsg)
- purple_debug_info("msn", "%s\n", xmlmsg);
- if (!strcmp(xmlmsg, "too-large")) {
- /* Too many OIM's to send via NS, so we need to request them via SOAP. */
- msn_oim_get_metadata(oim);
- node = xmlnode_from_str(xmlmsg, -1);
- msn_parse_oim_xml(oim, node);
-msn_parse_oim_xml(MsnOim *oim, xmlnode *node)
- MsnSession *session = oim->session;
- g_return_if_fail(node != NULL);
- if (strcmp(node->name, "MD") != 0) {
- char *xmlmsg = xmlnode_to_str(node, NULL);
- purple_debug_info("msn", "WTF is this? %s\n", xmlmsg);
- iu_node = xmlnode_get_child(node, "E/IU");
- if (iu_node != NULL && purple_account_get_check_mail(session->account))
- char *unread = xmlnode_get_data(iu_node);
- const char *passports[2] = { msn_user_get_passport(session->user) };
- const char *urls[2] = { session->passport_info.mail_url };
- /* XXX/khc: pretty sure this is wrong */
- if (unread && (count = atoi(unread)) > 0)
- purple_notify_emails(session->account->gc, count, FALSE, NULL,
- NULL, passports, urls, NULL, NULL);
- for(mNode = xmlnode_get_child(node, "M"); mNode;
- mNode = xmlnode_get_next_twin(mNode)){
- char *passport, *msgid, *nickname, *rtime = NULL;
- xmlnode *e_node, *i_node, *n_node, *rt_node;
- e_node = xmlnode_get_child(mNode, "E");
- passport = xmlnode_get_data(e_node);
- i_node = xmlnode_get_child(mNode, "I");
- msgid = xmlnode_get_data(i_node);
- n_node = xmlnode_get_child(mNode, "N");
- nickname = xmlnode_get_data(n_node);
- rt_node = xmlnode_get_child(mNode, "RT");
- rtime = xmlnode_get_data(rt_node);
-/* purple_debug_info("msn", "E:{%s},I:{%s},rTime:{%s}\n",passport,msgid,rTime); */
- if (!g_list_find_custom(oim->oim_list, msgid, (GCompareFunc)msn_recv_data_equal)) {
- MsnOimRecvData *data = msn_oim_recv_data_new(oim, msgid);
- msn_oim_post_single_get_msg(oim, data);
-/*Post to get the Offline Instant Message*/
-msn_oim_post_single_get_msg(MsnOim *oim, MsnOimRecvData *data)
- purple_debug_info("msn", "Get single OIM Message\n");
- soap_body = g_strdup_printf(MSN_OIM_GET_TEMPLATE, data->msg_id);
- msn_oim_make_request(oim, FALSE, MSN_OIM_GET_SOAP_ACTION, MSN_OIM_RETRIEVE_HOST,
- MSN_OIM_RETRIEVE_URL, xmlnode_from_str(soap_body, -1), msn_oim_get_read_cb,
--- a/libpurple/protocols/msn/oim.h Thu Mar 12 23:59:20 2015 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,163 +0,0 @@
- * @file oim.h Header file for oim.c
- * MaYuan<mayuan2006@gmail.com>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-typedef struct _MsnOim MsnOim;
-/* OIM Retrieval Info */
-#define MSN_OIM_RETRIEVE_HOST "rsi.hotmail.com"
-#define MSN_OIM_RETRIEVE_URL "/rsi/rsi.asmx"
-/* OIM GetMetadata SOAP Template */
-#define MSN_OIM_GET_METADATA_ACTION "http://www.hotmail.msn.com/ws/2004/09/oim/rsi/GetMetadata"
-#define MSN_OIM_GET_METADATA_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
- " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
- " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
- " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
- "<PassportCookie xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
- "<GetMetadata xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\" />"\
-/*OIM GetMessage SOAP Template*/
-#define MSN_OIM_GET_SOAP_ACTION "http://www.hotmail.msn.com/ws/2004/09/oim/rsi/GetMessage"
-#define MSN_OIM_GET_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
- " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
- " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
- " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
- "<PassportCookie xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
- "<GetMessage xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
- "<messageId>%s</messageId>"\
- "<alsoMarkAsRead>false</alsoMarkAsRead>"\
-/*OIM DeleteMessages SOAP Template*/
-#define MSN_OIM_DEL_SOAP_ACTION "http://www.hotmail.msn.com/ws/2004/09/oim/rsi/DeleteMessages"
-#define MSN_OIM_DEL_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
- " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
- " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
- " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
- "<PassportCookie xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
- "<DeleteMessages xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
- "<messageId>%s</messageId>"\
-/*OIM Send SOAP Template*/
-#define MSN_OIM_MSG_TEMPLATE "MIME-Version: 1.0\n"\
- "Content-Type: text/plain; charset=UTF-8\n"\
- "Content-Transfer-Encoding: base64\n"\
- "X-OIM-Message-Type: OfflineMessage\n"\
- "X-OIM-Run-Id: {%s}\n"\
- "X-OIM-Sequence-Num: %d\n\n"
-#define MSN_OIM_SEND_HOST "ows.messenger.msn.com"
-#define MSN_OIM_SEND_URL "/OimWS/oim.asmx"
-#define MSN_OIM_SEND_SOAP_ACTION "http://messenger.live.com/ws/2006/09/oim/Store2"
-#define MSN_OIM_SEND_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
- " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
- " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
- " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
- " friendlyName=\"%s\""\
- " xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\""\
- " buildVer=\"8.5.1288\"/>"\
- "<To memberName=\"%s\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\"/>"\
- "<Ticket passport=\"EMPTY\" appid=\"%s\" lockkey=\"%s\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\"/>"\
- "<Sequence xmlns=\"http://schemas.xmlsoap.org/ws/2003/03/rm\">"\
- "<Identifier xmlns=\"http://schemas.xmlsoap.org/ws/2002/07/utility\">http://messenger.msn.com</Identifier>"\
- "<MessageNumber>%d</MessageNumber>"\
- "<MessageType xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\">text</MessageType>"\
- "<Content xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\">%s</Content>"\
-/****************************************************
- * **************************************************/
-MsnOim * msn_oim_new(MsnSession *session);
-void msn_oim_destroy(MsnOim *oim);
-void msn_parse_oim_msg(MsnOim *oim,const char *xmlmsg);
-void msn_oim_prep_send_msg_info(MsnOim *oim, const char *membername,
- const char *friendname, const char *tomember,
-void msn_oim_send_msg(MsnOim *oim);
--- a/libpurple/protocols/msn/session.c Thu Mar 12 23:59:20 2015 -0400
+++ b/libpurple/protocols/msn/session.c Fri Mar 13 00:09:51 2015 -0400
@@ -29,7 +29,6 @@
#include "notification.h"
msn_session_new(PurpleAccount *account)
@@ -47,7 +46,6 @@
session->user = msn_user_new(session->userlist,
purple_account_get_username(account), NULL);
msn_userlist_add_user(session->userlist, session->user);
- session->oim = msn_oim_new(session);
session->protocol_ver = 0;
session->enable_mpop = TRUE; /* Default only */
@@ -84,9 +82,6 @@
while (session->switches != NULL)
msn_switchboard_destroy(session->switches->data);
- if (session->oim != NULL)
- msn_oim_destroy(session->oim);
if (session->nexus != NULL)
msn_nexus_destroy(session->nexus);
--- a/libpurple/protocols/msn/session.h Thu Mar 12 23:59:20 2015 -0400
+++ b/libpurple/protocols/msn/session.h Fri Mar 13 00:09:51 2015 -0400
@@ -65,7 +65,6 @@
#include "notification.h"
@@ -89,7 +88,6 @@
MsnNotification *notification;