Commit a35afcb5 authored by sentient07's avatar sentient07 Committed by Dave Cridland

Presence probe for local user is not allowed when probee not subscribed

parent 0b73f1c2
...@@ -210,8 +210,17 @@ public class PresenceSubscribeHandler extends BasicModule implements ChannelHand ...@@ -210,8 +210,17 @@ public class PresenceSubscribeHandler extends BasicModule implements ChannelHand
// Send the presence of the local user to the remote user. The remote user // Send the presence of the local user to the remote user. The remote user
// subscribed to the presence of the local user and the local user accepted // subscribed to the presence of the local user and the local user accepted
JID prober = localServer.isLocal(recipientJID) ? recipientJID.asBareJID() : recipientJID; JID prober = localServer.isLocal(recipientJID) ? recipientJID.asBareJID() : recipientJID;
presenceManager.probePresence(prober, senderJID); if (presenceManager.canProbePresence(prober, senderJID.toString())){
PresenceEventDispatcher.subscribedToPresence(recipientJID, senderJID); presenceManager.probePresence(prober, senderJID);
PresenceEventDispatcher.subscribedToPresence(recipientJID, senderJID);
}
else {
Presence nonProbablePresence = new Presence();
nonProbablePresence.setStatus("unavailable");
nonProbablePresence.setFrom(senderJID);
nonProbablePresence.setTo(recipientJID);
presenceManager.handleProbe(nonProbablePresence);
}
} }
} }
...@@ -525,4 +534,4 @@ public class PresenceSubscribeHandler extends BasicModule implements ChannelHand ...@@ -525,4 +534,4 @@ public class PresenceSubscribeHandler extends BasicModule implements ChannelHand
rosterManager = server.getRosterManager(); rosterManager = server.getRosterManager();
userManager = server.getUserManager(); userManager = server.getUserManager();
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment