Don't request registration forms unless the register event is handled.

Some servers end the stream if registration can not be completed
in-band, which means always requesting the form can prevent regular
login.
This commit is contained in:
Lance Stout 2012-06-06 12:23:40 -07:00
parent e29a9e0394
commit db0e683d01

View file

@ -50,7 +50,7 @@ class XEP_0077(BasePlugin):
# We have already logged in with an account
return False
if self.create_account:
if self.create_account and self.xmpp.event_handled('register'):
form = self.get_registration()
self.xmpp.event('register', form, direct=True)
return True