# HG changeset patch # User Stu Tomlinson # Date 1101665598 0 # Node ID d9468bd22b7c7d87d1c1d778e14328bcd0192e2f # Parent 3016b1b32339170022a6294062dde16c85199313 [gaim-migrate @ 11428] I reworked Fernando Herrera's patch from September to show who you've blocked and who doesn't have you on their MSN buddy list as emblems. I reworked Evan Schoenberg's patch to more accurately render formatting in messages sent to yourself on MSN Applied part of a patch from Felipe Contreras to fix auto-login to hotmail for new mail (the other part was to make it work on win32, but I think that's no longer needed), and I made sure that the temporary file used is deleted at the end of the session (mentioned in patch 1059682 by Nigel Horne) Applied patch 1073317 by Nigel Horne - even though I think it may not be strictly necessary, it's probably safer like this. I'm committing Felipe's new MSN icon too, I think it's much better, and so does everyone else who's expressed an opinion. committer: Tailor Script diff -r 3016b1b32339 -r d9468bd22b7c pixmaps/status/default/Makefile.am --- a/pixmaps/status/default/Makefile.am Sat Nov 27 19:39:25 2004 +0000 +++ b/pixmaps/status/default/Makefile.am Sun Nov 28 18:13:18 2004 +0000 @@ -4,6 +4,7 @@ aim.png \ aol.png \ away.png \ + blocked.png \ dnd.png \ extendedaway.png \ female.png \ @@ -26,6 +27,7 @@ napster.png \ notauthorized.png \ novell.png \ + nr.png \ occupied.png \ offline.png \ op.png \ diff -r 3016b1b32339 -r d9468bd22b7c pixmaps/status/default/msn.png Binary file pixmaps/status/default/msn.png has changed diff -r 3016b1b32339 -r d9468bd22b7c pixmaps/status/default/msn.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pixmaps/status/default/msn.svg Sun Nov 28 18:13:18 2004 +0000 @@ -0,0 +1,75 @@ + + + + diff -r 3016b1b32339 -r d9468bd22b7c src/protocols/msn/msg.c --- a/src/protocols/msn/msg.c Sat Nov 27 19:39:25 2004 +0000 +++ b/src/protocols/msn/msg.c Sun Nov 28 18:13:18 2004 +0000 @@ -214,7 +214,7 @@ else { msg->body_len = payload_len - (tmp - tmp_base); - msg->body = g_memdup(tmp, msg->body_len); + msg->body = g_memdup(tmp, msg->body_len + 1); } g_free(tmp_base); diff -r 3016b1b32339 -r d9468bd22b7c src/protocols/msn/msn.c --- a/src/protocols/msn/msn.c Sat Nov 27 19:39:25 2004 +0000 +++ b/src/protocols/msn/msn.c Sun Nov 28 18:13:18 2004 +0000 @@ -49,8 +49,6 @@ #define BUDDY_ALIAS_MAXLEN 387 -static GaimPlugin *my_protocol = NULL; - typedef struct { GaimConnection *gc; @@ -458,8 +456,15 @@ { emblems[0] = "offline"; } - else if (user->mobile) - emblems[i++] = "wireless"; + else + { + if (user->mobile) + emblems[i++] = "wireless"; + if (user->list_op & (1 << MSN_LIST_BL)) + emblems[i++] = "blocked"; + if (!(user->list_op & (1 << MSN_LIST_RL))) + emblems[i++] = "nr"; + } *se = emblems[0]; *sw = emblems[1]; @@ -507,6 +512,9 @@ g_string_append_printf(s, _("\n%s: %s"), _("Has you"), (user->list_op & (1 << MSN_LIST_RL)) ? _("Yes") : _("No")); + g_string_append_printf(s, _("\n%s: %s"), _("Blocked"), + (user->list_op & (1 << MSN_LIST_BL)) ? + _("Yes") : _("No")); } return g_string_free(s, FALSE); @@ -679,7 +687,6 @@ } session = msn_session_new(account, host, port, http_method); - session->prpl = my_protocol; if (session->http_method) msn_http_session_init(session); @@ -720,37 +727,36 @@ GaimConvImFlags flags) { GaimAccount *account; + MsnMessage *msg; + char *msgformat; + char *msgtext; account = gaim_connection_get_account(gc); + msn_import_html(message, &msgformat, &msgtext); + + if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) + { + g_free(msgformat); + g_free(msgtext); + + return -E2BIG; + } + + msg = msn_message_new_plain(msgtext); + msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat); + + g_free(msgformat); + g_free(msgtext); + if (g_ascii_strcasecmp(who, gaim_account_get_username(account))) { MsnSession *session; MsnSwitchBoard *swboard; - MsnMessage *msg; - char *msgformat; - char *msgtext; session = gc->proto_data; swboard = msn_session_get_swboard(session, who); - msn_import_html(message, &msgformat, &msgtext); - - if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) - { - g_free(msgformat); - g_free(msgtext); - - return -E2BIG; - } - - msg = msn_message_new_plain(msgtext); - msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat); - - g_free(msgformat); - g_free(msgtext); - - swboard = msn_session_get_swboard(session, who); if (!g_queue_is_empty(swboard->im_queue) || !swboard->user_joined) @@ -762,18 +768,32 @@ msn_switchboard_send_msg(swboard, msg); } - msn_message_destroy(msg); } else { + char *body_str, *body_enc, *pre, *post; + const char *format; /* * In MSN, you can't send messages to yourself, so * we'll fake like we received it ;) */ + body_str = msn_message_to_string(msg); + body_enc = gaim_escape_html(body_str); + g_free(body_str); + + format = msn_message_get_attr(msg, "X-MMS-IM-Format"); + msn_parse_format(format, &pre, &post); + body_str = g_strdup_printf("%s%s%s", pre, body_enc, post); + g_free(pre); + g_free(post); + serv_got_typing_stopped(gc, who); - serv_got_im(gc, who, message, flags, time(NULL)); + serv_got_im(gc, who, body_str, flags, time(NULL)); + g_free(body_str); } + msn_message_destroy(msg); + return 1; } @@ -1949,8 +1969,6 @@ prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); - my_protocol = plugin; - gaim_prefs_add_none("/plugins/prpl/msn"); gaim_prefs_add_bool("/plugins/prpl/msn/conv_close_notice", TRUE); gaim_prefs_add_bool("/plugins/prpl/msn/conv_timeout_notice", TRUE); diff -r 3016b1b32339 -r d9468bd22b7c src/protocols/msn/msn.h --- a/src/protocols/msn/msn.h Sat Nov 27 19:39:25 2004 +0000 +++ b/src/protocols/msn/msn.h Sun Nov 28 18:13:18 2004 +0000 @@ -85,14 +85,15 @@ typedef enum { - MSN_CLIENT_CAP_WIN_MOBILE = 0x01, - MSN_CLIENT_CAP_UNKNOWN_1 = 0x02, - MSN_CLIENT_CAP_VIEW_INK = 0x04, - MSN_CLIENT_CAP_SEND_INK = 0x08, - MSN_CLIENT_CAP_VIDEO_CHAT = 0x10, - MSN_CLIENT_CAP_BASE = 0x20, - MSN_CLIENT_CAP_UNKNOWN_2 = 0x40, - MSN_CLIENT_CAP_UNKNOWN_3 = 0x80 + MSN_CLIENT_CAP_WIN_MOBILE = 0x001, + MSN_CLIENT_CAP_UNKNOWN_1 = 0x002, + MSN_CLIENT_CAP_VIEW_INK = 0x004, + MSN_CLIENT_CAP_SEND_INK = 0x008, + MSN_CLIENT_CAP_VIDEO_CHAT = 0x010, + MSN_CLIENT_CAP_BASE = 0x020, + MSN_CLIENT_CAP_MSNMOBILE = 0x040, + MSN_CLIENT_CAP_MSNDIRECT = 0x080, + MSN_CLIENT_CAP_WEBMSGR = 0x100 } MsnClientCaps; @@ -100,7 +101,9 @@ { MSN_CLIENT_VER_5_0 = 0x00, MSN_CLIENT_VER_6_0 = 0x10, - MSN_CLIENT_VER_6_1 = 0x20 + MSN_CLIENT_VER_6_1 = 0x20, + MSN_CLIENT_VER_6_2 = 0x30, + MSN_CLIENT_VER_7_0 = 0x40 } MsnClientVerId; diff -r 3016b1b32339 -r d9468bd22b7c src/protocols/msn/notification.c --- a/src/protocols/msn/notification.c Sat Nov 27 19:39:25 2004 +0000 +++ b/src/protocols/msn/notification.c Sun Nov 28 18:13:18 2004 +0000 @@ -960,6 +960,9 @@ if ((value = msn_message_get_attr(msg, "ClientPort")) != NULL) session->passport_info.client_port = ntohs(atoi(value)); + + if ((value = msn_message_get_attr(msg, "LoginTime")) != NULL) + session->passport_info.sl = atol(value); } static void diff -r 3016b1b32339 -r d9468bd22b7c src/protocols/msn/session.c --- a/src/protocols/msn/session.c Sat Nov 27 19:39:25 2004 +0000 +++ b/src/protocols/msn/session.c Sun Nov 28 18:13:18 2004 +0000 @@ -88,7 +88,10 @@ g_free(session->passport_info.mspauth); if (session->passport_info.file != NULL) + { + unlink(session->passport_info.file); g_free(session->passport_info.file); + } if (session->sync != NULL) msn_sync_destroy(session->sync); diff -r 3016b1b32339 -r d9468bd22b7c src/protocols/msn/session.h --- a/src/protocols/msn/session.h Sat Nov 27 19:39:25 2004 +0000 +++ b/src/protocols/msn/session.h Sun Nov 28 18:13:18 2004 +0000 @@ -83,8 +83,6 @@ /* You have no idea how much I hate all that is below. */ /* shx: What? ;) */ - GaimPlugin *prpl; - MsnSync *sync; GList *slplinks;