diff options
Diffstat (limited to 'juick-core/src/main/java/com/juick/xmpp/extensions')
-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 + ">"; |