You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by ng...@apache.org on 2011/01/11 23:55:02 UTC

svn commit: r1057907 - /mina/vysper/trunk/server/core/src/main/java/org/apache/vysper/xmpp/modules/extension/xep0133_service_administration/command/ChangeUserPasswordCommandHandler.java

Author: ngn
Date: Tue Jan 11 22:55:02 2011
New Revision: 1057907

URL: http://svn.apache.org/viewvc?rev=1057907&view=rev
Log:
The type attribute on data form submissions is optional. Default and fallback

Modified:
    mina/vysper/trunk/server/core/src/main/java/org/apache/vysper/xmpp/modules/extension/xep0133_service_administration/command/ChangeUserPasswordCommandHandler.java

Modified: mina/vysper/trunk/server/core/src/main/java/org/apache/vysper/xmpp/modules/extension/xep0133_service_administration/command/ChangeUserPasswordCommandHandler.java
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/core/src/main/java/org/apache/vysper/xmpp/modules/extension/xep0133_service_administration/command/ChangeUserPasswordCommandHandler.java?rev=1057907&r1=1057906&r2=1057907&view=diff
==============================================================================
--- mina/vysper/trunk/server/core/src/main/java/org/apache/vysper/xmpp/modules/extension/xep0133_service_administration/command/ChangeUserPasswordCommandHandler.java (original)
+++ mina/vysper/trunk/server/core/src/main/java/org/apache/vysper/xmpp/modules/extension/xep0133_service_administration/command/ChangeUserPasswordCommandHandler.java Tue Jan 11 22:55:02 2011
@@ -3,6 +3,7 @@ package org.apache.vysper.xmpp.modules.e
 import org.apache.commons.lang.StringUtils;
 import org.apache.vysper.xml.fragment.XMLElement;
 import org.apache.vysper.xmpp.addressing.Entity;
+import org.apache.vysper.xmpp.addressing.EntityImpl;
 import org.apache.vysper.xmpp.authorization.AccountCreationException;
 import org.apache.vysper.xmpp.authorization.AccountManagement;
 import org.apache.vysper.xmpp.modules.extension.xep0050_adhoc_commands.AbstractAdhocCommandHandler;
@@ -57,7 +58,12 @@ public class ChangeUserPasswordCommandHa
         }
         final DataFormParser dataFormParser = new DataFormParser(commandElements.get(0));
         final Map<String,Object> valueMap = dataFormParser.extractFieldValues();
-        final Entity accountjid = (Entity)valueMap.get("accountjid");
+        final Entity accountjid;
+        if(valueMap.get("accountjid") instanceof Entity) {
+            accountjid = (Entity) valueMap.get("accountjid");
+        } else {
+            accountjid = EntityImpl.parseUnchecked((String) valueMap.get("accountjid"));
+        }
         final String password = (String)valueMap.get("password");
         final String password2 = (String)valueMap.get("password-verify");