diff options
Diffstat (limited to 'juick-xmpp/src/main/java/com/juick/components/s2s')
-rw-r--r-- | juick-xmpp/src/main/java/com/juick/components/s2s/JuickBot.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/juick-xmpp/src/main/java/com/juick/components/s2s/JuickBot.java b/juick-xmpp/src/main/java/com/juick/components/s2s/JuickBot.java index af53af33..c0d5df81 100644 --- a/juick-xmpp/src/main/java/com/juick/components/s2s/JuickBot.java +++ b/juick-xmpp/src/main/java/com/juick/components/s2s/JuickBot.java @@ -99,8 +99,7 @@ public class JuickBot implements StanzaListener, AutoCloseable { reply.setTo(p.getFrom()); reply.setType(Presence.Type.ERROR); reply.setId(p.getId()); - StanzaError stanzaError = new StanzaError(StanzaError.Type.CANCEL, Condition.ITEM_NOT_FOUND); - reply.addExtension(stanzaError); + reply.setError(new StanzaError(StanzaError.Type.CANCEL, Condition.ITEM_NOT_FOUND)); xmpp.sendOut(ClientPresence.from(reply)); return true; } @@ -136,7 +135,7 @@ public class JuickBot implements StanzaListener, AutoCloseable { reply.setTo(p.getFrom()); reply.setType(Presence.Type.ERROR); reply.setId(p.getId()); - reply.addExtension(new StanzaError(StanzaError.Type.CANCEL, Condition.ITEM_NOT_FOUND)); + reply.setError(new StanzaError(StanzaError.Type.CANCEL, Condition.ITEM_NOT_FOUND)); xmpp.sendOut(ClientPresence.from(reply)); return true; } @@ -198,7 +197,7 @@ public class JuickBot implements StanzaListener, AutoCloseable { reply.setTo(msg.getFrom()); reply.setType(Message.Type.ERROR); reply.setId(msg.getId()); - reply.addExtension(new StanzaError(StanzaError.Type.CANCEL, Condition.ITEM_NOT_FOUND)); + reply.setError(new StanzaError(StanzaError.Type.CANCEL, Condition.ITEM_NOT_FOUND)); xmpp.sendOut(ClientMessage.from(reply)); return true; } @@ -244,7 +243,7 @@ public class JuickBot implements StanzaListener, AutoCloseable { reply.setTo(msg.getFrom()); reply.setType(Message.Type.ERROR); reply.setId(msg.getId()); - reply.addExtension(new StanzaError(StanzaError.Type.CANCEL, Condition.NOT_ALLOWED)); + reply.setError(new StanzaError(StanzaError.Type.CANCEL, Condition.NOT_ALLOWED)); xmpp.sendOut(ClientMessage.from(reply)); } |