changeset 30516:d4ec9ba82814

propagate from branch 'im.pidgin.pidgin' (head 23403faa17b752c8e88650199945fbd8843f3796) to branch 'im.pidgin.cpw.malu.xmpp.google_relay' (head ed29df60be204b4d77335d8f8c5afc1fcee6d457)
author Marcus Lundblad <ml@update.uu.se>
date Thu, 10 Dec 2009 21:36:41 +0000
parents 6921cc1e704b (diff) 7f1da2fbe7fc (current diff)
children 105437d8253f 090e141a5214
files libpurple/protocols/jabber/google.c
diffstat 55 files changed, 182 insertions(+), 151 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Dec 06 19:06:42 2009 +0000
+++ b/ChangeLog	Thu Dec 10 21:36:41 2009 +0000
@@ -4,6 +4,10 @@
 	General:
 	* Build-time fixes for Solaris.  (Paul Townsend)
 
+	AIM and ICQ:
+	* Messages from some mobile clients are no longer displayed as
+	  Chinese characters (broken in 2.6.4)
+
 	XMPP:
 	* Added support for the SCRAM-SHA-1 SASL mechanism.  This is only
 	  available when built without Cyrus SASL support.
@@ -11,7 +15,8 @@
 	  (when given by the result of the "last query") and don't show status as
 	  offline.
 	* Do not crash when attempting to register for a new account on Windows.
-	* Added support for Roster Versioning (XEP-0237).
+	* Fix file transfer with clients that do not support Entity Capabilities
+	  (e.g. Spark)
 
 version 2.6.4 (11/29/2009):
 	libpurple:
--- a/ChangeLog.win32	Sun Dec 06 19:06:42 2009 +0000
+++ b/ChangeLog.win32	Thu Dec 10 21:36:41 2009 +0000
@@ -1,4 +1,5 @@
 version 2.6.5 (??/??/20??):
+	* Installer translations for: Norwegian nynorsk
 
 version 2.6.4 (11/29/2009):
 	* Register URL handlers for everything that Windows knows about.  Still
--- a/finch/finch.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/finch.c	Thu Dec 10 21:36:41 2009 +0000
@@ -19,8 +19,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#include <internal.h>
 #include "finch.h"
-#include <internal.h>
 
 #include "account.h"
 #include "conversation.h"
--- a/finch/gntaccount.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/gntaccount.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,6 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#include <internal.h>
+
 #include <gnt.h>
 #include <gntbox.h>
 #include <gntbutton.h>
@@ -36,7 +38,6 @@
 #include <gntwindow.h>
 
 #include "finch.h"
-#include <internal.h>
 
 #include <account.h>
 #include <accountopt.h>
--- a/finch/gntblist.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/gntblist.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,8 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#include <internal.h>
 #include "finch.h"
-#include <internal.h>
 
 #include <account.h>
 #include <blist.h>
--- a/finch/gntcertmgr.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/gntcertmgr.c	Thu Dec 10 21:36:41 2009 +0000
@@ -25,8 +25,8 @@
  *
  */
 
+#include <internal.h>
 #include "finch.h"
-#include <internal.h>
 
 #include "certificate.h"
 #include "debug.h"
--- a/finch/gntconn.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/gntconn.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,8 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#include <internal.h>
 #include "finch.h"
-#include <internal.h>
 
 #include "account.h"
 #include "core.h"
--- a/finch/gntconv.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/gntconv.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,10 +23,9 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
-#include <string.h>
 
+#include <internal.h>
 #include "finch.h"
-#include <internal.h>
 
 #include <cmds.h>
 #include <core.h>
--- a/finch/gntdebug.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/gntdebug.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,6 +23,9 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+
+#include <internal.h>
+
 #include <gnt.h>
 #include <gntbox.h>
 #include <gntbutton.h>
@@ -35,7 +38,6 @@
 
 #include "gntdebug.h"
 #include "finch.h"
-#include <internal.h>
 #include "notify.h"
 #include "util.h"
 
--- a/finch/gntft.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/gntft.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,8 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#include <internal.h>
 #include "finch.h"
-#include <internal.h>
 
 #include <gnt.h>
 #include <gntbox.h>
--- a/finch/gntlog.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/gntlog.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,8 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#include <internal.h>
 #include "finch.h"
-#include <internal.h>
 
 #include <gnt.h>
 #include <gntbox.h>
--- a/finch/gntmedia.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/gntmedia.c	Thu Dec 10 21:36:41 2009 +0000
@@ -24,8 +24,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
+#include <internal.h>
 #include "finch.h"
-#include <internal.h>
 #include "gntconv.h"
 #include "gntmedia.h"
 
--- a/finch/gntnotify.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/gntnotify.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,6 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#include <internal.h>
+
 #include <gnt.h>
 #include <gntbox.h>
 #include <gntbutton.h>
