diff options
author | steckbrief <steckbrief@chefmail.de> | 2018-05-11 19:49:27 +0200 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2018-05-11 19:49:27 +0200 |
commit | bff97731deed4c599dcb6c3a2887c9f47165dd3f (patch) | |
tree | 1a1479be225fef127146f58d69f32a947c4d013e /src/main/java/de/thedevstack/conversationsplus/xml/Element.java | |
parent | 1d8c547b447d68daf079d9db2b1d792fc631e462 (diff) |
introduces JidUtil for Jid creation, fixes duplication of childs while adding childs with xmlns and name
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/xml/Element.java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/xml/Element.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/xml/Element.java b/src/main/java/de/thedevstack/conversationsplus/xml/Element.java index 95ed4c4e..ba37d6c0 100644 --- a/src/main/java/de/thedevstack/conversationsplus/xml/Element.java +++ b/src/main/java/de/thedevstack/conversationsplus/xml/Element.java @@ -8,6 +8,7 @@ import de.thedevstack.android.logcat.Logging; import de.thedevstack.conversationsplus.Config; import de.thedevstack.conversationsplus.xmpp.jid.InvalidJidException; import de.thedevstack.conversationsplus.xmpp.jid.Jid; +import de.thedevstack.conversationsplus.xmpp.jid.JidUtil; public class Element { private final String name; @@ -37,7 +38,6 @@ public class Element { public Element addChild(String name, String xmlns) { Element child = new Element(name); child.setAttribute("xmlns", xmlns); - children.add(child); return this.addChild(child); } @@ -47,7 +47,7 @@ public class Element { public Element setContent(String content) { this.content = content; - this.children.clear(); + this.clearChildren(); return this; } @@ -159,7 +159,7 @@ public class Element { final String jid = this.getAttribute(name); if (jid != null && !jid.isEmpty()) { try { - return Jid.fromString(jid); + return JidUtil.fromString(jid); } catch (final InvalidJidException e) { Logging.e(Config.LOGTAG, "could not parse jid " + jid); return null; |