diff options
Diffstat (limited to 'juick-xmpp/src/main/java/com/juick')
-rw-r--r-- | juick-xmpp/src/main/java/com/juick/components/JuickBot.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/juick-xmpp/src/main/java/com/juick/components/JuickBot.java b/juick-xmpp/src/main/java/com/juick/components/JuickBot.java index cefacb56..f79db78e 100644 --- a/juick-xmpp/src/main/java/com/juick/components/JuickBot.java +++ b/juick-xmpp/src/main/java/com/juick/components/JuickBot.java @@ -204,10 +204,20 @@ public class JuickBot implements StanzaListener, AutoCloseable { } public boolean incomingMessage(Message msg) { - if (StringUtils.isBlank(msg.getBody()) || (msg.getType() != null && msg.getType().equals(Message.Type.ERROR))) { + if (StringUtils.isBlank(msg.getBody())) { + return false; + } + if (msg.getType() != null && msg.getType().equals(Message.Type.ERROR)) { + StanzaError error = msg.getExtension(StanzaError.class); + if (error.getCondition().equals(Condition.RESOURCE_CONSTRAINT)) { + // offline query is full, deactivating this jid + if (userService.setActiveStatusForJID(msg.getFrom().toEscapedString(), UserService.ActiveStatus.Inactive)) { + logger.info("{} is inactive now", msg.getFrom()); + return true; + } + } return false; } - String username = msg.getTo().getLocal(); User user_from; |