diff options
author | Vitaly Takmazov | 2022-12-28 02:19:54 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2022-12-28 02:20:06 +0300 |
commit | 8cc6c06cb1202bca5f2475be095916b80fcd923c (patch) | |
tree | 9e7ab38c50aefb9225c4949ef6ad91efe701f159 /src/main/java/com/juick | |
parent | 70139f93ae18ae503f0f403bf12421cf5ca6dc86 (diff) |
XMPP: deactivate JIDs when the remote server is not found
Diffstat (limited to 'src/main/java/com/juick')
-rw-r--r-- | src/main/java/com/juick/XMPPManager.java | 7 |
1 files changed, 7 insertions, 0 deletions
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()); + } + } } } |