aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-29 10:26:33 +0300
committerGravatar Vitaly Takmazov2018-03-29 10:26:33 +0300
commitd1ddcef27dac66dafe68e6cadc0806a3f20324fe (patch)
treef6ddaad3e31028098846e05664e6b7d2ea6bb685 /juick-server/src
parentad415109b1cc89de5bb632654fc7904c3dc755f4 (diff)
server: xmpp presence handler refactoring
Diffstat (limited to 'juick-server/src')
-rw-r--r--juick-server/src/main/java/com/juick/server/XMPPConnection.java15
1 files changed, 3 insertions, 12 deletions
diff --git a/juick-server/src/main/java/com/juick/server/XMPPConnection.java b/juick-server/src/main/java/com/juick/server/XMPPConnection.java
index e073913c..c246fdd6 100644
--- a/juick-server/src/main/java/com/juick/server/XMPPConnection.java
+++ b/juick-server/src/main/java/com/juick/server/XMPPConnection.java
@@ -493,7 +493,7 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
});
}
- public boolean incomingPresence(Presence p) {
+ private void incomingPresence(Presence p) {
final String username = p.getTo().getLocal();
final boolean toJuick = username.equals(jid.getLocal());
@@ -503,7 +503,6 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
reply.setTo(p.getFrom().asBareJid());
reply.setType(Presence.Type.UNSUBSCRIBE);
xmpp.sendOut(ClientPresence.from(reply));
- return true;
} else if (p.getType().equals(Presence.Type.PROBE)) {
int uid_to = 0;
if (!toJuick) {
@@ -527,9 +526,7 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
reply.setId(p.getId());
reply.setError(new StanzaError(StanzaError.Type.CANCEL, Condition.ITEM_NOT_FOUND));
xmpp.sendOut(ClientPresence.from(reply));
- return true;
}
- return true;
} else if (p.getType().equals(Presence.Type.SUBSCRIBE)) {
boolean canSubscribe = false;
if (toJuick) {
@@ -541,7 +538,6 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
canSubscribe = true;
}
}
-
if (canSubscribe) {
Presence reply = new Presence();
reply.setFrom(p.getTo());
@@ -553,8 +549,6 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
reply.setPriority((byte) 10);
reply.setType(null);
xmpp.sendOut(ClientPresence.from(reply));
-
- return true;
} else {
Presence reply = new Presence();
reply.setFrom(p.getTo());
@@ -563,7 +557,6 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
reply.setId(p.getId());
reply.setError(new StanzaError(StanzaError.Type.CANCEL, Condition.ITEM_NOT_FOUND));
xmpp.sendOut(ClientPresence.from(reply));
- return true;
}
} else if (p.getType().equals(Presence.Type.UNSUBSCRIBE)) {
if (!toJuick) {
@@ -579,8 +572,6 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
reply.setType(Presence.Type.UNSUBSCRIBED);
xmpp.sendOut(ClientPresence.from(reply));
}
-
- return false;
}
public boolean incomingMessage(Message msg) {
@@ -701,7 +692,7 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
}
}
- void broadcastPresence(Presence.Type type) {
+ private void broadcastPresence(Presence.Type type) {
Presence presence = new Presence();
presence.setFrom(jid);
if (type != null) {
@@ -725,7 +716,7 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
}
}
- public ExternalComponent getRouter() {
+ ExternalComponent getRouter() {
return router;
}
}