diff options
author | Vitaly Takmazov | 2016-07-12 17:39:33 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-07-12 17:39:33 +0300 |
commit | bdbf65e0a50758bfcc88e1cc9c501eeed4e7e45d (patch) | |
tree | 756e8b29b2442c82ae50a3548c772f4a65b6d1ef /juick-core/src/main/java/com/juick/xmpp | |
parent | 291da35b1bf7dcd66bf621160f907872fd0f7825 (diff) |
jackson-databind WIP
Diffstat (limited to 'juick-core/src/main/java/com/juick/xmpp')
-rw-r--r-- | juick-core/src/main/java/com/juick/xmpp/extensions/JuickMessage.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/juick-core/src/main/java/com/juick/xmpp/extensions/JuickMessage.java b/juick-core/src/main/java/com/juick/xmpp/extensions/JuickMessage.java index 510f7cc1..d259bc43 100644 --- a/juick-core/src/main/java/com/juick/xmpp/extensions/JuickMessage.java +++ b/juick-core/src/main/java/com/juick/xmpp/extensions/JuickMessage.java @@ -17,6 +17,7 @@ */ package com.juick.xmpp.extensions; +import com.juick.Tag; import com.juick.xmpp.utils.XmlUtils; import com.juick.xmpp.*; import java.io.IOException; @@ -95,7 +96,7 @@ public class JuickMessage extends com.juick.Message implements StanzaChild { } else if (tag.equals(JuickUser.TagName) && xmlns != null && xmlns.equals(JuickUser.XMLNS)) { jmsg.setUser(new JuickUser().parse(parser)); } else if (tag.equals("tag")) { - jmsg.Tags.add(XmlUtils.getTagText(parser)); + jmsg.Tags.add(new Tag(XmlUtils.getTagText(parser))); } else { XmlUtils.skip(parser); } @@ -137,10 +138,8 @@ public class JuickMessage extends com.juick.Message implements StanzaChild { if (getText() != null) { ret += "<body>" + XmlUtils.escape(getText()) + "</body>"; } - if (!Tags.isEmpty()) { - for (int i = 0; i < Tags.size(); i++) { - ret += "<tag>" + XmlUtils.escape(Tags.get(i)) + "</tag>"; - } + for (com.juick.Tag Tag : Tags) { + ret += "<tag>" + XmlUtils.escape(Tag.getName()) + "</tag>"; } ret += "</" + TagName + ">"; |