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
bdef6ba7
Commit
bdef6ba7
authored
Jan 05, 2016
by
Tom Evans
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #478 from tevans/OF-122
OF-122: MUC subject change policy
parents
a1c498cd
7ef6b4a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
HistoryStrategy.java
src/java/org/jivesoftware/openfire/muc/HistoryStrategy.java
+11
-2
No files found.
src/java/org/jivesoftware/openfire/muc/HistoryStrategy.java
View file @
bdef6ba7
...
...
@@ -29,6 +29,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
import
org.jivesoftware.openfire.muc.cluster.UpdateHistoryStrategy
;
import
org.jivesoftware.openfire.muc.spi.MUCPersistenceManager
;
import
org.jivesoftware.util.JiveGlobals
;
import
org.jivesoftware.util.cache.CacheFactory
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -334,12 +335,20 @@ public class HistoryStrategy {
// The subject is changed by sending a message of type "groupchat" to the <room@service>,
// where the <message/> MUST contain a <subject/> element that specifies the new subject
// but MUST NOT contain a <body/> element (or a <thread/> element).
// Unfortunately, many clients do not follow these strict guidelines from the specs, so we
// allow a lenient policy for detecting non-conforming subject change requests. This can be
// configured by setting the "xmpp.muc.subject.change.strict" property to false (true by default).
// An empty <subject/> value means that the room subject should be removed.
return
Message
.
Type
.
groupchat
==
message
.
getType
()
&&
message
.
getSubject
()
!=
null
&&
message
.
getBody
()
==
null
&&
message
.
getThread
()
==
null
;
(!
isSubjectChangeStrict
()
||
(
message
.
getBody
()
==
null
&&
message
.
getThread
()
==
null
));
}
private
boolean
isSubjectChangeStrict
()
{
return
JiveGlobals
.
getBooleanProperty
(
"xmpp.muc.subject.change.strict"
,
true
);
}
private
static
class
MessageComparator
implements
Comparator
<
Message
>
{
...
...
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