summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBob Jamison <ishmalius@gmail.com>2006-08-28 14:07:04 +0000
committerishmal <ishmal@users.sourceforge.net>2006-08-28 14:07:04 +0000
commit912004256da4c60631aa72c3c8fe315cd82a568f (patch)
tree9bb0e95c2d003ebc5c9d46e4b938a610531dd8c8 /src
parentrelax need for realm on md5 auth (diff)
downloadinkscape-912004256da4c60631aa72c3c8fe315cd82a568f.tar.gz
inkscape-912004256da4c60631aa72c3c8fe315cd82a568f.zip
allow either forms-based or older method of in-band registration
(bzr r1650)
Diffstat (limited to 'src')
-rw-r--r--src/pedro/pedroxmpp.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/pedro/pedroxmpp.cpp b/src/pedro/pedroxmpp.cpp
index b882b9ab9..398e6722b 100644
--- a/src/pedro/pedroxmpp.cpp
+++ b/src/pedro/pedroxmpp.cpp
@@ -1550,7 +1550,7 @@ bool XmppClient::inBandRegistrationNew()
Element *elem = parser.parse(recbuf);
//elem->print();
- //# does the entity send the "instructions" tag?
+ //# does the entity send the newer "instructions" tag?
std::vector<Element *> fields = elem->findElements("field");
std::vector<DOMString> fnames;
for (unsigned int i=0; i<fields.size() ; i++)
@@ -1562,14 +1562,20 @@ bool XmppClient::inBandRegistrationNew()
status("field name:%s", fname.c_str());
}
- delete elem;
-
+ //Do we have any fields?
if (fnames.size() == 0)
{
- error("server did not offer registration");
- return false;
+ //If no fields, maybe the older method was offered
+ if (elem->findElements("username").size() == 0 ||
+ elem->findElements("password").size() == 0)
+ {
+ error("server did not offer registration");
+ delete elem;
+ return false;
+ }
}
+ delete elem;
fmt =
"<iq type='set' id='regnew%d'>"