Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
b77042e5
Commit
b77042e5
authored
Feb 03, 2015
by
Christian Schudt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-875 Roster requests to bare JID of the user are not responded
parent
9c69db39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
38 deletions
+7
-38
IQRosterHandler.java
...va/org/jivesoftware/openfire/handler/IQRosterHandler.java
+7
-38
No files found.
src/java/org/jivesoftware/openfire/handler/IQRosterHandler.java
View file @
b77042e5
...
...
@@ -110,19 +110,18 @@ public class IQRosterHandler extends IQHandler implements ServerFeaturesProvider
@Override
public
IQ
handleIQ
(
IQ
packet
)
throws
UnauthorizedException
,
PacketException
{
try
{
IQ
returnPacket
=
null
;
IQ
returnPacket
;
org
.
xmpp
.
packet
.
Roster
roster
=
(
org
.
xmpp
.
packet
.
Roster
)
packet
;
JID
recipientJID
=
packet
.
getTo
();
// The packet is bound for the server and must be roster management
if
(
recipientJID
==
null
||
recipientJID
.
getNode
()
==
null
||
!
UserManager
.
getInstance
().
isRegisteredUser
(
recipientJID
.
getNode
()))
{
if
(
recipientJID
==
null
||
recipientJID
.
equals
(
packet
.
getFrom
().
asBareJID
()))
{
returnPacket
=
manageRoster
(
roster
);
}
// The packet must be a roster removal from a foreign domain user.
else
{
re
moveRosterItem
(
roster
);
}
else
{
returnPacket
=
IQ
.
createResultIQ
(
packet
);
returnPacket
.
setChildElement
(
packet
.
getChildElement
().
createCopy
());
re
turnPacket
.
setError
(
PacketError
.
Condition
.
service_unavailable
);
}
return
returnPacket
;
}
...
...
@@ -150,37 +149,6 @@ public class IQRosterHandler extends IQHandler implements ServerFeaturesProvider
}
}
/**
* Remove a roster item. At this stage, this is recipient who has received
* a roster update. We must check that it is a removal, and if so, remove
* the roster item based on the sender's id rather than what is in the item
* listing itself.
*
* @param packet The packet suspected of containing a roster removal
*/
private
void
removeRosterItem
(
org
.
xmpp
.
packet
.
Roster
packet
)
throws
UnauthorizedException
,
SharedGroupException
{
JID
recipientJID
=
packet
.
getTo
();
JID
senderJID
=
packet
.
getFrom
();
try
{
for
(
org
.
xmpp
.
packet
.
Roster
.
Item
packetItem
:
packet
.
getItems
())
{
if
(
packetItem
.
getSubscription
()
==
org
.
xmpp
.
packet
.
Roster
.
Subscription
.
remove
)
{
Roster
roster
=
userManager
.
getUser
(
recipientJID
.
getNode
()).
getRoster
();
RosterItem
item
=
roster
.
getRosterItem
(
senderJID
);
roster
.
deleteRosterItem
(
senderJID
,
true
);
item
.
setSubStatus
(
RosterItem
.
SUB_REMOVE
);
item
.
setSubStatus
(
RosterItem
.
SUB_NONE
);
Packet
itemPacket
=
packet
.
createCopy
();
sessionManager
.
userBroadcast
(
recipientJID
.
getNode
(),
itemPacket
);
}
}
}
catch
(
UserNotFoundException
e
)
{
throw
new
UnauthorizedException
(
e
);
}
}
/**
* The packet is a typical 'set' or 'get' update targeted at the server.
* Notice that the set could be a roster removal in which case we have to
...
...
@@ -333,6 +301,7 @@ public class IQRosterHandler extends IQHandler implements ServerFeaturesProvider
return
info
;
}
@Override
public
Iterator
<
String
>
getFeatures
()
{
ArrayList
<
String
>
features
=
new
ArrayList
<
String
>();
features
.
add
(
"jabber:iq:roster"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment