# HG changeset patch
# Node ID 0bf9086d2410
# Parent  83144d32517f
diff --git a/libpurple/protocols/jabber/auth.c b/libpurple/protocols/jabber/auth.c
--- a/libpurple/protocols/jabber/auth.c
+++ b/libpurple/protocols/jabber/auth.c
@@ -343,9 +343,11 @@
 		} else if(purple_xmlnode_get_child(query, "password")) {
 			PurpleAccount *account = purple_connection_get_account(js->gc);
 			if(!jabber_stream_is_ssl(js) && !purple_account_get_bool(account,
-						"auth_plain_in_clear", FALSE)) {
+						"auth_plain_in_clear", FALSE))
+			{
+				PurpleContactInfo *info = PURPLE_CONTACT_INFO(account);
 				char *msg = g_strdup_printf(_("%s requires plaintext authentication over an unencrypted connection.  Allow this and continue authentication?"),
-											purple_account_get_username(account));
+											purple_contact_info_get_username(info));
 				purple_request_yes_no(js->gc, _("Plaintext Authentication"),
 						_("Plaintext Authentication"),
 						msg,
diff --git a/libpurple/protocols/jabber/auth_cyrus.c b/libpurple/protocols/jabber/auth_cyrus.c
--- a/libpurple/protocols/jabber/auth_cyrus.c
+++ b/libpurple/protocols/jabber/auth_cyrus.c
@@ -312,8 +312,9 @@
 				 */
 				/* XXX Should we just check for PLAIN/LOGIN being offered mechanisms? */
 				} else if (!plaintext) {
+					PurpleContactInfo *info = PURPLE_CONTACT_INFO(account);
 					char *msg = g_strdup_printf(_("%s may require plaintext authentication over an unencrypted connection.  Allow this and continue authentication?"),
-							purple_account_get_username(account));
+							purple_contact_info_get_username(info));
 					purple_request_yes_no(js->gc, _("Plaintext Authentication"),
 							_("Plaintext Authentication"),
 							msg,
diff --git a/libpurple/protocols/jabber/auth_plain.c b/libpurple/protocols/jabber/auth_plain.c
--- a/libpurple/protocols/jabber/auth_plain.c
+++ b/libpurple/protocols/jabber/auth_plain.c
@@ -78,6 +78,7 @@
                    PurpleXmlNode **response, G_GNUC_UNUSED char **error)
 {
 	PurpleAccount *account = purple_connection_get_account(js->gc);
+	PurpleContactInfo *info = PURPLE_CONTACT_INFO(account);
 	char *msg;
 
 	if (jabber_stream_is_ssl(js) || purple_account_get_bool(account, "auth_plain_in_clear", FALSE)) {
@@ -86,7 +87,7 @@
 	}
 
 	msg = g_strdup_printf(_("%s requires plaintext authentication over an unencrypted connection.  Allow this and continue authentication?"),
-			purple_account_get_username(account));
+			purple_contact_info_get_username(info));
 	purple_request_yes_no(js->gc, _("Plaintext Authentication"),
 			_("Plaintext Authentication"),
 			msg,
diff --git a/libpurple/protocols/jabber/buddy.c b/libpurple/protocols/jabber/buddy.c
--- a/libpurple/protocols/jabber/buddy.c
+++ b/libpurple/protocols/jabber/buddy.c
@@ -998,7 +998,11 @@
 
 	user_info = jbi->user_info;
 	account = purple_connection_get_account(js->gc);
-	bare_jid = jabber_get_bare_jid(from ? from : purple_account_get_username(account));
+
+	if(from == NULL) {
+		from = purple_contact_info_get_username(PURPLE_CONTACT_INFO(account));
+	}
+	bare_jid = jabber_get_bare_jid(from);
 
 	/* TODO: Is the query xmlns='vcard-temp' version of this still necessary? */
 	if((vcard = purple_xmlnode_get_child(packet, "vCard")) ||
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -444,8 +444,10 @@
 		}
 
 		username = purple_connection_get_display_name(gc);
-		if (!username)
-			username = purple_account_get_username(account);
+		if(username == NULL) {
+			PurpleContactInfo *info = PURPLE_CONTACT_INFO(account);
+			username = purple_contact_info_get_username(info);
+		}
 
 		purple_debug_misc("jabber", "Sending%s (%s): %s%s%s\n",
 				jabber_stream_is_ssl(js) ? " (ssl)" : "", username,
@@ -841,6 +843,7 @@
 jabber_stream_new(PurpleAccount *account)
 {
 	PurpleConnection *gc = purple_account_get_connection(account);
+	PurpleContactInfo *info = PURPLE_CONTACT_INFO(account);
 	GProxyResolver *resolver;
 	GError *error = NULL;
 	JabberStream *js;
@@ -866,7 +869,7 @@
 	/* we might want to expose this at some point */
 	js->cancellable = g_cancellable_new();
 
-	user = g_strdup(purple_account_get_username(account));
+	user = g_strdup(purple_contact_info_get_username(info));
 	/* jabber_id_new doesn't accept "user@domain/" as valid */
 	slash = strchr(user, '/');
 	if (slash && *(slash + 1) == '\0')
@@ -2619,7 +2622,7 @@
 		return PURPLE_CMD_RET_FAILED;
 
 	account = purple_connection_get_account(pc);
-	me = purple_account_get_name_for_display(account);
+	me = purple_contact_info_get_name_for_display(PURPLE_CONTACT_INFO(account));
 
 	who = g_strdup_printf("%s@%s/%s", chat->room, chat->server, args[0]);
 	pc = purple_conversation_get_connection(conv);
diff --git a/libpurple/protocols/jabber/presence.c b/libpurple/protocols/jabber/presence.c
--- a/libpurple/protocols/jabber/presence.c
+++ b/libpurple/protocols/jabber/presence.c
@@ -802,15 +802,19 @@
 	 */
 	im = purple_conversation_manager_find_im(manager, account, buddy_name);
 	if (im) {
-		purple_debug_info("jabber", "Changed conversation binding from %s to %s\n",
+		purple_debug_info("jabber", "Changed conversation binding from %s to %s",
 				purple_conversation_get_name(im), buddy_name);
 		purple_conversation_set_name(im, buddy_name);
 	}
 
 	if (b == NULL) {
 		if (presence->jb != js->user_jb) {
-			purple_debug_warning("jabber", "Got presence for unknown buddy %s on account %s (%p)\n",
-					buddy_name, purple_account_get_username(account), account);
+			PurpleContactInfo *info = PURPLE_CONTACT_INFO(account);
+			purple_debug_warning("jabber",
+			                     "Got presence for unknown buddy %s on account %s (%p)",
+			                     buddy_name,
+			                     purple_contact_info_get_username(info),
+			                     account);
 			g_free(buddy_name);
 			return FALSE;
 		} else {
