Mercurial > pidgin
changeset 24411:157bcca38f4c
merge of '1fde8168a6eb08e558dabefc069a0eba15a5a6ee'
and 'a151fac3bff3fa30792223f1e70e2a491cada0ed'
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 14 Nov 2008 06:57:56 +0000 |
parents | f0d5d78e8e47 (current diff) f658f9a84fe9 (diff) |
children | 63558ea6fac6 |
files | |
diffstat | 44 files changed, 406 insertions(+), 384 deletions(-) [+] |
line wrap: on
line diff
--- a/COPYRIGHT Thu Nov 13 05:33:24 2008 +0000 +++ b/COPYRIGHT Fri Nov 14 06:57:56 2008 +0000 @@ -145,6 +145,7 @@ Evgueni V. Gavrilov Ignacy Gawedzki Georgi Georgiev +Brian Geppert Thomas Gibson-Robinson Ike Gingerich Gustavo Giráldez
--- a/ChangeLog Thu Nov 13 05:33:24 2008 +0000 +++ b/ChangeLog Fri Nov 14 06:57:56 2008 +0000 @@ -7,6 +7,7 @@ "Microsoft Internet Authority" certificates. People that use --with-system-ssl-certs and GnuTLS need to include these in the system certs directory. + * Corrected maximum message lengths for Yahoo! Pidgin: * On GTK+ 2.14 and higher, we're using the gtk-tooltip-delay setting
--- a/configure.ac Thu Nov 13 05:33:24 2008 +0000 +++ b/configure.ac Fri Nov 14 06:57:56 2008 +0000 @@ -1010,23 +1010,23 @@ extern_init= load_proto= for i in $STATIC_PRPLS ; do - dnl Ugly special case for "libsilcpurple.a": + dnl Ugly special case for "libsilcpurple.la": dnl ... and Ugly special case for multi-protocol oscar if test \( "x$i" = "xoscar" -o "x$i" = "xaim" -o "x$i" = "xicq" \) -a "x$static_oscar" != "xyes"; then - STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/oscar/liboscar.a" + STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/oscar/liboscar.la" extern_init="$extern_init extern gboolean purple_init_aim_plugin();" extern_init="$extern_init extern gboolean purple_init_icq_plugin();" load_proto="$load_proto purple_init_aim_plugin();" load_proto="$load_proto purple_init_icq_plugin();" else if test "x$i" = "xsilc"; then - STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib${i}purple.a" + STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib${i}purple.la" elif test "x$i" = "xsilc10"; then - STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/libsilcpurple.a" + STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/libsilcpurple.la" elif test "x$i" = "xmsnp9"; then - STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/libmsn.a" + STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/libmsn.la" else - STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib$i.a" + STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib$i.la" fi extern_init="$extern_init extern gboolean purple_init_${i}_plugin();" load_proto="$load_proto purple_init_${i}_plugin();"
--- a/finch/libgnt/gntentry.c Thu Nov 13 05:33:24 2008 +0000 +++ b/finch/libgnt/gntentry.c Fri Nov 14 06:57:56 2008 +0000 @@ -903,6 +903,7 @@ GNT_KEY_CTRL_K, NULL); gnt_bindable_class_register_action(bindable, "delete-prev-word", del_prev_word, GNT_KEY_CTRL_W, NULL); + gnt_bindable_register_binding(bindable, "delete-prev-word", "\033", s, NULL); gnt_bindable_class_register_action(bindable, "cursor-prev-word", move_back_word, "\033" "b", NULL); gnt_bindable_class_register_action(bindable, "cursor-prev", move_back,
--- a/libpurple/dbus-analyze-functions.py Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/dbus-analyze-functions.py Fri Nov 14 06:57:56 2008 +0000 @@ -372,13 +372,13 @@ def inputsimple(self, type, name, us): if us: + self.cdecls.append("\tdbus_uint32_t %s;" % name) + self.cparams.append(("UINT32", name)) + self.addintype("u", name) + else: self.cdecls.append("\tdbus_int32_t %s;" % name) self.cparams.append(("INT32", name)) self.addintype("i", name) - else: - self.cdecls.append("\tdbus_uint32_t %s;" % name) - self.cparams.append(("UINT32", name)) - self.addintype("u", name) def inputstring(self, type, name, us): if us:
--- a/libpurple/protocols/bonjour/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/bonjour/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -30,10 +30,10 @@ if STATIC_BONJOUR st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libbonjour.a -libbonjour_a_SOURCES = $(BONJOURSOURCES) -libbonjour_a_CFLAGS = $(AM_CFLAGS) -libbonjour_a_LIBADD = $(AVAHI_LIBS) +noinst_LTLIBRARIES = libbonjour.la +libbonjour_la_SOURCES = $(BONJOURSOURCES) +libbonjour_la_CFLAGS = $(AM_CFLAGS) +libbonjour_la_LIBADD = $(AVAHI_LIBS) else @@ -44,12 +44,10 @@ endif - AM_CPPFLAGS = \ -I$(top_srcdir)/libpurple \ -I$(top_builddir)/libpurple \ $(GLIB_CFLAGS) \ $(DEBUG_CFLAGS) \ $(LIBXML_CFLAGS) \ - $(AVAHI_CFLAGS) - + $(AVAHI_CFLAGS) \ No newline at end of file
--- a/libpurple/protocols/gg/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/gg/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -52,19 +52,15 @@ if STATIC_GG st = -DPURPLE_STATIC_PRPL $(GADU_CFLAGS) -noinst_LIBRARIES = libgg.a -pkg_LTLIBRARIES = - -libgg_a_SOURCES = $(GGSOURCES) -libgg_a_CFLAGS = $(AM_CFLAGS) -libgg_a_LIBADD = $(GADU_LIBS) +noinst_LTLIBRARIES = libgg.la +libgg_la_SOURCES = $(GGSOURCES) +libgg_la_CFLAGS = $(AM_CFLAGS) +libgg_la_LIBADD = $(GADU_LIBS) else st = $(GADU_CFLAGS) pkg_LTLIBRARIES = libgg.la -noinst_LIBRARIES = - libgg_la_SOURCES = $(GGSOURCES) libgg_la_LIBADD = $(GLIB_LIBS) $(GADU_LIBS)
--- a/libpurple/protocols/irc/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/irc/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,8 +1,15 @@ -EXTRA_DIST = Makefile.mingw +EXTRA_DIST = \ + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) -IRCSOURCES = irc.c parse.c cmds.c msgs.c irc.h dcc_send.c +IRCSOURCES = \ + cmds.c \ + dcc_send.c \ + irc.c \ + irc.h \ + msgs.c \ + parse.c AM_CFLAGS = $(st) @@ -11,18 +18,14 @@ if STATIC_IRC st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libirc.a -pkg_LTLIBRARIES = - -libirc_a_SOURCES = $(IRCSOURCES) -libirc_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libirc.la +libirc_la_SOURCES = $(IRCSOURCES) +libirc_la_CFLAGS = $(AM_CFLAGS) else st = -pkg_LTLIBRARIES = libirc.la -noinst_LIBRARIES = - +pkg_LTLIBRARIES = libirc.la libirc_la_SOURCES = $(IRCSOURCES) libirc_la_LIBADD = $(GLIB_LIBS)
--- a/libpurple/protocols/jabber/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/jabber/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = \ - Makefile.mingw \ - win32/posix.uname.c \ - win32/utsname.h + Makefile.mingw \ + win32/posix.uname.c \ + win32/utsname.h pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -59,20 +59,16 @@ if STATIC_JABBER st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libjabber.a -pkg_LTLIBRARIES = - -libjabber_a_SOURCES = $(JABBERSOURCES) libxmpp.c -libjabber_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libjabber.la +libjabber_la_SOURCES = $(JABBERSOURCES) libxmpp.c +libjabber_la_CFLAGS = $(AM_CFLAGS) else st = -pkg_LTLIBRARIES = libjabber.la libxmpp.la -noinst_LIBRARIES = - +pkg_LTLIBRARIES = libjabber.la libxmpp.la libjabber_la_SOURCES = $(JABBERSOURCES) -libjabber_la_LIBADD = $(GLIB_LIBS) $(SASL_LIBS) $(LIBXML_LIBS) +libjabber_la_LIBADD = $(GLIB_LIBS) $(SASL_LIBS) $(LIBXML_LIBS) libxmpp_la_SOURCES = libxmpp.c libxmpp_la_LIBADD = libjabber.la
--- a/libpurple/protocols/msn/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = \ - directconn.c \ - directconn.h \ - Makefile.mingw + directconn.c \ + directconn.h \ + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -74,9 +74,9 @@ if STATIC_MSN st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libmsn.a -libmsn_a_SOURCES = $(MSNSOURCES) -libmsn_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libmsn.la +libmsn_la_SOURCES = $(MSNSOURCES) +libmsn_la_CFLAGS = $(AM_CFLAGS) else
--- a/libpurple/protocols/msn/httpconn.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/httpconn.c Fri Nov 14 06:57:56 2008 +0000 @@ -64,7 +64,6 @@ const char *body_start; char *tmp; size_t body_len = 0; - gboolean wasted = FALSE; g_return_val_if_fail(httpconn != NULL, FALSE); g_return_val_if_fail(buf != NULL, FALSE); @@ -158,8 +157,9 @@ } } - body = g_malloc0(body_len + 1); + body = g_malloc(body_len + 1); memcpy(body, body_start, body_len); + body[body_len] = '\0'; #ifdef MSN_DEBUG_HTTP purple_debug_misc("msn", "Incoming HTTP buffer (header): {%s\r\n}\n", @@ -217,15 +217,10 @@ g_free(tmp); - if ((session_action != NULL) && (strcmp(session_action, "close") == 0)) - wasted = TRUE; - - g_free(session_action); - t = strchr(full_session_id, '.'); session_id = g_strndup(full_session_id, t - full_session_id); - if (!wasted) + if (session_action == NULL || strcmp(session_action, "close") != 0) { g_free(httpconn->full_session_id); httpconn->full_session_id = full_session_id; @@ -254,6 +249,8 @@ g_free(session_id); g_free(gw_ip); } + + g_free(session_action); } g_free(header); @@ -723,7 +720,7 @@ httpconn->inpa = purple_input_add(httpconn->fd, PURPLE_INPUT_READ, read_cb, data); - httpconn->timer = purple_timeout_add(2000, msn_httpconn_poll, httpconn); + httpconn->timer = purple_timeout_add_seconds(2, msn_httpconn_poll, httpconn); msn_httpconn_process_queue(httpconn); }
--- a/libpurple/protocols/msn/msg.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/msg.c Fri Nov 14 06:57:56 2008 +0000 @@ -192,8 +192,9 @@ if (body_len > 0) { msg->body_len = len - (tmp - body); - msg->body = g_malloc0(msg->body_len + 1); + msg->body = g_malloc(msg->body_len + 1); memcpy(msg->body, tmp, msg->body_len); + msg->body[msg->body_len] = '\0'; tmp += body_len; } } @@ -209,8 +210,9 @@ char **elems, **cur, **tokens; g_return_if_fail(payload != NULL); - tmp_base = tmp = g_malloc0(payload_len + 1); + tmp_base = tmp = g_malloc(payload_len + 1); memcpy(tmp_base, payload, payload_len); + tmp_base[payload_len] = '\0'; /* Parse the attributes. */ end = strstr(tmp, body_dem); @@ -308,8 +310,9 @@ if (body_len > 0) { msg->body_len = body_len; g_free(msg->body); - msg->body = g_malloc0(msg->body_len + 1); + msg->body = g_malloc(msg->body_len + 1); memcpy(msg->body, tmp, msg->body_len); + msg->body[msg->body_len] = '\0'; tmp += body_len; } @@ -325,8 +328,9 @@ if (payload_len - (tmp - tmp_base) > 0) { msg->body_len = payload_len - (tmp - tmp_base); g_free(msg->body); - msg->body = g_malloc0(msg->body_len + 1); + msg->body = g_malloc(msg->body_len + 1); memcpy(msg->body, tmp, msg->body_len); + msg->body[msg->body_len] = '\0'; } } @@ -523,8 +527,9 @@ if (data != NULL && len > 0) { - msg->body = g_malloc0(len + 1); + msg->body = g_malloc(len + 1); memcpy(msg->body, data, len); + msg->body[len] = '\0'; msg->body_len = len; } else
--- a/libpurple/protocols/msn/servconn.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/servconn.c Fri Nov 14 06:57:56 2008 +0000 @@ -239,15 +239,7 @@ servconn->connect_data = purple_proxy_connect(NULL, session->account, host, port, connect_cb, servconn); - if (servconn->connect_data != NULL) - { - servconn->processing = TRUE; - return TRUE; - } - else - { - return FALSE; - } + return (servconn->connect_data != NULL); } void
--- a/libpurple/protocols/msn/session.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/session.c Fri Nov 14 06:57:56 2008 +0000 @@ -118,12 +118,7 @@ g_return_val_if_reached(FALSE); } - if (msn_notification_connect(session->notification, host, port)) - { - return TRUE; - } - - return FALSE; + return msn_notification_connect(session->notification, host, port); } void @@ -460,8 +455,10 @@ gc = purple_account_get_connection(account); img = purple_buddy_icons_find_account_icon(session->account); + /* TODO: Do we really want to call this if img is NULL? */ msn_user_set_buddy_icon(session->user, img); - purple_imgstore_unref(img); + if (img != NULL) + purple_imgstore_unref(img); session->logged_in = TRUE;
--- a/libpurple/protocols/msn/slp.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/slp.c Fri Nov 14 06:57:56 2008 +0000 @@ -33,7 +33,7 @@ #include "smiley.h" /* ms to delay between sending buddy icon requests to the server. */ -#define BUDDY_ICON_DELAY 20000 +#define BUDDY_ICON_DELAY 20 /*debug SLP*/ #define MSN_DEBUG_UD @@ -97,7 +97,7 @@ content); g_free(content); - msn_slplink_unleash(slpcall->slplink); + msn_slplink_send_queued_slpmsgs(slpcall->slplink); } void @@ -115,7 +115,7 @@ { if (slpcall->started) { - msn_slp_call_close(slpcall); + msn_slpcall_close(slpcall); } else { @@ -126,9 +126,9 @@ content); g_free(content); - msn_slplink_unleash(slpcall->slplink); + msn_slplink_send_queued_slpmsgs(slpcall->slplink); - msn_slp_call_destroy(slpcall); + msn_slpcall_destroy(slpcall); } } } @@ -219,7 +219,7 @@ msn_slplink_queue_slpmsg(slplink, slpmsg); - msn_slp_call_session_init(slpcall); + msn_slpcall_session_init(slpcall); } static void @@ -385,6 +385,7 @@ send_bye(MsnSlpCall *slpcall, const char *type) { MsnSlpLink *slplink; + PurpleAccount *account; MsnSlpMessage *slpmsg; char *header; @@ -392,8 +393,10 @@ g_return_if_fail(slplink != NULL); + account = slplink->session->account; + header = g_strdup_printf("BYE MSNMSGR:%s MSNSLP/1.0", - slplink->local_user); + purple_account_get_username(account)); slpmsg = msn_slpmsg_sip_new(slpcall, 0, header, "A0D624A6-6C0C-4283-A9E0-BC97B4B46D32", @@ -585,10 +588,10 @@ } else { - msn_slp_call_session_init(slpcall); + msn_slpcall_session_init(slpcall); } #else - msn_slp_call_session_init(slpcall); + msn_slpcall_session_init(slpcall); #endif } else if (!strcmp(type, "application/x-msnmsgr-transreqbody")) @@ -643,7 +646,7 @@ char *content; char *content_type; - slpcall = msn_slp_call_new(slplink); + slpcall = msn_slpcall_new(slplink); /* From: <msnmsgr:buddy@hotmail.com> */ #if 0 @@ -708,7 +711,7 @@ slpcall->wasted = TRUE; - /* msn_slp_call_destroy(slpcall); */ + /* msn_slpcall_destroy(slpcall); */ return slpcall; } @@ -732,7 +735,7 @@ if (slpcall != NULL) slpcall->wasted = TRUE; - /* msn_slp_call_destroy(slpcall); */ + /* msn_slpcall_destroy(slpcall); */ } else slpcall = NULL; @@ -755,17 +758,20 @@ if (slplink->swboard == NULL) { - /* We will need this in order to change its flags. */ - slplink->swboard = (MsnSwitchBoard *)cmdproc->data; - /* If swboard is NULL, something has probably gone wrong earlier on - * I didn't want to do this, but MSN 7 is somehow causing us to crash - * here, I couldn't reproduce it to debug more, and people are - * reporting bugs. Hopefully this doesn't cause more crashes. Stu. - */ - if (slplink->swboard != NULL) + if (cmdproc->data == NULL) + g_warning("msn_p2p_msg cmdproc->data was NULL\n"); + else { + /* + * We will swboard in order to change its flags. If its + * NULL, something has probably gone wrong earlier on. I + * didn't want to do this, but MSN 7 is somehow causing us + * to crash here, I couldn't reproduce it to debug more, + * and people are reporting bugs. Hopefully this doesn't + * cause more crashes. Stu. + */ + slplink->swboard = (MsnSwitchBoard *)cmdproc->data; slplink->swboard->slplinks = g_list_prepend(slplink->swboard->slplinks, slplink); - else - purple_debug_error("msn", "msn_p2p_msg, swboard is NULL, ouch!\n"); + } } msn_slplink_process_msg(slplink, msg); @@ -841,7 +847,17 @@ sha1 = msn_object_get_sha1(obj); slplink = msn_session_get_slplink(session, who); - slplink->swboard = swboard; + if (slplink->swboard != swboard) { + if (slplink->swboard != NULL) + /* + * Apparently we're using a different switchboard now or + * something? I don't know if this is normal, but it + * definitely happens. So make sure the old switchboard + * doesn't still have a reference to us. + */ + slplink->swboard->slplinks = g_list_remove(slplink->swboard->slplinks, slplink); + slplink->swboard = swboard; + } /* If the conversation doesn't exist then this is a custom smiley * used in the first message in a MSN conversation: we need to create @@ -1054,8 +1070,8 @@ purple_timeout_remove(userlist->buddy_icon_request_timer); } - /* Wait BUDDY_ICON_DELAY ms before freeing our window slot and requesting the next icon. */ - userlist->buddy_icon_request_timer = purple_timeout_add(BUDDY_ICON_DELAY, + /* Wait BUDDY_ICON_DELAY s before freeing our window slot and requesting the next icon. */ + userlist->buddy_icon_request_timer = purple_timeout_add_seconds(BUDDY_ICON_DELAY, msn_release_buddy_icon_request_timeout, userlist); }
--- a/libpurple/protocols/msn/slpcall.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/slpcall.c Fri Nov 14 06:57:56 2008 +0000 @@ -33,8 +33,30 @@ * Main **************************************************************************/ +static gboolean +msn_slpcall_timeout(gpointer data) +{ + MsnSlpCall *slpcall; + + slpcall = data; + +#ifdef MSN_DEBUG_SLPCALL + purple_debug_info("msn", "slpcall_timeout: slpcall(%p)\n", slpcall); +#endif + + if (!slpcall->pending && !slpcall->progress) + { + msn_slpcall_destroy(slpcall); + return FALSE; + } + + slpcall->progress = FALSE; + + return TRUE; +} + MsnSlpCall * -msn_slp_call_new(MsnSlpLink *slplink) +msn_slpcall_new(MsnSlpLink *slplink) { MsnSlpCall *slpcall; @@ -50,16 +72,15 @@ msn_slplink_add_slpcall(slplink, slpcall); - slpcall->timer = purple_timeout_add(MSN_SLPCALL_TIMEOUT, msn_slp_call_timeout, slpcall); + slpcall->timer = purple_timeout_add_seconds(MSN_SLPCALL_TIMEOUT, msn_slpcall_timeout, slpcall); return slpcall; } void -msn_slp_call_destroy(MsnSlpCall *slpcall) +msn_slpcall_destroy(MsnSlpCall *slpcall) { GList *e; - MsnSession *session; #ifdef MSN_DEBUG_SLPCALL purple_debug_info("msn", "slpcall_destroy: slpcall(%p)\n", slpcall); @@ -86,18 +107,16 @@ } } - session = slpcall->slplink->session; - - msn_slplink_remove_slpcall(slpcall->slplink, slpcall); - if (slpcall->end_cb != NULL) - slpcall->end_cb(slpcall, session); + slpcall->end_cb(slpcall, slpcall->slplink->session); if (slpcall->xfer != NULL) { slpcall->xfer->data = NULL; purple_xfer_unref(slpcall->xfer); } + msn_slplink_remove_slpcall(slpcall->slplink, slpcall); + g_free(slpcall->id); g_free(slpcall->branch); g_free(slpcall->data_info); @@ -106,7 +125,7 @@ } void -msn_slp_call_init(MsnSlpCall *slpcall, MsnSlpCallType type) +msn_slpcall_init(MsnSlpCall *slpcall, MsnSlpCallType type) { slpcall->session_id = rand() % 0xFFFFFF00 + 4; slpcall->id = rand_guid(); @@ -114,7 +133,7 @@ } void -msn_slp_call_session_init(MsnSlpCall *slpcall) +msn_slpcall_session_init(MsnSlpCall *slpcall) { if (slpcall->session_init_cb) slpcall->session_init_cb(slpcall); @@ -123,7 +142,7 @@ } void -msn_slp_call_invite(MsnSlpCall *slpcall, const char *euf_guid, +msn_slpcall_invite(MsnSlpCall *slpcall, const char *euf_guid, int app_id, const char *context) { MsnSlpLink *slplink; @@ -166,36 +185,14 @@ } void -msn_slp_call_close(MsnSlpCall *slpcall) +msn_slpcall_close(MsnSlpCall *slpcall) { g_return_if_fail(slpcall != NULL); g_return_if_fail(slpcall->slplink != NULL); send_bye(slpcall, "application/x-msnmsgr-sessionclosebody"); - msn_slplink_unleash(slpcall->slplink); - msn_slp_call_destroy(slpcall); -} - -gboolean -msn_slp_call_timeout(gpointer data) -{ - MsnSlpCall *slpcall; - - slpcall = data; - -#ifdef MSN_DEBUG_SLPCALL - purple_debug_info("msn", "slpcall_timeout: slpcall(%p)\n", slpcall); -#endif - - if (!slpcall->pending && !slpcall->progress) - { - msn_slp_call_destroy(slpcall); - return FALSE; - } - - slpcall->progress = FALSE; - - return TRUE; + msn_slplink_send_queued_slpmsgs(slpcall->slplink); + msn_slpcall_destroy(slpcall); } MsnSlpCall * @@ -237,7 +234,7 @@ slpcall = slplink->directconn->initial_call; if (slpcall != NULL) - msn_slp_call_session_init(slpcall); + msn_slpcall_session_init(slpcall); } #endif
--- a/libpurple/protocols/msn/slpcall.h Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/slpcall.h Fri Nov 14 06:57:56 2008 +0000 @@ -32,7 +32,7 @@ #include "slplink.h" /* The official client seems to timeout slp calls after 5 minutes */ -#define MSN_SLPCALL_TIMEOUT 300000 +#define MSN_SLPCALL_TIMEOUT 300 typedef enum { @@ -43,7 +43,7 @@ struct _MsnSlpCall { - /* MsnSession *session; */ + /* Our parent slplink */ MsnSlpLink *slplink; MsnSlpCallType type; @@ -76,16 +76,15 @@ MsnSlpCb cb; void (*end_cb)(MsnSlpCall *slpcall, MsnSession *session); - int timer; + guint timer; }; -MsnSlpCall *msn_slp_call_new(MsnSlpLink *slplink); -void msn_slp_call_init(MsnSlpCall *slpcall, MsnSlpCallType type); -void msn_slp_call_session_init(MsnSlpCall *slpcall); -void msn_slp_call_destroy(MsnSlpCall *slpcall); -void msn_slp_call_invite(MsnSlpCall *slpcall, const char *euf_guid, +MsnSlpCall *msn_slpcall_new(MsnSlpLink *slplink); +void msn_slpcall_init(MsnSlpCall *slpcall, MsnSlpCallType type); +void msn_slpcall_session_init(MsnSlpCall *slpcall); +void msn_slpcall_destroy(MsnSlpCall *slpcall); +void msn_slpcall_invite(MsnSlpCall *slpcall, const char *euf_guid, int app_id, const char *context); -void msn_slp_call_close(MsnSlpCall *slpcall); -gboolean msn_slp_call_timeout(gpointer data); +void msn_slpcall_close(MsnSlpCall *slpcall); #endif /* _MSN_SLPCALL_H_ */
--- a/libpurple/protocols/msn/slplink.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/slplink.c Fri Nov 14 06:57:56 2008 +0000 @@ -27,8 +27,6 @@ #include "switchboard.h" #include "slp.h" -void msn_slplink_send_msgpart(MsnSlpLink *slplink, MsnSlpMessage *slpmsg); - #ifdef MSN_DEBUG_SLP_FILES static int m_sc = 0; static int m_rc = 0; @@ -74,7 +72,6 @@ slplink->session = session; slplink->slp_seq_id = rand() % 0xFFFFFF00 + 4; - slplink->local_user = g_strdup(msn_user_get_passport(session->user)); slplink->remote_user = g_strdup(username); slplink->slp_msg_queue = g_queue_new(); @@ -107,14 +104,13 @@ #endif while (slplink->slp_calls != NULL) - msn_slp_call_destroy(slplink->slp_calls->data); + msn_slpcall_destroy(slplink->slp_calls->data); g_queue_free(slplink->slp_msg_queue); session->slplinks = g_list_remove(session->slplinks, slplink); - g_free(slplink->local_user); g_free(slplink->remote_user); g_free(slplink); @@ -168,19 +164,11 @@ { slplink->slp_calls = g_list_remove(slplink->slp_calls, slpcall); - /* The slplink has no slpcalls in it. If no one is using it, we might - * destroy the switchboard, but we should be careful not to use the slplink - * again. */ - if (slplink->slp_calls == NULL) - { - if (slplink->swboard != NULL) - { - if (msn_switchboard_release(slplink->swboard, MSN_SB_FLAG_FT)) - /* I'm not sure this is the best thing to do, but it's better - * than nothing. */ - slpcall->slplink = NULL; - } - } + /* The slplink has no slpcalls in it, release it from MSN_SB_FLAG_FT. + * If nothing else is using it then this might cause swboard to be + * destroyed. */ + if (slplink->slp_calls == NULL && slplink->swboard != NULL) + msn_switchboard_release(slplink->swboard, MSN_SB_FLAG_FT); } MsnSlpCall * @@ -220,7 +208,7 @@ return NULL; } -void +static void msn_slplink_send_msg(MsnSlpLink *slplink, MsnMessage *msg) { #if 0 @@ -236,8 +224,7 @@ slplink->swboard = msn_session_get_swboard(slplink->session, slplink->remote_user, MSN_SB_FLAG_FT); - if (slplink->swboard == NULL) - return; + g_return_if_fail(slplink->swboard != NULL); /* If swboard is destroyed we will be too */ slplink->swboard->slplinks = g_list_prepend(slplink->swboard->slplinks, slplink); @@ -247,54 +234,7 @@ } } -/* We have received the message ack */ static void -msg_ack(MsnMessage *msg, void *data) -{ - MsnSlpMessage *slpmsg; - long long real_size; - - slpmsg = data; - - real_size = (slpmsg->flags == 0x2) ? 0 : slpmsg->size; - - slpmsg->offset += msg->msnslp_header.length; - - if (slpmsg->offset < real_size) - { - msn_slplink_send_msgpart(slpmsg->slplink, slpmsg); - } - else - { - /* The whole message has been sent */ - if (slpmsg->flags == 0x20 || slpmsg->flags == 0x1000030) - { - if (slpmsg->slpcall != NULL) - { - if (slpmsg->slpcall->cb) - slpmsg->slpcall->cb(slpmsg->slpcall, - NULL, 0); - } - } - } - - slpmsg->msgs = g_list_remove(slpmsg->msgs, msg); -} - -/* We have received the message nak. */ -static void -msg_nak(MsnMessage *msg, void *data) -{ - MsnSlpMessage *slpmsg; - - slpmsg = data; - - msn_slplink_send_msgpart(slpmsg->slplink, slpmsg); - - slpmsg->msgs = g_list_remove(slpmsg->msgs, msg); -} - -void msn_slplink_send_msgpart(MsnSlpLink *slplink, MsnSlpMessage *slpmsg) { MsnMessage *msg; @@ -356,7 +296,54 @@ /* slpmsg->offset += len; */ } -void +/* We have received the message ack */ +static void +msg_ack(MsnMessage *msg, void *data) +{ + MsnSlpMessage *slpmsg; + long long real_size; + + slpmsg = data; + + real_size = (slpmsg->flags == 0x2) ? 0 : slpmsg->size; + + slpmsg->offset += msg->msnslp_header.length; + + if (slpmsg->offset < real_size) + { + msn_slplink_send_msgpart(slpmsg->slplink, slpmsg); + } + else + { + /* The whole message has been sent */ + if (slpmsg->flags == 0x20 || slpmsg->flags == 0x1000030) + { + if (slpmsg->slpcall != NULL) + { + if (slpmsg->slpcall->cb) + slpmsg->slpcall->cb(slpmsg->slpcall, + NULL, 0); + } + } + } + + slpmsg->msgs = g_list_remove(slpmsg->msgs, msg); +} + +/* We have received the message nak. */ +static void +msg_nak(MsnMessage *msg, void *data) +{ + MsnSlpMessage *slpmsg; + + slpmsg = data; + + msn_slplink_send_msgpart(slpmsg->slplink, slpmsg); + + slpmsg->msgs = g_list_remove(slpmsg->msgs, msg); +} + +static void msn_slplink_release_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg) { MsnMessage *msg; @@ -413,7 +400,7 @@ { slpmsg->id = slplink->slp_seq_id++; - g_queue_push_head(slplink->slp_msg_queue, slpmsg); + g_queue_push_tail(slplink->slp_msg_queue, slpmsg); } void @@ -425,19 +412,18 @@ } void -msn_slplink_unleash(MsnSlpLink *slplink) +msn_slplink_send_queued_slpmsgs(MsnSlpLink *slplink) { MsnSlpMessage *slpmsg; - /* Send the queued msgs in the order they came. */ - - while ((slpmsg = g_queue_pop_tail(slplink->slp_msg_queue)) != NULL) + /* Send the queued msgs in the order they were created */ + while ((slpmsg = g_queue_pop_head(slplink->slp_msg_queue)) != NULL) { msn_slplink_release_slpmsg(slplink, slpmsg); } } -void +static void msn_slplink_send_ack(MsnSlpLink *slplink, MsnMessage *msg) { MsnSlpMessage *slpmsg; @@ -481,6 +467,22 @@ msn_slplink_send_slpmsg(slpcall->slplink, slpmsg); } +static MsnSlpMessage * +msn_slplink_message_find(MsnSlpLink *slplink, long session_id, long id) +{ + GList *e; + + for (e = slplink->slp_msgs; e != NULL; e = e->next) + { + MsnSlpMessage *slpmsg = e->data; + + if ((slpmsg->session_id == session_id) && (slpmsg->id == id)) + return slpmsg; + } + + return NULL; +} + void msn_slplink_process_msg(MsnSlpLink *slplink, MsnMessage *msg) { @@ -632,32 +634,16 @@ /* Release all the messages and send the ACK */ msn_slplink_send_ack(slplink, msg); - msn_slplink_unleash(slplink); + msn_slplink_send_queued_slpmsgs(slplink); } msn_slpmsg_destroy(slpmsg); if (slpcall != NULL && slpcall->wasted) - msn_slp_call_destroy(slpcall); + msn_slpcall_destroy(slpcall); } } -MsnSlpMessage * -msn_slplink_message_find(MsnSlpLink *slplink, long session_id, long id) -{ - GList *e; - - for (e = slplink->slp_msgs; e != NULL; e = e->next) - { - MsnSlpMessage *slpmsg = e->data; - - if ((slpmsg->session_id == session_id) && (slpmsg->id == id)) - return slpmsg; - } - - return NULL; -} - typedef struct { guint32 length; @@ -743,8 +729,8 @@ g_return_if_fail(slplink != NULL); g_return_if_fail(fp != NULL); - slpcall = msn_slp_call_new(slplink); - msn_slp_call_init(slpcall, MSN_SLPCALL_DC); + slpcall = msn_slpcall_new(slplink); + msn_slpcall_init(slpcall, MSN_SLPCALL_DC); slpcall->session_init_cb = send_file_cb; slpcall->end_cb = msn_xfer_end_cb; @@ -761,7 +747,7 @@ context = gen_context(fn, fp); - msn_slp_call_invite(slpcall, MSN_FT_GUID, 2, context); + msn_slpcall_invite(slpcall, MSN_FT_GUID, 2, context); g_free(context); } @@ -784,14 +770,14 @@ msnobj_base64 = purple_base64_encode((const guchar *)msnobj_data, strlen(msnobj_data)); g_free(msnobj_data); - slpcall = msn_slp_call_new(slplink); - msn_slp_call_init(slpcall, MSN_SLPCALL_ANY); + slpcall = msn_slpcall_new(slplink); + msn_slpcall_init(slpcall, MSN_SLPCALL_ANY); slpcall->data_info = g_strdup(info); slpcall->cb = cb; slpcall->end_cb = end_cb; - msn_slp_call_invite(slpcall, MSN_OBJ_GUID, 1, msnobj_base64); + msn_slpcall_invite(slpcall, MSN_OBJ_GUID, 1, msnobj_base64); g_free(msnobj_base64); }
--- a/libpurple/protocols/msn/slplink.h Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/slplink.h Fri Nov 14 06:57:56 2008 +0000 @@ -45,7 +45,6 @@ MsnSession *session; MsnSwitchBoard *swboard; - char *local_user; char *remote_user; int slp_seq_id; @@ -78,19 +77,11 @@ MsnSlpCall *msn_slplink_find_slp_call(MsnSlpLink *slplink, const char *id); MsnSlpCall *msn_slplink_find_slp_call_with_session_id(MsnSlpLink *slplink, long id); -void msn_slplink_send_msg(MsnSlpLink *slplink, MsnMessage *msg); -void msn_slplink_release_slpmsg(MsnSlpLink *slplink, - MsnSlpMessage *slpmsg); void msn_slplink_queue_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg); void msn_slplink_send_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg); -void msn_slplink_unleash(MsnSlpLink *slplink); -void msn_slplink_send_ack(MsnSlpLink *slplink, MsnMessage *msg); +void msn_slplink_send_queued_slpmsgs(MsnSlpLink *slplink); void msn_slplink_process_msg(MsnSlpLink *slplink, MsnMessage *msg); -MsnSlpMessage *msn_slplink_message_find(MsnSlpLink *slplink, long session_id, long id); -void msn_slplink_append_slp_msg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg); -void msn_slplink_remove_slp_msg(MsnSlpLink *slplink, - MsnSlpMessage *slpmsg); void msn_slplink_request_ft(MsnSlpLink *slplink, PurpleXfer *xfer); void msn_slplink_request_object(MsnSlpLink *slplink,
--- a/libpurple/protocols/msn/slpmsg.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/slpmsg.c Fri Nov 14 06:57:56 2008 +0000 @@ -169,6 +169,7 @@ const char *content_type, const char *content) { MsnSlpLink *slplink; + PurpleAccount *account; MsnSlpMessage *slpmsg; char *body; gsize body_len; @@ -178,6 +179,7 @@ g_return_val_if_fail(header != NULL, NULL); slplink = slpcall->slplink; + account = slplink->session->account; /* Let's remember that "content" should end with a 0x00 */ @@ -196,7 +198,7 @@ "\r\n", header, slplink->remote_user, - slplink->local_user, + purple_account_get_username(account), branch, cseq, slpcall->id,
--- a/libpurple/protocols/msn/soap.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/soap.c Fri Nov 14 06:57:56 2008 +0000 @@ -134,7 +134,7 @@ } if (session->soap_cleanup_handle == 0) - session->soap_cleanup_handle = purple_timeout_add(SOAP_TIMEOUT * 1000, + session->soap_cleanup_handle = purple_timeout_add_seconds(SOAP_TIMEOUT, msn_soap_cleanup_for_session, session); if (conn == NULL) {
--- a/libpurple/protocols/msn/switchboard.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/switchboard.c Fri Nov 14 06:57:56 2008 +0000 @@ -1315,10 +1315,10 @@ } } -gboolean +void msn_switchboard_release(MsnSwitchBoard *swboard, MsnSBFlag flag) { - g_return_val_if_fail(swboard != NULL, FALSE); + g_return_if_fail(swboard != NULL); swboard->flag &= ~flag; @@ -1328,12 +1328,8 @@ swboard->conv = NULL; if (swboard->flag == 0) - { + /* Nothing else is using this switchboard, so close it */ msn_switchboard_close(swboard); - return TRUE; - } - - return FALSE; } /**************************************************************************
--- a/libpurple/protocols/msn/switchboard.h Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/switchboard.h Fri Nov 14 06:57:56 2008 +0000 @@ -224,10 +224,8 @@ * * @param swboard The switchboard to release. * @param flag The flag that states the function. - * - * @return @c TRUE if the switchboard was closed, @c FALSE otherwise. */ -gboolean msn_switchboard_release(MsnSwitchBoard *swboard, MsnSBFlag flag); +void msn_switchboard_release(MsnSwitchBoard *swboard, MsnSBFlag flag); /** * Returns whether or not we currently can send a message through this
--- a/libpurple/protocols/msn/transaction.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msn/transaction.c Fri Nov 14 06:57:56 2008 +0000 @@ -211,7 +211,7 @@ purple_timeout_remove(trans->timer); } trans->timeout_cb = cb; - trans->timer = purple_timeout_add(60000, transaction_timeout, trans); + trans->timer = purple_timeout_add_seconds(60, transaction_timeout, trans); } void
--- a/libpurple/protocols/msnp9/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/msnp9/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,5 +1,5 @@ EXTRA_DIST = \ - Makefile.mingw + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -70,9 +70,9 @@ if STATIC_MSN st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libmsn.a -libmsn_a_SOURCES = $(MSNP9SOURCES) -libmsn_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libmsn.la +libmsn_la_SOURCES = $(MSNP9SOURCES) +libmsn_la_CFLAGS = $(AM_CFLAGS) else
--- a/libpurple/protocols/myspace/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/myspace/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,4 +1,5 @@ -EXTRA_DIST = Makefile.mingw +EXTRA_DIST = \ + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -23,9 +24,9 @@ if STATIC_MYSPACE st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libmyspace.a -libmyspace_a_SOURCES = $(MSIMSOURCES) -libmyspace_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libmyspace.la +libmyspace_la_SOURCES = $(MSIMSOURCES) +libmyspace_la_CFLAGS = $(AM_CFLAGS) else
--- a/libpurple/protocols/myspace/myspace.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/myspace/myspace.c Fri Nov 14 06:57:56 2008 +0000 @@ -680,20 +680,34 @@ msim_incoming_im(MsimSession *session, MsimMessage *msg) { gchar *username, *msg_msim_markup, *msg_purple_markup; + gchar *userid; time_t time_received; + PurpleConversation *conv; g_return_val_if_fail(MSIM_SESSION_VALID(session), FALSE); g_return_val_if_fail(msg != NULL, FALSE); username = msim_msg_get_string(msg, "_username"); + /* I know this isn't really a string... but we need it to be one for + * purple_find_conversation_with_account(). */ + userid = msim_msg_get_string(msg, "f"); g_return_val_if_fail(username != NULL, FALSE); + purple_debug_info("msim_incoming_im", "UserID is %s", userid); + if (msim_is_userid(username)) { purple_debug_info("msim", "Ignoring message from spambot (%s) on account %s\n", username, purple_account_get_username(session->account)); g_free(username); return FALSE; } + + /* See if a conversation with their UID already exists...*/ + conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, userid, session->account); + if (conv) { + /* Since the conversation exists... We need to normalize it */ + purple_conversation_set_name(conv, username); + } msg_msim_markup = msim_msg_get_string(msg, "msg"); g_return_val_if_fail(msg_msim_markup != NULL, FALSE); @@ -703,6 +717,7 @@ time_received = msim_msg_get_integer(msg, "date"); if (!time_received) { + purple_debug_info("msim_incoming_im", "date in message not set.\n"); time_received = time(NULL); }
--- a/libpurple/protocols/myspace/myspace.h Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/myspace/myspace.h Fri Nov 14 06:57:56 2008 +0000 @@ -48,6 +48,7 @@ #include "request.h" /* For dialogs used in setting the username */ #include "xmlnode.h" #include "core.h" +#include "conversation.h" /* For late normalization */ /* MySpaceIM includes */ #include "persist.h"
--- a/libpurple/protocols/novell/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/novell/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,5 +1,5 @@ EXTRA_DIST = \ - Makefile.mingw + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -33,18 +33,14 @@ if STATIC_NOVELL st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libnovell.a -pkg_LTLIBRARIES = - -libnovell_a_SOURCES = $(NOVELLSOURCES) -libnovell_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libnovell.la +libnovell_la_SOURCES = $(NOVELLSOURCES) +libnovell_la_CFLAGS = $(AM_CFLAGS) else st = -pkg_LTLIBRARIES = libnovell.la -noinst_LIBRARIES = - +pkg_LTLIBRARIES = libnovell.la libnovell_la_SOURCES = $(NOVELLSOURCES) libnovell_la_LIBADD = $(GLIB_LIBS)
--- a/libpurple/protocols/null/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/null/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,4 +1,6 @@ -EXTRA_DIST = README Makefile.mingw +EXTRA_DIST = \ + Makefile.mingw \ + README pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -10,7 +12,7 @@ # nullprpl isn't built by default. when it is built, it's dynamically linked. st = -pkg_LTLIBRARIES = libnull.la +pkg_LTLIBRARIES = libnull.la libnull_la_SOURCES = $(NULLSOURCES) libnull_la_LIBADD = $(GLIB_LIBS)
--- a/libpurple/protocols/oscar/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/oscar/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = \ - COPYING \ - AUTHORS \ - Makefile.mingw + COPYING \ + AUTHORS \ + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -52,10 +52,9 @@ if STATIC_OSCAR st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = liboscar.a - -liboscar_a_SOURCES = $(OSCARSOURCES) libaim.c libicq.c -liboscar_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = liboscar.la +liboscar_la_SOURCES = $(OSCARSOURCES) libaim.c libicq.c +liboscar_la_CFLAGS = $(AM_CFLAGS) else @@ -64,11 +63,11 @@ liboscar_la_SOURCES = $(OSCARSOURCES) liboscar_la_LIBADD = $(GLIB_LIBS) -libaim_la_SOURCES = libaim.c -libaim_la_LIBADD = liboscar.la +libaim_la_SOURCES = libaim.c +libaim_la_LIBADD = liboscar.la -libicq_la_SOURCES = libicq.c -libicq_la_LIBADD = liboscar.la +libicq_la_SOURCES = libicq.c +libicq_la_LIBADD = liboscar.la endif
--- a/libpurple/protocols/qq/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/qq/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,5 +1,5 @@ EXTRA_DIST = \ - Makefile.mingw + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -56,9 +56,9 @@ if STATIC_QQ st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libqq.a -libqq_a_SOURCES = $(QQSOURCES) -libqq_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libqq.la +libqq_la_SOURCES = $(QQSOURCES) +libqq_la_CFLAGS = $(AM_CFLAGS) else
--- a/libpurple/protocols/sametime/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/sametime/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,21 +1,22 @@ - -EXTRA_DIST = Makefile.mingw - +EXTRA_DIST = \ + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) - noinst_HEADERS = sametime.h SAMETIMESOURCES = sametime.c +AM_CFLAGS = \ + $(st) \ + -DG_LOG_DOMAIN=\"sametime\" if STATIC_SAMETIME st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libsametime.a -libsametime_a_SOURCES = $(SAMETIMESOURCES) -libsametime_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libsametime.la +libsametime_la_SOURCES = $(SAMETIMESOURCES) +libsametime_la_CFLAGS = $(AM_CFLAGS) else @@ -23,22 +24,15 @@ pkg_LTLIBRARIES = libsametime.la libsametime_la_SOURCES = $(SAMETIMESOURCES) - endif - libsametime_la_LDFLAGS = -module -avoid-version libsametime_la_LIBADD = $(GLIB_LIBS) $(MEANWHILE_LIBS) - -AM_CFLAGS = \ - $(GLIB_CFLAGS) $(MEANWHILE_CFLAGS) \ - $(DEBUG_CFLAGS) \ +AM_CPPFLAGS = \ -I$(top_srcdir)/libpurple \ - -I$(top_builddir)/libpurple - + -I$(top_builddir)/libpurple \ + $(DEBUG_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(MEANWHILE_CFLAGS) -AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"sametime\" \ - $(st) -
--- a/libpurple/protocols/silc/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/silc/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,8 +1,21 @@ -EXTRA_DIST = README TODO Makefile.mingw +EXTRA_DIST = \ + Makefile.mingw \ + README \ + TODO pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) -SILCSOURCES = silc.c silcpurple.h buddy.c chat.c ft.c ops.c pk.c util.c wb.c wb.h +SILCSOURCES = \ + buddy.c \ + chat.c \ + ft.c \ + ops.c \ + pk.c \ + silc.c \ + silcpurple.h \ + util.c \ + wb.c \ + wb.h AM_CFLAGS = $(st) @@ -11,19 +24,15 @@ if STATIC_SILC st = -DPURPLE_STATIC_PRPL $(SILC_CFLAGS) -noinst_LIBRARIES = libsilcpurple.a -pkg_LTLIBRARIES = - -libsilcpurple_a_SOURCES = $(SILCSOURCES) -libsilcpurple_a_CFLAGS = $(AM_CFLAGS) -libsilcpurple_a_LIBADD = $(SILC_LIBS) +noinst_LTLIBRARIES = libsilcpurple.la +libsilcpurple_la_SOURCES = $(SILCSOURCES) +libsilcpurple_la_CFLAGS = $(AM_CFLAGS) +libsilcpurple_la_LIBADD = $(SILC_LIBS) else st = $(SILC_CFLAGS) -pkg_LTLIBRARIES = libsilcpurple.la -noinst_LIBRARIES = - +pkg_LTLIBRARIES = libsilcpurple.la libsilcpurple_la_SOURCES = $(SILCSOURCES) libsilcpurple_la_LIBADD = $(GLIB_LIBS) $(SILC_LIBS) @@ -32,5 +41,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/libpurple \ -I$(top_builddir)/libpurple \ + $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) \ - $(DEBUG_CFLAGS) + $(SILC_CFLAGS)
--- a/libpurple/protocols/silc10/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/silc10/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,4 +1,7 @@ -EXTRA_DIST = README TODO Makefile.mingw +EXTRA_DIST = \ + Makefile.mingw \ + README \ + TODO pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -11,19 +14,15 @@ if STATIC_SILC st = -DPURPLE_STATIC_PRPL $(SILC_CFLAGS) -noinst_LIBRARIES = libsilcpurple.a -pkg_LTLIBRARIES = - -libsilcpurple_a_SOURCES = $(SILCSOURCES) -libsilcpurple_a_CFLAGS = $(AM_CFLAGS) -libsilcpurple_a_LIBADD = $(SILC_LIBS) +noinst_LTLIBRARIES = libsilcpurple.la +libsilcpurple_la_SOURCES = $(SILCSOURCES) +libsilcpurple_la_CFLAGS = $(AM_CFLAGS) +libsilcpurple_la_LIBADD = $(SILC_LIBS) else st = $(SILC_CFLAGS) -pkg_LTLIBRARIES = libsilcpurple.la -noinst_LIBRARIES = - +pkg_LTLIBRARIES = libsilcpurple.la libsilcpurple_la_SOURCES = $(SILCSOURCES) libsilcpurple_la_LIBADD = $(GLIB_LIBS) $(SILC_LIBS) @@ -32,5 +31,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/libpurple \ -I$(top_builddir)/libpurple \ + $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) \ - $(DEBUG_CFLAGS) + $(SILC_CFLAGS)
--- a/libpurple/protocols/simple/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/simple/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,5 +1,5 @@ EXTRA_DIST = \ - Makefile.mingw + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -9,21 +9,21 @@ sipmsg.c \ sipmsg.h -AM_CFLAGS = $(st) +AM_CFLAGS = $(st) libsimple_la_LDFLAGS = -module -avoid-version if STATIC_MSN st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libsimple.a -libsimple_a_SOURCES = $(SIMPLESOURCES) -libsimple_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libsimple.la +libsimple_la_SOURCES = $(SIMPLESOURCES) +libsimple_la_CFLAGS = $(AM_CFLAGS) else st = -pkg_LTLIBRARIES = libsimple.la +pkg_LTLIBRARIES = libsimple.la libsimple_la_SOURCES = $(SIMPLESOURCES) libsimple_la_LIBADD = $(GLIB_LIBS)
--- a/libpurple/protocols/toc/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/toc/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,6 +1,6 @@ EXTRA_DIST = \ - PROTOCOL \ - Makefile.mingw + PROTOCOL \ + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -13,9 +13,9 @@ if STATIC_TOC st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libtoc.a -libtoc_a_SOURCES = $(TOCSOURCES) -libtoc_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libtoc.la +libtoc_la_SOURCES = $(TOCSOURCES) +libtoc_la_CFLAGS = $(AM_CFLAGS) else
--- a/libpurple/protocols/yahoo/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/yahoo/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -1,5 +1,5 @@ EXTRA_DIST = \ - Makefile.mingw + Makefile.mingw pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) @@ -36,9 +36,9 @@ if STATIC_YAHOO st = -DPURPLE_STATIC_PRPL -noinst_LIBRARIES = libyahoo.a -libyahoo_a_SOURCES = $(YAHOOSOURCES) -libyahoo_a_CFLAGS = $(AM_CFLAGS) +noinst_LTLIBRARIES = libyahoo.la +libyahoo_la_SOURCES = $(YAHOOSOURCES) +libyahoo_la_CFLAGS = $(AM_CFLAGS) else @@ -53,4 +53,4 @@ -I$(top_srcdir)/libpurple \ -I$(top_builddir)/libpurple \ $(GLIB_CFLAGS) \ - $(DEBUG_CFLAGS) + $(DEBUG_CFLAGS) \ No newline at end of file
--- a/libpurple/protocols/yahoo/yahoo.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Fri Nov 14 06:57:56 2008 +0000 @@ -3619,8 +3619,26 @@ PurpleWhiteboard *wb; int ret = 1; YahooFriend *f = NULL; + gsize lenb = 0; + glong lenc = 0; msg2 = yahoo_string_encode(gc, msg, &utf8); + + if(msg2) { + lenb = strlen(msg2); + lenc = g_utf8_strlen(msg2, -1); + + if(lenb > YAHOO_MAX_MESSAGE_LENGTH_BYTES || lenc > YAHOO_MAX_MESSAGE_LENGTH_CHARS) { + purple_debug_info("yahoo", "Message too big. Length is %" G_GSIZE_FORMAT + " bytes, %ld characters. Max is %d bytes, %d chars." + " Message is '%s'.\n", lenb, lenc, YAHOO_MAX_MESSAGE_LENGTH_BYTES, + YAHOO_MAX_MESSAGE_LENGTH_CHARS, msg2); + yahoo_packet_free(pkt); + g_free(msg); + g_free(msg2); + return -E2BIG; + } + } yahoo_packet_hash(pkt, "ss", 1, purple_connection_get_display_name(gc), 5, who); if ((f = yahoo_friend_find(gc, who)) && f->protocol)
--- a/libpurple/protocols/yahoo/yahoo.h Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.h Fri Nov 14 06:57:56 2008 +0000 @@ -182,6 +182,21 @@ #define YAHOO_MAX_STATUS_MESSAGE_LENGTH (255) +/* + * Current Maximum Length for Instant Messages + * + * This was found by experiment. + * + * The YMSG protocol allows a message of up to 948 bytes, but the official client + * limits to 800 characters. According to experiments I conducted, it seems that + * the discrepancy is to allow some leeway for messages with mixed single- and + * multi-byte characters, as I was able to send messages of 840 and 932 bytes + * by using some multibyte characters (some random Chinese or Japanese characters, + * to be precise). - rekkanoryo + */ +#define YAHOO_MAX_MESSAGE_LENGTH_BYTES 948 +#define YAHOO_MAX_MESSAGE_LENGTH_CHARS 800 + /* sometimes i wish prpls could #include things from other prpls. then i could just * use the routines from libfaim and not have to admit to knowing how they work. */ #define yahoo_put16(buf, data) ( \
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Fri Nov 14 06:57:56 2008 +0000 @@ -262,7 +262,7 @@ content_length = YAHOO_PACKET_HDRLEN + yahoo_packet_length(pkt); - pkt_buf_len = yahoo_packet_build(pkt, 8, FALSE, yd->jp, &pkt_buf); + pkt_buf_len = yahoo_packet_build(pkt, 4, FALSE, yd->jp, &pkt_buf); yahoo_packet_free(pkt); host = purple_account_get_string(account, "xfer_host", YAHOO_XFER_HOST);
--- a/libpurple/protocols/zephyr/Makefile.am Thu Nov 13 05:33:24 2008 +0000 +++ b/libpurple/protocols/zephyr/Makefile.am Fri Nov 14 06:57:56 2008 +0000 @@ -62,7 +62,6 @@ zephyr_err.c \ zephyr_err.h \ zephyr_internal.h \ - \ zephyr.c ZEPHYRSOURCESEXT = zephyr.c @@ -78,10 +77,10 @@ if STATIC_ZEPHYR st = -DPURPLE_STATIC_PRPL -Dlint -noinst_LIBRARIES = libzephyr.a -libzephyr_a_SOURCES = $(ZEPHYRSOURCES) -libzephyr_a_CFLAGS = $(AM_CFLAGS) -libzephyr_a_LIBADD = $(ZEPHYRLIBS) +noinst_LTLIBRARIES = libzephyr.la +libzephyr_la_SOURCES = $(ZEPHYRSOURCES) +libzephyr_la_CFLAGS = $(AM_CFLAGS) +libzephyr_la_LIBADD = $(ZEPHYRLIBS) else @@ -90,7 +89,7 @@ if EXTERNAL_LIBZEPHYR libzephyr_la_SOURCES = $(ZEPHYRSOURCESEXT) -libzephyr_la_LIBADD = $(GLIB_LIBS) $(ZEPHYRLIBSEXT) +libzephyr_la_LIBADD = $(GLIB_LIBS) $(ZEPHYRLIBSEXT) else libzephyr_la_SOURCES = $(ZEPHYRSOURCES) libzephyr_la_LIBADD = $(GLIB_LIBS) $(ZEPHYRLIBS)
--- a/pidgin/gtkconv.c Thu Nov 13 05:33:24 2008 +0000 +++ b/pidgin/gtkconv.c Fri Nov 14 06:57:56 2008 +0000 @@ -971,7 +971,9 @@ } name = purple_conversation_get_name(conv); - fprintf(fp, "<html>\n<head><title>%s</title></head>\n<body>", name); + fprintf(fp, "<html>\n<head>\n"); + fprintf(fp, "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n"); + fprintf(fp, "<title>%s</title>\n</head>\n<body>\n", name); fprintf(fp, _("<h1>Conversation with %s</h1>\n"), name); lines = gtk_imhtml_get_markup_lines(
--- a/pidgin/plugins/markerline.c Thu Nov 13 05:33:24 2008 +0000 +++ b/pidgin/plugins/markerline.c Fri Nov 14 06:57:56 2008 +0000 @@ -202,16 +202,14 @@ } static void -conv_created(PurpleConversation *conv, gpointer null) +conv_created(PidginConversation *gtkconv, gpointer null) { - PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); PidginWindow *win; - if (!gtkconv) + win = pidgin_conv_get_window(gtkconv); + if (!win) return; - win = pidgin_conv_get_window(gtkconv); - detach_from_pidgin_window(win, NULL); attach_to_pidgin_window(win, NULL); } @@ -247,7 +245,7 @@ { attach_to_all_windows(); - purple_signal_connect(purple_conversations_get_handle(), "conversation-created", + purple_signal_connect(pidgin_conversations_get_handle(), "conversation-displayed", plugin, PURPLE_CALLBACK(conv_created), NULL); purple_signal_connect(purple_conversations_get_handle(), "conversation-extended-menu",