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
7d1e5df1
Commit
7d1e5df1
authored
Feb 10, 2016
by
Dave Cridland
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #536 from derekmcl/master
Cannot join room in a cluster after an availability update.
parents
3b42538c
1a5781c9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
14 deletions
+29
-14
LocalMUCRoom.java
src/java/org/jivesoftware/openfire/muc/spi/LocalMUCRoom.java
+29
-14
No files found.
src/java/org/jivesoftware/openfire/muc/spi/LocalMUCRoom.java
View file @
7d1e5df1
...
@@ -1869,19 +1869,34 @@ public class LocalMUCRoom implements MUCRoom, GroupEventListener {
...
@@ -1869,19 +1869,34 @@ public class LocalMUCRoom implements MUCRoom, GroupEventListener {
return
lockedTime
>
0
&&
creationDate
.
getTime
()
!=
lockedTime
;
return
lockedTime
>
0
&&
creationDate
.
getTime
()
!=
lockedTime
;
}
}
/**
* Handles occupants updating their presence in the chatroom. Assumes the user updates their presence whenever their
* availability in the room changes. This method should not be called to handle other presence related updates, such
* as nickname changes.
* {@inheritDoc}
*/
@Override
@Override
public
void
presenceUpdated
(
MUCRole
occupantRole
,
Presence
newPresence
)
{
public
void
presenceUpdated
(
final
MUCRole
occupantRole
,
final
Presence
newPresence
)
{
// Ask other cluster nodes to update the presence of the occupant
final
String
occupantNickName
=
occupantRole
.
getNickname
();
UpdatePresence
request
=
new
UpdatePresence
(
this
,
newPresence
.
createCopy
(),
occupantRole
.
getNickname
());
CacheFactory
.
doClusterTask
(
request
);
// Update the presence of the occupant
// Update the presence of the occupant on the local node with the occupant's new availability. Updates the
request
=
new
UpdatePresence
(
this
,
newPresence
.
createCopy
(),
occupantRole
.
getNickname
());
// local node first so the remote nodes receive presence that correctly reflects the occupant's new
request
.
setOriginator
(
true
);
// availability and previously existing role and affiliation with the room.
request
.
run
();
final
UpdatePresence
localUpdateRequest
=
new
UpdatePresence
(
this
,
newPresence
.
createCopy
(),
occupantNickName
);
localUpdateRequest
.
setOriginator
(
true
);
localUpdateRequest
.
run
();
// Broadcast new presence of occupant
// Get the new, updated presence for the occupant in the room. The presence reflects the occupant's updated
broadcastPresence
(
occupantRole
.
getPresence
().
createCopy
(),
false
);
// availability and their existing association.
final
Presence
updatedPresence
=
occupantRole
.
getPresence
().
createCopy
();
// Ask other cluster nodes to update the presence of the occupant. Uses the updated presence from the local
// MUC role.
final
UpdatePresence
clusterUpdateRequest
=
new
UpdatePresence
(
this
,
updatedPresence
,
occupantNickName
);
CacheFactory
.
doClusterTask
(
clusterUpdateRequest
);
// Broadcast updated presence of occupant.
broadcastPresence
(
updatedPresence
,
false
);
}
}
/**
/**
...
...
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