Commit df9d2500 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Modified fix for JM-778

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/branches@4447 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8476b54f
...@@ -170,7 +170,8 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid ...@@ -170,7 +170,8 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid
currentRegistration.addElement("registered"); currentRegistration.addElement("registered");
currentRegistration.element("username").setText(user.getUsername()); currentRegistration.element("username").setText(user.getUsername());
currentRegistration.element("password").setText(""); currentRegistration.element("password").setText("");
currentRegistration.element("email").setText(user.getEmail()); currentRegistration.element("email")
.setText(user.getEmail() == null ? "" : user.getEmail());
currentRegistration.element("name").setText(user.getName()); currentRegistration.element("name").setText(user.getName());
Element form = currentRegistration.element(QName.get("x", "jabber:x:data")); Element form = currentRegistration.element(QName.get("x", "jabber:x:data"));
...@@ -185,7 +186,8 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid ...@@ -185,7 +186,8 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid
field.addElement("value").addText(user.getName()); field.addElement("value").addText(user.getName());
} }
else if ("email".equals(field.attributeValue("var"))) { else if ("email".equals(field.attributeValue("var"))) {
field.addElement("value").addText(user.getEmail()); field.addElement("value")
.addText(user.getEmail() == null ? "" : user.getEmail());
} }
} }
reply.setChildElement(currentRegistration); reply.setChildElement(currentRegistration);
......
...@@ -179,8 +179,13 @@ public class User implements Cacheable { ...@@ -179,8 +179,13 @@ public class User implements Cacheable {
} }
} }
/**
* Returns the email address of the user or <tt>null</tt> if none is defined.
*
* @return the email address of the user or nullif none is defined.
*/
public String getEmail() { public String getEmail() {
return email == null ? "" : email; return email;
} }
public void setEmail(String email) { public void setEmail(String email) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment