When a XMPP password protected room is already set up in a window, and the account is logged back in, Pidgin tries to log into the room without a password and fails with a "Not Authorized" error. Double-clicking on the room in the Buddy List will log into the room properly.

This bug seems to crop up on a specific set of criteria, but given that the situation happens often (at least for me), it is still annoying. I hiberate my laptop often and go on ×××, so it comes up every time the network is re-connected.

Steps to Reproduce (100% reproducible on my side):

1. Log into password-protected XMPP chat room.
2. Keep room window open.
3. Disable account or disconnect Internet connection
4. Enable account or re-connect Internet connection
5. Error occurs when Pidgin attempts to relog into room.

Relevant debug lines (with added line breaks):

(09:23:23) jabber: Sending (ssl) (sineswiper@foobar.com/spark): <presence to='secretroom@chat.foobar.com/sineswiper'>
<priority>1</priority><c xmlns='http://jabber.org/protocol/caps' node='http://pidgin.im/' hash='sha-1' 
ver='I22W7CegORwdbnu0ZiQwGpxr0Go='/><x xmlns='http://jabber.org/protocol/muc'/></presence>
(09:23:23) jabber: Recv (ssl)(393): <presence to="sineswiper@foobar.com/spark" 
from="secretroom@chat.foobar.com/sineswiper" type="error"><priority>1</priority><c xmlns="http://jabber.org/protocol/caps" 
node="http://pidgin.im/" hash="sha-1" ver="I22W7CegORwdbnu0ZiQwGpxr0Go="/><x xmlns="http://jabber.org
/protocol/muc"/><error code="401" type="auth"><not-authorized xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></presence>
...
(09:23:53) gtkconv: setting active conversation on toolbar 0A3EE998
(09:23:53) jabber: Sending (ssl) (sineswiper@foobar.com/spark): <presence to='secretroom@chat.foobar.com/sineswiper'>
<priority>1</priority><c xmlns='http://jabber.org/protocol/caps' node='http://pidgin.im/' hash='sha-1' 
ver='I22W7CegORwdbnu0ZiQwGpxr0Go='/><x xmlns='http://jabber.org/protocol/muc'><password>password</password></x></presence>
(09:23:53) jabber: Recv (ssl)(419): <presence to="sineswiper@foobar.com/spark" 
from="secretroom@chat.foobar.com/mrsadmin"><priority>1</priority><c xmlns="http://jabber.org/protocol/caps" node="http://pidgin.im/" 
hash="sha-1" ver="I22W7CegORwdbnu0ZiQwGpxr0Go="/><x xmlns="vcard-temp:x:update"><photo/></x><x xmlns="http://jabber.org/protocol
/muc#user"><item jid="mrsadmin@foobar.com/1d4c2a8e" affiliation="owner" role="moderator"/></x></presence>
(09:23:53) jabber: Sending (ssl) (sineswiper@foobar.com/spark): <iq type='get' id='purple93a1b4dc' to='secretroom@chat.foobar.com'><query 
xmlns='http://jabber.org/protocol/disco#info' node='http://jabber.org/protocol/muc#traffic'/></iq>
(09:23:53) jabber: Recv (ssl)(462): <presence to="sineswiper@foobar.com/spark" 
from="secretroom@chat.foobar.com/normaluser1"><priority>1</priority><query xmlns="jabber:iq:last" seconds="300"/><c 
xmlns="http://jabber.org/protocol/caps" node="http://pidgin.im/" hash="sha-1" ver="I22W7CegORwdbnu0ZiQwGpxr0Go="/><x xmlns="vcard-
temp:x:update"><photo/></x><x xmlns="http://jabber.org/protocol/muc#user"><item jid="normaluser1@foobar.com/spark" 
affiliation="none" role="participant"/></x></presence>
...

Note the difference between the two presence requests. The first one does not send out a password via XML, and the second one does (which was the manual double-click into the room). So, Pidgin is clearly not sending the password out when it should.