From 8cc6c06cb1202bca5f2475be095916b80fcd923c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 28 Dec 2022 02:19:54 +0300 Subject: XMPP: deactivate JIDs when the remote server is not found --- src/main/java/com/juick/XMPPManager.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main') diff --git a/src/main/java/com/juick/XMPPManager.java b/src/main/java/com/juick/XMPPManager.java index a334ecf9..624fe73a 100644 --- a/src/main/java/com/juick/XMPPManager.java +++ b/src/main/java/com/juick/XMPPManager.java @@ -542,6 +542,13 @@ public class XMPPManager implements NotificationListener { reply.setTo(p.getFrom()); reply.setType(Presence.Type.UNSUBSCRIBED); xmpp.send(ClientPresence.from(reply)); + } else if (p.getType().equals(Presence.Type.ERROR)) { + StanzaError error = p.getError(); + if (error != null && error.getCondition().equals(Condition.REMOTE_SERVER_NOT_FOUND)) { + if (userService.setActiveStatusForJID(p.getFrom().toEscapedString(), UserService.ActiveStatus.Inactive)) { + logger.info("{} is inactive now", p.getFrom()); + } + } } } -- cgit v1.2.3