aboutsummaryrefslogtreecommitdiff
path: root/juick-xmpp/src/main/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-02-08 17:03:54 +0300
committerGravatar Vitaly Takmazov2017-02-08 17:04:12 +0300
commit8a5a9ca0e668c96c8d048c295f8c6bf4a0935f01 (patch)
tree8c3d9c0c5b2cf4c7357ac221bde69befab813107 /juick-xmpp/src/main/java
parent643466552552b1da59038b1771ee15f227422d85 (diff)
juick-xmpp: fix StanzaError usage
Diffstat (limited to 'juick-xmpp/src/main/java')
-rw-r--r--juick-xmpp/src/main/java/com/juick/components/s2s/JuickBot.java9
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));
}