Index: configure
===================================================================
--- configure	(revision e11216ce7cfdd8092e724e824b04f2bee0a7e41b)
+++ configure	(revision d567b58a869e9e7c6a39332da50c2b2be067d23f)
@@ -51,6 +51,6 @@
 pie=1
 
-arch=$(uname -s)
-cpu=$(uname -m)
+arch=`uname -s`
+cpu=`uname -m`
 
 GLIB_MIN_VERSION=2.16
@@ -103,5 +103,5 @@
 
 while [ -n "$1" ]; do
-	e="$(expr "X$1" : 'X--\(.*=.*\)')"
+	e="`expr "X$1" : 'X--\(.*=.*\)'`"
 	if [ -z "$e" ]; then
 		cat<<EOF
@@ -157,17 +157,17 @@
 
 # Expand $prefix and get rid of double slashes
-bindir=$(eval echo "$bindir/" | sed 's/\/\{1,\}/\//g')
-sbindir=$(eval echo "$sbindir/" | sed 's/\/\{1,\}/\//g')
-etcdir=$(eval echo "$etcdir/" | sed 's/\/\{1,\}/\//g')
-mandir=$(eval echo "$mandir/" | sed 's/\/\{1,\}/\//g')
-datadir=$(eval echo "$datadir/" | sed 's/\/\{1,\}/\//g')
-config=$(eval echo "$config/" | sed 's/\/\{1,\}/\//g')
-plugindir=$(eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g')
-includedir=$(eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g')
-libevent=$(eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g')
-
-pidfile=$(eval echo "$pidfile" | sed 's/\/\{1,\}/\//g')
-ipcsocket=$(eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g')
-pcdir=$(eval echo "$pcdir" | sed 's/\/\{1,\}/\//g')
+bindir=`eval echo "$bindir/" | sed 's/\/\{1,\}/\//g'`
+sbindir=`eval echo "$sbindir/" | sed 's/\/\{1,\}/\//g'`
+etcdir=`eval echo "$etcdir/" | sed 's/\/\{1,\}/\//g'`
+mandir=`eval echo "$mandir/" | sed 's/\/\{1,\}/\//g'`
+datadir=`eval echo "$datadir/" | sed 's/\/\{1,\}/\//g'`
+config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'`
+plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'`
+includedir=`eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g'`
+libevent=`eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g'`
+
+pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'`
+ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'`
+pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'`
 
 protocols_mods=""
@@ -308,10 +308,10 @@
 	if $PKG_CONFIG glib-2.0 --atleast-version=$GLIB_MIN_VERSION; then
 		cat<<EOF >>Makefile.settings
-EFLAGS+=$($PKG_CONFIG --libs glib-2.0 gmodule-2.0)
-CFLAGS+=$($PKG_CONFIG --cflags glib-2.0 gmodule-2.0)
+EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0`
+CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0`
 EOF
 	else
 		echo
-		echo 'Found glib2 '$($PKG_CONFIG glib-2.0 --modversion)', but version '$GLIB_MIN_VERSION' or newer is required.'
+		echo 'Found glib2 '`$PKG_CONFIG glib-2.0 --modversion`', but version '$GLIB_MIN_VERSION' or newer is required.'
 		exit 1
 	fi
@@ -349,6 +349,6 @@
 	if $PKG_CONFIG --exists gnutls; then
 		cat <<EOF >>Makefile.settings
-EFLAGS+=$($PKG_CONFIG --libs gnutls) $(libgcrypt-config --libs)
-CFLAGS+=$($PKG_CONFIG --cflags gnutls) $(libgcrypt-config --cflags)
+EFLAGS+=`$PKG_CONFIG --libs gnutls` `libgcrypt-config --libs`
+CFLAGS+=`$PKG_CONFIG --cflags gnutls` `libgcrypt-config --cflags`
 EOF
 		ssl=gnutls
@@ -360,6 +360,6 @@
 	elif libgnutls-config --version > /dev/null 2> /dev/null; then
 		cat <<EOF >>Makefile.settings
-EFLAGS+=$(libgnutls-config --libs) $(libgcrypt-config --libs)
-CFLAGS+=$(libgnutls-config --cflags) $(libgcrypt-config --cflags)
+EFLAGS+=`libgnutls-config --libs` `libgcrypt-config --libs`
+CFLAGS+=`libgnutls-config --cflags` `libgcrypt-config --cflags`
 EOF
 		
@@ -375,6 +375,6 @@
 	if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG nss; then
 		cat<<EOF >>Makefile.settings
-EFLAGS+=$($PKG_CONFIG --libs nss)
-CFLAGS+=$($PKG_CONFIG --cflags nss)
+EFLAGS+=`$PKG_CONFIG --libs nss`
+CFLAGS+=`$PKG_CONFIG --cflags nss`
 EOF
 		
@@ -621,5 +621,5 @@
 if [ -z "$systemdsystemunitdir" ]; then
 	if $PKG_CONFIG --exists systemd; then
-		systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
+		systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
 	fi
 fi
Index: doc/user-guide/commands.xml
===================================================================
--- doc/user-guide/commands.xml	(revision e11216ce7cfdd8092e724e824b04f2bee0a7e41b)
+++ doc/user-guide/commands.xml	(revision d567b58a869e9e7c6a39332da50c2b2be067d23f)
@@ -1186,19 +1186,4 @@
 	</bitlbee-setting>
 
-	<bitlbee-setting name="anonymous" type="boolean" scope="account">
-		<default>false</default>
-
-		<description>
-			<para>
-				This enables SASL ANONYMOUS login for jabber accounts, as specified by XEP-0175.
-			</para>
-
-			<para>
-				With this setting enabled, if the server allows this method, a password isn't required and the username part of the JID is ignored (you can use anonymous@jabber.example.com). Servers will usually assign you a random numeric username instead.
-			</para>
-		</description>
-
-	</bitlbee-setting>
-
 	<bitlbee-setting name="ops" type="string" scope="global">
 		<default>both</default>
Index: irc_channel.c
===================================================================
--- irc_channel.c	(revision e11216ce7cfdd8092e724e824b04f2bee0a7e41b)
+++ irc_channel.c	(revision d567b58a869e9e7c6a39332da50c2b2be067d23f)
@@ -445,8 +445,8 @@
 			char *acc_s;
 
-			if (!aj && !(ic->flags & IRC_CHANNEL_JOINED)) {
-				/* Only proceed if this one's marked as auto_join
-				   or if we're in it already. (Very likely the IRC
-				   client auto-(re)joining at reconnect time.) */
+			if (!aj || (ic->flags & IRC_CHANNEL_JOINED)) {
+				/* Only continue if this one's marked as auto_join
+				   or if we're in it already. (Possible if the
+				   client auto-rejoined it before identyfing.) */
 				continue;
 			} else if (!(acc_s = set_getstr(&ic->set, "account"))) {
Index: irc_im.c
===================================================================
--- irc_im.c	(revision e11216ce7cfdd8092e724e824b04f2bee0a7e41b)
+++ irc_im.c	(revision d567b58a869e9e7c6a39332da50c2b2be067d23f)
@@ -836,6 +836,5 @@
 	    (room = set_getstr(&ic->set, "room")) &&
 	    (acc = account_get(ic->irc->b, acc_s)) &&
-	    acc->ic && (acc->ic->flags & OPT_LOGGED_IN) &&
-	    acc->prpl->chat_join) {
+	    acc->ic && acc->prpl->chat_join) {
 		char *nick;
 
Index: lib/json.c
===================================================================
--- lib/json.c	(revision e11216ce7cfdd8092e724e824b04f2bee0a7e41b)
+++ lib/json.c	(revision d567b58a869e9e7c6a39332da50c2b2be067d23f)
@@ -509,5 +509,5 @@
 				case ']':
 
-					if (top && top->type == json_array) {
+					if (top->type == json_array) {
 						flags = (flags & ~(flag_need_comma | flag_seek_value)) | flag_next;
 					} else {              sprintf(error, "%d:%d: Unexpected ]", cur_line, e_off);
Index: protocols/jabber/jabber.c
===================================================================
--- protocols/jabber/jabber.c	(revision e11216ce7cfdd8092e724e824b04f2bee0a7e41b)
+++ protocols/jabber/jabber.c	(revision d567b58a869e9e7c6a39332da50c2b2be067d23f)
@@ -85,8 +85,5 @@
 		set_setstr(&acc->set, "server", "chat.hipchat.com");
 	} else {
-		set_add(&acc->set, "oauth", "false", set_eval_oauth, acc);
-
-		/* this reuses set_eval_oauth, which clears the password */
-		set_add(&acc->set, "anonymous", "false", set_eval_oauth, acc);
+		s = set_add(&acc->set, "oauth", "false", set_eval_oauth, acc);
 	}
 
Index: protocols/jabber/s5bytestream.c
===================================================================
--- protocols/jabber/s5bytestream.c	(revision e11216ce7cfdd8092e724e824b04f2bee0a7e41b)
+++ protocols/jabber/s5bytestream.c	(revision d567b58a869e9e7c6a39332da50c2b2be067d23f)
@@ -85,5 +85,5 @@
 		return jabber_bs_abort(bt, msg ": %s", strerror(errno)); }
 
-gboolean jabber_bs_abort(struct bs_transfer *bt, char *format, ...) G_GNUC_PRINTF(2, 3);
+gboolean jabber_bs_abort(struct bs_transfer *bt, char *format, ...);
 void jabber_bs_canceled(file_transfer_t *ft, char *reason);
 void jabber_bs_free_transfer(file_transfer_t *ft);
Index: protocols/jabber/sasl.c
===================================================================
--- protocols/jabber/sasl.c	(revision e11216ce7cfdd8092e724e824b04f2bee0a7e41b)
+++ protocols/jabber/sasl.c	(revision d567b58a869e9e7c6a39332da50c2b2be067d23f)
@@ -54,6 +54,6 @@
 	struct xt_node *c, *reply;
 	char *s;
-	int sup_plain = 0, sup_digest = 0, sup_gtalk = 0, sup_fb = 0, sup_anonymous = 0;
-	int want_oauth = FALSE, want_hipchat = FALSE, want_anonymous = FALSE;
+	int sup_plain = 0, sup_digest = 0, sup_gtalk = 0, sup_fb = 0;
+	int want_oauth = FALSE, want_hipchat = FALSE;
 	GString *mechs;
 
@@ -74,5 +74,4 @@
 	}
 
-	want_anonymous = set_getbool(&ic->acc->set, "anonymous");
 	want_oauth = set_getbool(&ic->acc->set, "oauth");
 	want_hipchat = (jd->flags & JFLAG_HIPCHAT);
@@ -85,6 +84,4 @@
 		} else if (c->text && g_strcasecmp(c->text, "DIGEST-MD5") == 0) {
 			sup_digest = 1;
-		} else if (c->text && g_strcasecmp(c->text, "ANONYMOUS") == 0) {
-			sup_anonymous = 1;
 		} else if (c->text && g_strcasecmp(c->text, "X-OAUTH2") == 0) {
 			sup_gtalk = 1;
@@ -145,18 +142,5 @@
 		xt_free_node(reply);
 		return XT_ABORT;
-	} else if (want_anonymous && sup_anonymous) {
-		xt_add_attr(reply, "mechanism", "ANONYMOUS");
-
-		/* Well, that was easy. */
-	} else if (want_anonymous) {
-		imcb_error(ic, "Anonymous login requested, but not supported by server");
-		imc_logout(ic, FALSE);
-		xt_free_node(reply);
-		return XT_ABORT;
-	} else if (sup_digest && !(jd->ssl && sup_plain)) {
-		/* Only try DIGEST-MD5 if there's no SSL/TLS or if PLAIN isn't supported.
-		 * Which in practice means "don't bother with DIGEST-MD5 most of the time".
-		 * It's weak, pointless over TLS, and often breaks with some servers (hi openfire) */
-
+	} else if (sup_digest) {
 		xt_add_attr(reply, "mechanism", "DIGEST-MD5");
 
