Changeset - 23f8b4ef14f1
[Not reviewed]
0 1 0
HanzZ - 14 years ago 2011-12-08 23:19:09
hanzz.k@gmail.com
Fixed registration from Pidgin
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/userregistration.cpp
Show inline comments
 
@@ -277,24 +277,28 @@ bool UserRegistration::handleSetRequest(const Swift::JID& from, const Swift::JID
 
	Form::ref form = payload->getForm();
 
	if (form) {
 
		const std::vector<FormField::ref> fields = form->getFields();
 
		for (std::vector<FormField::ref>::const_iterator it = fields.begin(); it != fields.end(); it++) {
 
			TextSingleFormField::ref textSingle = boost::dynamic_pointer_cast<TextSingleFormField>(*it);
 
			if (textSingle) {
 
				if (textSingle->getName() == "username") {
 
					payload->setUsername(textSingle->getValue());
 
				}
 
				else if (textSingle->getName() == "encoding") {
 
					encoding = textSingle->getValue();
 
				}
 
				// Pidgin sends it as textSingle, not sure why...
 
				else if (textSingle->getName() == "password") {
 
					payload->setPassword(textSingle->getValue());
 
				}
 
				continue;
 
			}
 

	
 
			TextPrivateFormField::ref textPrivate = boost::dynamic_pointer_cast<TextPrivateFormField>(*it);
 
			if (textPrivate) {
 
				if (textPrivate->getName() == "password") {
 
					payload->setPassword(textPrivate->getValue());
 
				}
 
				continue;
 
			}
 

	
 
			ListSingleFormField::ref listSingle = boost::dynamic_pointer_cast<ListSingleFormField>(*it);
0 comments (0 inline, 0 general)