Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xwiki-platform
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XWiki
xwiki-platform
Commits
1ccbc2e7
Commit
1ccbc2e7
authored
9 years ago
by
Eduard Moraru
Browse files
Options
Downloads
Patches
Plain Diff
XWIKI-12490: Watchlist does not notify about events in Nested Spaces of a watched space
parent
d558a085
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xwiki-platform-core/xwiki-platform-watchlist/xwiki-platform-watchlist-api/src/main/java/org/xwiki/watchlist/internal/DefaultWatchListStore.java
+16
-1
16 additions, 1 deletion
...a/org/xwiki/watchlist/internal/DefaultWatchListStore.java
with
16 additions
and
1 deletion
xwiki-platform-core/xwiki-platform-watchlist/xwiki-platform-watchlist-api/src/main/java/org/xwiki/watchlist/internal/DefaultWatchListStore.java
+
16
−
1
View file @
1ccbc2e7
...
@@ -183,7 +183,22 @@ public boolean isWatched(String element, String user, WatchedElementType type) t
...
@@ -183,7 +183,22 @@ public boolean isWatched(String element, String user, WatchedElementType type) t
// TODO: Can this be optimized by a direct "exists" query on the list item? Would it e better than what we
// TODO: Can this be optimized by a direct "exists" query on the list item? Would it e better than what we
// currently have with the document cache? If we try a query, it would also need to be performed on the user's
// currently have with the document cache? If we try a query, it would also need to be performed on the user's
// wiki/database, not the current one.
// wiki/database, not the current one.
return
getWatchedElements
(
user
,
type
).
contains
(
element
);
Collection
<
String
>
watchedElements
=
getWatchedElements
(
user
,
type
);
if
(
WatchedElementType
.
SPACE
.
equals
(
type
))
{
// Special handling for Nested Spaces
for
(
String
watchedSpace
:
watchedElements
)
{
// Check if there is an exact match on the watched space or if the current space is nested inside a
// watched space.
String
watchedSpacePrefix
=
String
.
format
(
"%s."
,
watchedSpace
);
if
(
element
.
equals
(
watchedSpace
)
||
element
.
startsWith
(
watchedSpacePrefix
))
{
return
true
;
}
}
return
false
;
}
else
{
return
watchedElements
.
contains
(
element
);
}
}
}
@Override
@Override
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment