Commit e7ce159e authored by Daryl Herzmann's avatar Daryl Herzmann Committed by akrherz

allow users to see their own presence, refs OF-529


git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@12994 b35dd754-fafc-0310-a699-88a17e54d16e
parent b44b323b
......@@ -44,6 +44,11 @@
Presence Plugin Changelog
</h1>
<p><b>1.5.1</b> -- February 15, 2012</p>
<ul>
<li>[<a href='http://www.igniterealtime.org/issues/browse/OF-529'>OF-529</a>] - Allow users to see their own presence.</li>
</ul>
<p><b>1.5.0</b> -- December 2, 2009</p>
<ul>
<li>Now requires Openfire 3.7.0.</li>
......
......@@ -5,8 +5,8 @@
<name>Presence Service</name>
<description>Exposes presence information through HTTP.</description>
<author>Jive Software</author>
<version>1.5.0</version>
<date>12/2/2009</date>
<version>1.5.1</version>
<date>2/15/2012</date>
<minServerVersion>3.7.0</minServerVersion>
<adminconsole>
......
......@@ -194,6 +194,7 @@ public class PresencePlugin implements Plugin, Component {
throw new UserNotFoundException("Target JID not found in request");
}
JID targetJID = new JID(jid);
// Check that the sender is not requesting information of a remote server entity
if (targetJID.getDomain() == null || XMPPServer.getInstance().isRemote(targetJID)) {
throw new UserNotFoundException("Domain does not matches local server domain");
......@@ -236,8 +237,13 @@ public class PresencePlugin implements Plugin, Component {
if (sender == null) {
throw new UserNotFoundException("Sender is null");
}
else if (!presenceManager.canProbePresence(new JID(sender), targetJID.getNode())) {
throw new UserNotFoundException("Sender is not allowed to probe this user");
else {
// If sender is same as target, then we can see ourselves
JID senderJID = new JID(sender);
if (!senderJID.getNode().equals(targetJID.getNode()) &&
!presenceManager.canProbePresence(new JID(sender), targetJID.getNode())) {
throw new UserNotFoundException("Sender is not allowed to probe this user");
}
}
}
User user = userManager.getUser(targetJID.getNode());
......
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