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
1da2506b
Commit
1da2506b
authored
Dec 21, 2016
by
Dave Cridland
Committed by
GitHub
Dec 21, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #713 from akrherz/of867
OF-867 Wrong key in groupMetaCache evict
parents
7aaf1b0f
508e39e2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
GroupManager.java
src/java/org/jivesoftware/openfire/group/GroupManager.java
+17
-14
No files found.
src/java/org/jivesoftware/openfire/group/GroupManager.java
View file @
1da2506b
...
...
@@ -174,9 +174,7 @@ public class GroupManager {
// Remove only the collection of groups the member belongs to.
String
member
=
(
String
)
params
.
get
(
"member"
);
if
(
member
!=
null
)
{
groupMetaCache
.
remove
(
member
);
}
evictCachedUserForGroup
(
member
);
}
@Override
...
...
@@ -187,9 +185,7 @@ public class GroupManager {
// Remove only the collection of groups the member belongs to.
String
member
=
(
String
)
params
.
get
(
"member"
);
if
(
member
!=
null
)
{
groupMetaCache
.
remove
(
member
);
}
evictCachedUserForGroup
(
member
);
}
@Override
...
...
@@ -200,9 +196,7 @@ public class GroupManager {
// Remove only the collection of groups the member belongs to.
String
member
=
(
String
)
params
.
get
(
"admin"
);
if
(
member
!=
null
)
{
groupMetaCache
.
remove
(
member
);
}
evictCachedUserForGroup
(
member
);
}
@Override
...
...
@@ -213,11 +207,20 @@ public class GroupManager {
// Remove only the collection of groups the member belongs to.
String
member
=
(
String
)
params
.
get
(
"admin"
);
if
(
member
!=
null
)
{
groupMetaCache
.
remove
(
member
);
}
evictCachedUserForGroup
(
member
);
}
private
void
evictCachedUserForGroup
(
String
user
)
{
if
(
user
!=
null
)
{
JID
userJid
=
new
JID
(
user
);
if
(
XMPPServer
.
getInstance
().
isLocal
(
userJid
))
{
String
username
=
userJid
.
getNode
();
synchronized
((
getClass
().
getSimpleName
()
+
username
).
intern
())
{
groupMetaCache
.
remove
(
username
);
}
}
}
}
});
UserEventDispatcher
.
addListener
(
new
UserEventListener
()
{
...
...
@@ -477,7 +480,7 @@ public class GroupManager {
public
Collection
<
Group
>
getSharedGroups
(
String
userName
)
{
Collection
<
String
>
groupNames
=
(
Collection
<
String
>)
groupMetaCache
.
get
(
userName
);
if
(
groupNames
==
null
)
{
synchronized
(
userName
.
intern
())
{
synchronized
(
(
getClass
().
getSimpleName
()
+
userName
)
.
intern
())
{
groupNames
=
(
Collection
<
String
>)
groupMetaCache
.
get
(
userName
);
if
(
groupNames
==
null
)
{
// assume this is a local user
...
...
@@ -586,7 +589,7 @@ public class GroupManager {
* @return all groups that an entity belongs to.
*/
public
Collection
<
Group
>
getGroups
(
JID
user
)
{
String
key
=
user
.
toBareJID
();
String
key
=
user
.
getNode
();
Collection
<
String
>
groupNames
=
(
Collection
<
String
>)
groupMetaCache
.
get
(
key
);
if
(
groupNames
==
null
)
{
...
...
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