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
62579465
Commit
62579465
authored
Oct 03, 2016
by
Dave Cridland
Committed by
GitHub
Oct 03, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #621 from sco0ter/changerole
OF-1146 Update presence after setting a MUC role.
parents
bc8ec015
3b10faa3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
LocalMUCRole.java
src/java/org/jivesoftware/openfire/muc/spi/LocalMUCRole.java
+14
-10
LocalMUCRoom.java
src/java/org/jivesoftware/openfire/muc/spi/LocalMUCRoom.java
+0
-2
No files found.
src/java/org/jivesoftware/openfire/muc/spi/LocalMUCRole.java
View file @
62579465
...
@@ -162,16 +162,7 @@ public class LocalMUCRole implements MUCRole {
...
@@ -162,16 +162,7 @@ public class LocalMUCRole implements MUCRole {
}
}
this
.
presence
=
newPresence
;
this
.
presence
=
newPresence
;
this
.
presence
.
setFrom
(
getRoleAddress
());
this
.
presence
.
setFrom
(
getRoleAddress
());
if
(
extendedInformation
!=
null
)
{
updatePresence
();
// Remove any previous extendedInformation, then re-add it.
Element
mucUser
=
presence
.
getElement
().
element
(
QName
.
get
(
"x"
,
"http://jabber.org/protocol/muc#user"
));
if
(
mucUser
!=
null
)
{
// Remove any previous extendedInformation, then re-add it.
presence
.
getElement
().
remove
(
mucUser
);
}
Element
exi
=
extendedInformation
.
createCopy
();
presence
.
getElement
().
add
(
exi
);
}
}
}
@Override
@Override
...
@@ -297,8 +288,21 @@ public class LocalMUCRole implements MUCRole {
...
@@ -297,8 +288,21 @@ public class LocalMUCRole implements MUCRole {
ElementUtil
.
setProperty
(
extendedInformation
,
"x.item:jid"
,
user
.
getAddress
().
toString
());
ElementUtil
.
setProperty
(
extendedInformation
,
"x.item:jid"
,
user
.
getAddress
().
toString
());
ElementUtil
.
setProperty
(
extendedInformation
,
"x.item:affiliation"
,
affiliation
.
toString
());
ElementUtil
.
setProperty
(
extendedInformation
,
"x.item:affiliation"
,
affiliation
.
toString
());
ElementUtil
.
setProperty
(
extendedInformation
,
"x.item:role"
,
role
.
toString
());
ElementUtil
.
setProperty
(
extendedInformation
,
"x.item:role"
,
role
.
toString
());
updatePresence
();
}
}
private
void
updatePresence
()
{
if
(
extendedInformation
!=
null
&&
presence
!=
null
)
{
// Remove any previous extendedInformation, then re-add it.
Element
mucUser
=
presence
.
getElement
().
element
(
QName
.
get
(
"x"
,
"http://jabber.org/protocol/muc#user"
));
if
(
mucUser
!=
null
)
{
// Remove any previous extendedInformation, then re-add it.
presence
.
getElement
().
remove
(
mucUser
);
}
Element
exi
=
extendedInformation
.
createCopy
();
presence
.
getElement
().
add
(
exi
);
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
...
...
src/java/org/jivesoftware/openfire/muc/spi/LocalMUCRoom.java
View file @
62579465
...
@@ -1393,8 +1393,6 @@ public class LocalMUCRoom implements MUCRoom, GroupEventListener {
...
@@ -1393,8 +1393,6 @@ public class LocalMUCRoom implements MUCRoom, GroupEventListener {
if
(
role
.
isLocal
())
{
if
(
role
.
isLocal
())
{
role
.
setAffiliation
(
newAffiliation
);
role
.
setAffiliation
(
newAffiliation
);
role
.
setRole
(
newRole
);
role
.
setRole
(
newRole
);
// Set the new presence, so that the updated affiliation and role is reflected in the presence stanza.
role
.
setPresence
(
role
.
getPresence
());
// Notify the other cluster nodes to update the occupant
// Notify the other cluster nodes to update the occupant
CacheFactory
.
doClusterTask
(
new
UpdateOccupant
(
this
,
role
));
CacheFactory
.
doClusterTask
(
new
UpdateOccupant
(
this
,
role
));
// Prepare a new presence to be sent to all the room occupants
// Prepare a new presence to be sent to all the room occupants
...
...
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