Fix user destination parsing in simp messaging
This commit fixes the parsing of message destinations such as "/user/anna/queue/foo", reverting a regression introduced by SPR-11506, which worked well with @SendToUser use cases but caused issues for messages sent to other users. Issue: SPR-12444
This commit is contained in:
@@ -150,9 +150,17 @@ public class DefaultUserDestinationResolver implements UserDestinationResolver {
|
||||
subscribeDestination = this.destinationPrefix.substring(0, startIndex-1) + destinationWithoutPrefix;
|
||||
user = destination.substring(startIndex, endIndex);
|
||||
user = StringUtils.replace(user, "%2F", "/");
|
||||
user = user.equals(sessionId) ? null : user;
|
||||
sessionIds = (sessionId != null ?
|
||||
Collections.singleton(sessionId) : this.userSessionRegistry.getSessionIds(user));
|
||||
|
||||
if(user.equals(sessionId)) {
|
||||
user = null;
|
||||
sessionIds = Collections.singleton(sessionId);
|
||||
}
|
||||
else if (this.userSessionRegistry.getSessionIds(user).contains(sessionId)) {
|
||||
sessionIds = Collections.singleton(sessionId);
|
||||
}
|
||||
else {
|
||||
sessionIds = this.userSessionRegistry.getSessionIds(user);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user