@@ -32,7 +34,6 @@
 #include <gntwindow.h>
 
 #include "finch.h"
-#include <internal.h>
 
 #include <util.h>
 
--- a/finch/gntplugin.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/gntplugin.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,6 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#include <internal.h>
+
 #include <gnt.h>
 #include <gntbox.h>
 #include <gntbutton.h>
@@ -32,7 +34,6 @@
 #include <gntutils.h>
 
 #include "finch.h"
-#include <internal.h>
 
 #include "debug.h"
 #include "notify.h"
--- a/finch/gntpounce.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/gntpounce.c	Thu Dec 10 21:36:41 2009 +0000
@@ -24,6 +24,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  *
  */
+#include <internal.h>
+
 #include <gnt.h>
 #include <gntbox.h>
 #include <gntbutton.h>
@@ -36,7 +38,6 @@
 #include <gntutils.h>
 
 #include "finch.h"
-#include <internal.h>
 
 #include "account.h"
 #include "conversation.h"
--- a/finch/libgnt/gntkeys.h	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/libgnt/gntkeys.h	Thu Dec 10 21:36:41 2009 +0000
@@ -65,7 +65,7 @@
 #define GNT_KEY_BACKSPACE SAFE(key_backspace)
 #define GNT_KEY_DEL    SAFE(key_dc)
 #define GNT_KEY_INS    SAFE(key_ic)
-#define GNT_KEY_BACK_TAB SAFE(back_tab)
+#define GNT_KEY_BACK_TAB (back_tab ? back_tab : SAFE(key_btab))
 
 #define GNT_KEY_CTRL_A     "\001"
 #define GNT_KEY_CTRL_B     "\002"
--- a/finch/libgnt/gntutils.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/libgnt/gntutils.c	Thu Dec 10 21:36:41 2009 +0000
@@ -20,6 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
+#include "config.h"
+
 #include "gntinternal.h"
 #undef GNT_LOG_DOMAIN
 #define GNT_LOG_DOMAIN "Utils"
@@ -35,8 +37,6 @@
 #include "gntutils.h"
 #include "gntwindow.h"
 
-#include "config.h"
-
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
@@ -46,8 +46,6 @@
 #include <libxml/tree.h>
 #endif
 
-#include "config.h"
-
 void gnt_util_get_text_bound(const char *text, int *width, int *height)
 {
 	const char *s = text, *last;
--- a/finch/libgnt/wms/s.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/finch/libgnt/wms/s.c	Thu Dec 10 21:36:41 2009 +0000
@@ -1,8 +1,8 @@
+#include "internal.h"
+
 #include <string.h>
 #include <sys/types.h>
 
-#include "internal.h"
-
 #include "gnt.h"
 #include "gntbox.h"
 #include "gntmenu.h"
--- a/libpurple/protocols/gg/lib/common.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/gg/lib/common.c	Thu Dec 10 21:36:41 2009 +0000
@@ -19,6 +19,8 @@
  *  USA.
  */
 
+#include "libgadu.h"
+
 #ifndef _WIN32
 #include <sys/types.h>
 #include <sys/ioctl.h>
@@ -41,8 +43,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "libgadu.h"
-
 FILE *gg_debug_file = NULL;
 
 #ifndef GG_DEBUG_DISABLE
--- a/libpurple/protocols/gg/lib/dcc.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/gg/lib/dcc.c	Thu Dec 10 21:36:41 2009 +0000
@@ -19,6 +19,8 @@
  *  USA.
  */
 
+#include "libgadu.h"
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #ifndef _WIN32
@@ -41,8 +43,6 @@
 #include <unistd.h>
 
 #include "compat.h"
-#include "libgadu.h"
-
 #ifndef GG_DEBUG_DISABLE
 /*
  * gg_dcc_debug_data() // funkcja wewnêtrzna
--- a/libpurple/protocols/gg/lib/events.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/gg/lib/events.c	Thu Dec 10 21:36:41 2009 +0000
@@ -20,6 +20,8 @@
  *  USA.
  */
 
+#include "libgadu.h"
+
 #include <sys/types.h>
 #ifndef _WIN32
 #include <sys/wait.h>
@@ -46,7 +48,6 @@
 #endif
 
 #include "compat.h"
-#include "libgadu.h"
 
 /*
  * gg_event_free()
--- a/libpurple/protocols/gg/lib/http.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/gg/lib/http.c	Thu Dec 10 21:36:41 2009 +0000
@@ -18,6 +18,8 @@
  *  USA.
  */
 
+#include "libgadu.h"
+
 #include <sys/types.h>
 #ifndef _WIN32
 #include <sys/wait.h>
@@ -43,7 +45,6 @@
 #include <unistd.h>
 
 #include "compat.h"
-#include "libgadu.h"
 
 /*
  * gg_http_connect() // funkcja pomocnicza
--- a/libpurple/protocols/gg/lib/libgadu.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/gg/lib/libgadu.c	Thu Dec 10 21:36:41 2009 +0000
@@ -21,6 +21,8 @@
  *  USA.
  */
 
+#include "libgadu.h"
+
 #include <sys/types.h>
 #ifndef _WIN32
 #include <sys/wait.h>
@@ -57,7 +59,6 @@
 #endif
 
 #include "compat.h"
-#include "libgadu.h"
 
 int gg_debug_level = 0;
 void (*gg_debug_handler)(int level, const char *format, va_list ap) = NULL;
--- a/libpurple/protocols/gg/lib/pubdir.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/gg/lib/pubdir.c	Thu Dec 10 21:36:41 2009 +0000
@@ -19,6 +19,8 @@
  *  USA.
  */
 
+#include "libgadu.h"
+
 #include <ctype.h>
 #include <errno.h>
 #include <stdarg.h>
@@ -27,8 +29,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "libgadu.h"
-
 /*
  * gg_register3()
  *
--- a/libpurple/protocols/gg/lib/pubdir50.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/gg/lib/pubdir50.c	Thu Dec 10 21:36:41 2009 +0000
@@ -18,13 +18,13 @@
  *  USA.
  */
 
+#include "libgadu.h"
+
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
 
-#include "libgadu.h"
-
 /*
  * gg_pubdir50_new()
  *
--- a/libpurple/protocols/jabber/disco.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/jabber/disco.c	Thu Dec 10 21:36:41 2009 +0000
@@ -370,10 +370,8 @@
 	if (js->pep)
 		jabber_avatar_fetch_mine(js);
 
-	if (!(js->server_caps & JABBER_CAP_GOOGLE_ROSTER)) {
-		/* If the server supports JABBER_CAP_GOOGLE_ROSTER; we will have already requested it */
-		jabber_roster_request(js);
-	}
+	/* Yes, please! */
+	jabber_roster_request(js);
 
 	if (js->server_caps & JABBER_CAP_ADHOC) {
 		/* The server supports ad-hoc commands, so let's request the list */
@@ -555,9 +553,8 @@
 		if (!strcmp(NS_GOOGLE_MAIL_NOTIFY, var)) {
 			js->server_caps |= JABBER_CAP_GMAIL_NOTIFY;
 			jabber_gmail_init(js);
-		} else if (!strcmp("google:roster", var)) {
+		} else if (!strcmp(NS_GOOGLE_ROSTER, var)) {
 			js->server_caps |= JABBER_CAP_GOOGLE_ROSTER;
-			jabber_google_roster_init(js);
 		} else if (!strcmp("http://jabber.org/protocol/commands", var)) {
 			js->server_caps |= JABBER_CAP_ADHOC;
 		} else if (!strcmp(NS_SIMPLE_BLOCKING, var)) {
--- a/libpurple/protocols/jabber/google.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/jabber/google.c	Thu Dec 10 21:36:41 2009 +0000
@@ -1117,33 +1117,6 @@
 	jabber_iq_send(iq);
 }
 
-static void
-roster_init_cb(JabberStream *js, const char *from, JabberIqType type,
-               const char *id, xmlnode *packet, gpointer data)
-{
-	xmlnode *query = xmlnode_get_child(packet, "query");
-
-	if (type == JABBER_IQ_RESULT && query)
-		jabber_roster_parse(js, from, type, id, query);
-
-	jabber_stream_set_state(js, JABBER_STREAM_CONNECTED);
-}
-
-void jabber_google_roster_init(JabberStream *js)
-{
-	JabberIq *iq;
-	xmlnode *query;
-
-	iq = jabber_iq_new_query(js, JABBER_IQ_GET, "jabber:iq:roster");
-	query = xmlnode_get_child(iq->node, "query");
-
-	xmlnode_set_attrib(query, "xmlns:gr", "google:roster");
-	xmlnode_set_attrib(query, "gr:ext", "2");
-
-	jabber_iq_set_callback(iq, roster_init_cb, NULL);
-	jabber_iq_send(iq);
-}
-
 void jabber_google_roster_outgoing(JabberStream *js, xmlnode *query, xmlnode *item)
 {
 	PurpleAccount *account = purple_connection_get_account(js->gc);
@@ -1153,7 +1126,7 @@
 
 	while (list) {
 		if (!strcmp(jid_norm, (char*)list->data)) {
-			xmlnode_set_attrib(query, "xmlns:gr", "google:roster");
+			xmlnode_set_attrib(query, "xmlns:gr", NS_GOOGLE_ROSTER);
 			xmlnode_set_attrib(query, "gr:ext", "2");
 			xmlnode_set_attrib(item, "gr:t", "B");
 			return;
@@ -1170,7 +1143,7 @@
 
 	char *jid_norm;
 
-	const char *grt = xmlnode_get_attrib_with_namespace(item, "t", "google:roster");
+	const char *grt = xmlnode_get_attrib_with_namespace(item, "t", NS_GOOGLE_ROSTER);
 	const char *subscription = xmlnode_get_attrib(item, "subscription");
 	const char *ask = xmlnode_get_attrib(item, "ask");
 
@@ -1255,7 +1228,7 @@
 	xmlnode_set_attrib(item, "jid", who);
 	xmlnode_set_attrib(item, "name", balias ? balias : "");
 	xmlnode_set_attrib(item, "gr:t", "B");
-	xmlnode_set_attrib(query, "xmlns:gr", "google:roster");
+	xmlnode_set_attrib(query, "xmlns:gr", NS_GOOGLE_ROSTER);
 	xmlnode_set_attrib(query, "gr:ext", "2");
 
 	jabber_iq_send(iq);
@@ -1314,7 +1287,7 @@
 	balias = purple_buddy_get_local_buddy_alias(b);
 	xmlnode_set_attrib(item, "jid", who);
 	xmlnode_set_attrib(item, "name", balias ? balias : "");
-	xmlnode_set_attrib(query, "xmlns:gr", "google:roster");
+	xmlnode_set_attrib(query, "xmlns:gr", NS_GOOGLE_ROSTER);
 	xmlnode_set_attrib(query, "gr:ext", "2");
 
 	jabber_iq_send(iq);
--- a/libpurple/protocols/jabber/google.h	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/jabber/google.h	Thu Dec 10 21:36:41 2009 +0000
@@ -32,7 +32,6 @@
 void jabber_gmail_poke(JabberStream *js, const char *from, JabberIqType type,
                        const char *id, xmlnode *new_mail);
 
-void jabber_google_roster_init(JabberStream *js);
 void jabber_google_roster_outgoing(JabberStream *js, xmlnode *query, xmlnode *item);
 
 /* Returns FALSE if this should short-circuit processing of this roster item, or TRUE
--- a/libpurple/protocols/jabber/libxmpp.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/jabber/libxmpp.c	Thu Dec 10 21:36:41 2009 +0000
@@ -295,7 +295,7 @@
 
 static gboolean xmpp_uri_handler(const char *proto, const char *user, GHashTable *params)
 {
-	char *acct_id = g_hash_table_lookup(params, "account");
+	char *acct_id = params ? g_hash_table_lookup(params, "account") : NULL;
 	PurpleAccount *acct;
 
 	if (g_ascii_strcasecmp(proto, "xmpp"))
@@ -307,7 +307,8 @@
 		return FALSE;
 
 	/* xmpp:romeo@montague.net?message;subject=Test%20Message;body=Here%27s%20a%20test%20message */
-	if (g_hash_table_lookup_extended(params, "message", NULL, NULL)) {
+	/* params is NULL if the URI has no '?' (or anything after it) */
+	if (!params || g_hash_table_lookup_extended(params, "message", NULL, NULL)) {
 		char *body = g_hash_table_lookup(params, "body");
 		if (user && *user) {
 			PurpleConversation *conv =
--- a/libpurple/protocols/jabber/namespaces.h	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/jabber/namespaces.h	Thu Dec 10 21:36:41 2009 +0000
@@ -95,6 +95,7 @@
 #define NS_GOOGLE_JINGLE_INFO "google:jingleinfo"
 
 #define NS_GOOGLE_MAIL_NOTIFY "google:mail:notify"
+#define NS_GOOGLE_ROSTER "google:roster"
 
 #define NS_GOOGLE_PROTOCOL_SESSION "http://www.google.com/xmpp/protocol/session"
 #define NS_GOOGLE_SESSION "http://www.google.com/session"
--- a/libpurple/protocols/jabber/roster.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/jabber/roster.c	Thu Dec 10 21:36:41 2009 +0000
@@ -77,18 +77,20 @@
 void jabber_roster_request(JabberStream *js)
 {
 	PurpleAccount *account;
-	const char *ver;
 	JabberIq *iq;
 	xmlnode *query;
 
 	account = purple_connection_get_account(js->gc);
-	ver = purple_account_get_string(account, "roster_ver", "");
 
 	iq = jabber_iq_new_query(js, JABBER_IQ_GET, "jabber:iq:roster");
 	query = xmlnode_get_child(iq->node, "query");
-	xmlnode_set_attrib(query, "ver", ver);
+
+	if (js->server_caps & JABBER_CAP_GOOGLE_ROSTER) {
+		xmlnode_set_attrib(query, "xmlns:gr", NS_GOOGLE_ROSTER);
+		xmlnode_set_attrib(query, "gr:ext", "2");
+	}
+
 	jabber_iq_set_callback(iq, roster_request_cb, NULL);
-
 	jabber_iq_send(iq);
 }
 
@@ -218,18 +220,18 @@
 			continue;
 
 		if(subscription) {
-			if (jb == js->user_jb)
+			if (g_str_equal(subscription, "remove"))
+				jb->subscription = JABBER_SUB_REMOVE;
+			else if (jb == js->user_jb)
 				jb->subscription = JABBER_SUB_BOTH;
-			else if(!strcmp(subscription, "none"))
+			else if (g_str_equal(subscription, "none"))
 				jb->subscription = JABBER_SUB_NONE;
-			else if(!strcmp(subscription, "to"))
+			else if (g_str_equal(subscription, "to"))
 				jb->subscription = JABBER_SUB_TO;
-			else if(!strcmp(subscription, "from"))
+			else if (g_str_equal(subscription, "from"))
 				jb->subscription = JABBER_SUB_FROM;
-			else if(!strcmp(subscription, "both"))
+			else if (g_str_equal(subscription, "both"))
 				jb->subscription = JABBER_SUB_BOTH;
-			else if(!strcmp(subscription, "remove"))
-				jb->subscription = JABBER_SUB_REMOVE;
 		}
 
 		if(purple_strequal(ask, "subscribe"))
@@ -334,7 +336,7 @@
 
 	if (js->server_caps & JABBER_CAP_GOOGLE_ROSTER) {
 		jabber_google_roster_outgoing(js, query, item);
-		xmlnode_set_attrib(query, "xmlns:gr", "google:roster");
+		xmlnode_set_attrib(query, "xmlns:gr", NS_GOOGLE_ROSTER);
 		xmlnode_set_attrib(query, "gr:ext", "2");
 	}
 	jabber_iq_send(iq);
--- a/libpurple/protocols/jabber/si.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/jabber/si.c	Thu Dec 10 21:36:41 2009 +0000
@@ -1448,7 +1448,7 @@
 	g_free(xfer->who);
 	xfer->who = who;
 
-	if (jbr) {
+	if (jbr && jabber_resource_know_capabilities(jbr)) {
 		char *msg;
 
 		if (jabber_resource_has_capability(jbr, NS_IBB))
--- a/libpurple/protocols/msn/userlist.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/msn/userlist.c	Thu Dec 10 21:36:41 2009 +0000
@@ -50,8 +50,11 @@
 	{
 		MsnSession *session = pa->gc->proto_data;
 		MsnUserList *userlist = session->userlist;
+		PurpleAccount *account = purple_connection_get_account(pa->gc);
 
 		msn_userlist_add_buddy_to_list(userlist, pa->who, MSN_LIST_AL);
+		purple_privacy_deny_remove(account, pa->who, TRUE);
+		purple_privacy_permit_add(account, pa->who, TRUE);
 
 		msn_del_contact_from_list(session, NULL, pa->who, MSN_LIST_PL);
 	}
--- a/libpurple/protocols/mxit/actions.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/actions.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,11 +23,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include	<stdio.h>
-#include	<stdlib.h>
-#include	<string.h>
-#include	<time.h>
-
+#include    "internal.h"
 #include	"purple.h"
 
 #include	"protocol.h"
--- a/libpurple/protocols/mxit/chunk.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/chunk.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,10 +23,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include	<stdio.h>
-#include	<unistd.h>
-#include	<string.h>
-
+#include    "internal.h"
 #include	"purple.h"
 #include	"protocol.h"
 #include	"mxit.h"
--- a/libpurple/protocols/mxit/cipher.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/cipher.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,10 +23,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include	<stdio.h>
-#include	<unistd.h>
-#include	<string.h>
-
+#include    "internal.h"
 #include	"purple.h"
 
 #include	"mxit.h"
--- a/libpurple/protocols/mxit/filexfer.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/filexfer.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,10 +23,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include	<stdio.h>
-#include	<unistd.h>
-#include	<string.h>
-
+#include    "internal.h"
 #include	"purple.h"
 #include	"protocol.h"
 #include	"mxit.h"
--- a/libpurple/protocols/mxit/formcmds.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/formcmds.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,8 +23,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include <string.h>
-#include <glib.h>
+
+#include "internal.h"
 #include <glib/gprintf.h>
 
 #include "purple.h"
--- a/libpurple/protocols/mxit/http.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/http.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,11 +23,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include	<stdio.h>
-#include	<unistd.h>
-#include	<string.h>
-#include	<errno.h>
-
+#include    "internal.h"
 #include	"purple.h"
 
 #include	"mxit.h"
--- a/libpurple/protocols/mxit/login.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/login.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,9 +23,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include	<stdio.h>
-#include	<string.h>
-
+#include    "internal.h"
 #include	"purple.h"
 
 #include	"protocol.h"
--- a/libpurple/protocols/mxit/markup.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/markup.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,10 +23,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include	<stdio.h>
-#include	<unistd.h>
-#include	<string.h>
-
+#include    "internal.h"
 #include	"purple.h"
 
 #include	"protocol.h"
--- a/libpurple/protocols/mxit/multimx.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/multimx.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,9 +23,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include <string.h>
-#include <errno.h>
-
+#include "internal.h"
 #include "purple.h"
 #include "prpl.h"
 
--- a/libpurple/protocols/mxit/mxit.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/mxit.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,10 +23,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include	<glib.h>
-#include	<stdio.h>
-#include	<string.h>
-
+#include    "internal.h"
 #include	"purple.h"
 #include	"notify.h"
 #include	"plugin.h"
--- a/libpurple/protocols/mxit/profile.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/profile.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,9 +23,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include	<ctype.h>
-#include	<string.h>
-
+#include    "internal.h"
 #include	"purple.h"
 
 #include	"mxit.h"
--- a/libpurple/protocols/mxit/protocol.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/protocol.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,11 +23,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include	<stdio.h>
-#include	<unistd.h>
-#include	<string.h>
-#include	<errno.h>
-
+#include    "internal.h"
 #include	"purple.h"
 
 #include	"protocol.h"
--- a/libpurple/protocols/mxit/roster.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/roster.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,10 +23,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include	<stdio.h>
-#include	<unistd.h>
-#include	<string.h>
-
+#include    "internal.h"
 #include	"purple.h"
 
 #include	"protocol.h"
--- a/libpurple/protocols/mxit/splashscreen.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/mxit/splashscreen.c	Thu Dec 10 21:36:41 2009 +0000
@@ -23,6 +23,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
+#include "internal.h"
 #include <glib/gstdio.h>
 
 #include "purple.h"
--- a/libpurple/protocols/oscar/clientlogin.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/oscar/clientlogin.c	Thu Dec 10 21:36:41 2009 +0000
@@ -36,12 +36,12 @@
  * http://dev.aol.com/authentication_for_clients
  */
 
+#include "oscar.h"
+#include "oscarcommon.h"
+
 #include "cipher.h"
 #include "core.h"
 
-#include "oscar.h"
-#include "oscarcommon.h"
-
 #define URL_CLIENT_LOGIN "https://api.screenname.aol.com/auth/clientLogin"
 #define URL_START_OSCAR_SESSION "http://api.oscar.aol.com/aim/startOSCARSession"
 
@@ -393,10 +393,6 @@
 			purple_connection_error_reason(gc,
 					PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
 					_("Incorrect password"));
-		} else if (status_code == 330 && status_detail_code == 3015) {
-			purple_connection_error_reason(gc,
-					PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
-					_("CAPTCHA requested. Logging into the AIM/ICQ website may fix this."));
 		} else if (status_code == 401 && status_detail_code == 3019) {
 			purple_connection_error_reason(gc,
 					PURPLE_CONNECTION_ERROR_OTHER_ERROR,
--- a/libpurple/protocols/oscar/family_auth.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/oscar/family_auth.c	Thu Dec 10 21:36:41 2009 +0000
@@ -26,12 +26,12 @@
  *
  */
 
+#include "oscar.h"
+
 #include <ctype.h>
 
 #include "cipher.h"
 
-#include "oscar.h"
-
 /* #define USE_XOR_FOR_ICQ */
 
 #ifdef USE_XOR_FOR_ICQ
--- a/libpurple/protocols/oscar/oscar.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Thu Dec 10 21:36:41 2009 +0000
@@ -3576,9 +3576,9 @@
 
 			purple_debug_misc("oscar",
 					"created room: %s %hu %hu %hu %u %hu %hu %hhu %hu %s %s\n",
-					fqcn, exchange, instance, flags, createtime,
+					fqcn ? fqcn : "(null)", exchange, instance, flags, createtime,
 					maxmsglen, maxoccupancy, createperms, unknown,
-					name, ck);
+					name ? name : "(null)", ck);
 			aim_chat_join(od, exchange, ck, instance);
 			}
 			break;
@@ -4650,7 +4650,7 @@
 	if ((conn != NULL) && (conn->ready))
 	{
 		/* If we're directly connected, send a direct IM */
-		purple_debug_info("oscar", "Sending direct IM with flags %i", imflags);
+		purple_debug_info("oscar", "Sending direct IM with flags %i\n", imflags);
 		purple_odc_send_im(conn, tmp1, imflags);
 	} else {
 		struct buddyinfo *bi;
--- a/libpurple/protocols/oscar/oscarcommon.h	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/oscar/oscarcommon.h	Thu Dec 10 21:36:41 2009 +0000
@@ -24,8 +24,9 @@
  * and libicq.c
  */
 
+#include "internal.h"
+
 #include "accountopt.h"
-#include "internal.h"
 #include "prpl.h"
 #include "version.h"
 #include "notify.h"
--- a/libpurple/protocols/yahoo/ycht.c	Sun Dec 06 19:06:42 2009 +0000
+++ b/libpurple/protocols/yahoo/ycht.c	Thu Dec 10 21:36:41 2009 +0000
@@ -25,8 +25,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#include <string.h>
-
 #include "internal.h"
 #include "prpl.h"
 #include "notify.h"
--- a/pidgin/win32/nsis/pidgin-installer.nsi	Sun Dec 06 19:06:42 2009 +0000
+++ b/pidgin/win32/nsis/pidgin-installer.nsi	Thu Dec 10 21:36:41 2009 +0000
@@ -191,6 +191,7 @@
   !insertmacro MUI_LANGUAGE "Hungarian"
   !insertmacro MUI_LANGUAGE "Dutch"
   !insertmacro MUI_LANGUAGE "Norwegian"
+  !insertmacro MUI_LANGUAGE "NorwegianNynorsk"
   !insertmacro MUI_LANGUAGE "Polish"
   !insertmacro MUI_LANGUAGE "PortugueseBR"
   !insertmacro MUI_LANGUAGE "Portuguese"
@@ -230,6 +231,7 @@
   !insertmacro PIDGIN_MACRO_INCLUDE_LANGFILE "KURDISH"		"${PIDGIN_NSIS_INCLUDE_PATH}\translations\kurdish.nsh"
   !insertmacro PIDGIN_MACRO_INCLUDE_LANGFILE "LITHUANIAN"	"${PIDGIN_NSIS_INCLUDE_PATH}\translations\lithuanian.nsh"
   !insertmacro PIDGIN_MACRO_INCLUDE_LANGFILE "NORWEGIAN"	"${PIDGIN_NSIS_INCLUDE_PATH}\translations\norwegian.nsh"
+  !insertmacro PIDGIN_MACRO_INCLUDE_LANGFILE "NORWEGIANNYNORSK"	"${PIDGIN_NSIS_INCLUDE_PATH}\translations\norwegian_nynorsk.nsh"
   !insertmacro PIDGIN_MACRO_INCLUDE_LANGFILE "POLISH"		"${PIDGIN_NSIS_INCLUDE_PATH}\translations\polish.nsh"
   !insertmacro PIDGIN_MACRO_INCLUDE_LANGFILE "PORTUGUESE"	"${PIDGIN_NSIS_INCLUDE_PATH}\translations\portuguese.nsh"
   !insertmacro PIDGIN_MACRO_INCLUDE_LANGFILE "PORTUGUESEBR"	"${PIDGIN_NSIS_INCLUDE_PATH}\translations\portuguese-br.nsh"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/win32/nsis/translations/norwegian_nynorsk.nsh	Thu Dec 10 21:36:41 2009 +0000
@@ -0,0 +1,80 @@
+;;
+;;  norwegian_nynorsk.nsh
+;;
+;;  Norwegian nynorsk language strings for the Windows Pidgin NSIS installer.
+;;  Windows Code page: 1252
+;;
+;;  Version 3
+
+; Startup Checks
+!define INSTALLER_IS_RUNNING			"Installasjonsprogrammet kjører allereie."
+!define PIDGIN_IS_RUNNING			"Pidgin kjører no. Lukk programmet og prøv igjen."
+!define GTK_INSTALLER_NEEDED			"GTK+-kjøremiljøet manglar eller treng å bli oppdatert.$\rInstaller v${GTK_MIN_VERSION} eller nyare av GTK+-kjøremiljøet"
+
+; License Page
+!define PIDGIN_LICENSE_BUTTON			"Neste >"
+!define PIDGIN_LICENSE_BOTTOM_TEXT		"$(^Name) blir utgjeve med ein GNU General Public License (GPL). Lisensen er berre gjeven her for opplysningsformål. $_CLICK"
+
+; Components Page
+!define PIDGIN_SECTION_TITLE			"Pidgin lynmeldingsklient (påkravd)"
+!define GTK_SECTION_TITLE			"GTK+-kjøremiljø (påkravd om det ikkje er til stades no)"
+!define PIDGIN_SHORTCUTS_SECTION_TITLE		"Snarvegar"
+!define PIDGIN_DESKTOP_SHORTCUT_SECTION_TITLE	"Skrivebordet"
+!define PIDGIN_STARTMENU_SHORTCUT_SECTION_TITLE	"Startmenyen"
+!define PIDGIN_SECTION_DESCRIPTION		"Pidgin programfiler og DLL-ar"
+!define GTK_SECTION_DESCRIPTION		"Ei grafisk brukargrensesnittverktøykasse på fleire plattformer som Pidgin nyttar"
+
+!define PIDGIN_SHORTCUTS_SECTION_DESCRIPTION	"Snarvegar for å starta Pidgin"
+!define PIDGIN_DESKTOP_SHORTCUT_DESC		"Lag ein snarveg til Pidgin på skrivebordet"
+!define PIDGIN_STARTMENU_SHORTCUT_DESC		"Lag ein snarveg til Pidgin på startmenyen"
+
+; GTK+ Directory Page
+!define GTK_UPGRADE_PROMPT			"Fann ei gammal utgåve av GTK+-kjøremiljøet. Vil du oppdatera ho?$\rMerk: $(^Name) vil kanskje ikkje fungera om du ikkje oppdaterer."
+!define GTK_WINDOWS_INCOMPATIBLE		"Windows 95/98/Me er ikkje kompatibelt med GTK+ 2.8.0 eller nyare. GTK+ ${GTK_INSTALL_VERSION} kjem ikkje til å bli installert.$\rInstallasjonen vil bli abvroten om ikkje GTK+ ${GTK_MIN_VERSION} eller nyare allereie er installert."
+
+; Installer Finish Page
+!define PIDGIN_FINISH_VISIT_WEB_SITE		"Besøk Pidgin si nettside"
+
+; Pidgin Section Prompts and Texts
+!define PIDGIN_PROMPT_CONTINUE_WITHOUT_UNINSTALL	"Klarte ikkje å avinstallera Pidgin-utgåva som er i bruk. Den nye utgåva kjem til å bli installert utan å ta vekk den gjeldande."
+
+; GTK+ Section Prompts
+!define GTK_INSTALL_ERROR			"Klarte ikkje å installera GTK+-kjøremiljøet."
+!define GTK_BAD_INSTALL_PATH			"Klarer ikkje å laga eller få tilgang til bana du skreiv."
+
+; URL Handler section
+!define URI_HANDLERS_SECTION_TITLE		"URI-referanse"
+
+; Uninstall Section Prompts
+!define un.PIDGIN_UNINSTALL_ERROR_1		"Avinstallasjonsprogrammet fann ikkje registerpostar for Pidgin.$\rTruleg har ein annan brukar installert denne applikasjonen."
+!define un.PIDGIN_UNINSTALL_ERROR_2		"Du har ikkje løyve til å kunna avinstallera denne applikasjonen."
+
+; Spellcheck Section Prompts
+!define PIDGIN_SPELLCHECK_SECTION_TITLE	"Stavekontrollhjelp"
+!define PIDGIN_SPELLCHECK_ERROR		"Klarte ikkje å installera stavekontrollen"
+!define PIDGIN_SPELLCHECK_DICT_ERROR		"Klarte ikkje å installera stavekontrollordlista"
+!define PIDGIN_SPELLCHECK_SECTION_DESCRIPTION	"Stavekontrollhjelp (treng internettsamband for å installera)."
+!define ASPELL_INSTALL_FAILED			"Installasjonen feila"
+!define PIDGIN_SPELLCHECK_BRETON		"Bretonsk"
+!define PIDGIN_SPELLCHECK_CATALAN		"Katalansk"
+!define PIDGIN_SPELLCHECK_CZECH		"Tsjekkisk"
+!define PIDGIN_SPELLCHECK_WELSH		"Walisisk"
+!define PIDGIN_SPELLCHECK_DANISH		"Dansk"
+!define PIDGIN_SPELLCHECK_GERMAN		"Tysk"
+!define PIDGIN_SPELLCHECK_GREEK		"Gresk"
+!define PIDGIN_SPELLCHECK_ENGLISH		"Engelsk"
+!define PIDGIN_SPELLCHECK_ESPERANTO		"Esperanto"
+!define PIDGIN_SPELLCHECK_SPANISH		"Spansk"
+!define PIDGIN_SPELLCHECK_FAROESE		"Færøysk"
+!define PIDGIN_SPELLCHECK_FRENCH		"Fransk"
+!define PIDGIN_SPELLCHECK_ITALIAN		"Italiensk"
+!define PIDGIN_SPELLCHECK_DUTCH		"Nederlandsk"
+!define PIDGIN_SPELLCHECK_NORWEGIAN		"Norsk"
+!define PIDGIN_SPELLCHECK_POLISH		"Polsk"
+!define PIDGIN_SPELLCHECK_PORTUGUESE		"Portugisisk"
+!define PIDGIN_SPELLCHECK_ROMANIAN		"Rumensk"
+!define PIDGIN_SPELLCHECK_RUSSIAN		"Russisk"
+!define PIDGIN_SPELLCHECK_SLOVAK		"Slovakisk"
+!define PIDGIN_SPELLCHECK_SWEDISH		"Svensk"
+!define PIDGIN_SPELLCHECK_UKRAINIAN		"Ukrainsk"
+
--- a/po/ChangeLog	Sun Dec 06 19:06:42 2009 +0000
+++ b/po/ChangeLog	Thu Dec 10 21:36:41 2009 +0000
@@ -1,6 +1,7 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
 version 2.6.5
+	* Norwegian Nynorsk win32 translation added (Yngve Spjeld Landro)
 	* Russian translation updated (Ðнтон Самохвалов)
 
 version 2.6.4