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
c6abe791
Commit
c6abe791
authored
Dec 01, 2016
by
daryl herzmann
Committed by
GitHub
Dec 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "add possibility to store complete stanza in archive" (#687)
parent
8a3806f0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
34 deletions
+7
-34
monitoring_i18n.properties
src/plugins/monitoring/src/i18n/monitoring_i18n.properties
+0
-1
ConversationEvent.java
.../org/jivesoftware/openfire/archive/ConversationEvent.java
+2
-4
ConversationManager.java
...rg/jivesoftware/openfire/archive/ConversationManager.java
+3
-20
GroupConversationInterceptor.java
...ftware/openfire/archive/GroupConversationInterceptor.java
+2
-2
archiving-settings.jsp
src/plugins/monitoring/src/web/archiving-settings.jsp
+0
-7
No files found.
src/plugins/monitoring/src/i18n/monitoring_i18n.properties
View file @
c6abe791
...
...
@@ -95,7 +95,6 @@ archive.settings.rebuild = Rebuild Index
archive.settings.any
=
Any
archive.settings.one_to_one
=
Archive one-to-one chats
archive.settings.group_chats
=
Archive group chats
archive.settings.group_chats.stanzas
=
Archive stanzas for group chats
archive.settings.certain_rooms
=
Only archive conversations of the following room names (separated by comma)
archive.search.title
=
Search Archive
...
...
src/plugins/monitoring/src/java/org/jivesoftware/openfire/archive/ConversationEvent.java
View file @
c6abe791
...
...
@@ -40,7 +40,6 @@ public class ConversationEvent implements Externalizable {
private
Type
type
;
private
Date
date
;
private
String
body
;
private
String
stanza
;
private
JID
sender
;
private
JID
receiver
;
...
...
@@ -78,7 +77,7 @@ public class ConversationEvent implements Externalizable {
conversationManager
.
joinedGroupConversation
(
roomJID
,
user
,
nickname
,
new
Date
(
date
.
getTime
()
+
1
));
}
else
if
(
Type
.
roomMessageReceived
==
type
)
{
conversationManager
.
processRoomMessage
(
roomJID
,
user
,
nickname
,
body
,
stanza
,
date
);
conversationManager
.
processRoomMessage
(
roomJID
,
user
,
nickname
,
body
,
date
);
}
}
...
...
@@ -186,14 +185,13 @@ public class ConversationEvent implements Externalizable {
}
public
static
ConversationEvent
roomMessageReceived
(
JID
roomJID
,
JID
user
,
String
nickname
,
String
body
,
String
stanza
,
Date
date
)
{
Date
date
)
{
ConversationEvent
event
=
new
ConversationEvent
();
event
.
type
=
Type
.
roomMessageReceived
;
event
.
roomJID
=
roomJID
;
event
.
user
=
user
;
event
.
nickname
=
nickname
;
event
.
body
=
body
;
event
.
stanza
=
stanza
;
event
.
date
=
date
;
return
event
;
}
...
...
src/plugins/monitoring/src/java/org/jivesoftware/openfire/archive/ConversationManager.java
View file @
c6abe791
...
...
@@ -115,7 +115,6 @@ public class ConversationManager implements Startable, ComponentEventListener{
* Flag that indicates if messages of group chats (in MUC rooms) should be archived.
*/
private
boolean
roomArchivingEnabled
;
private
boolean
roomArchivingStanzasEnabled
;
/**
* List of room names to archive. When list is empty then all rooms are archived (if roomArchivingEnabled is enabled).
*/
...
...
@@ -163,7 +162,6 @@ public class ConversationManager implements Startable, ComponentEventListener{
metadataArchivingEnabled
=
true
;
}
roomArchivingEnabled
=
JiveGlobals
.
getBooleanProperty
(
"conversation.roomArchiving"
,
false
);
roomArchivingStanzasEnabled
=
JiveGlobals
.
getBooleanProperty
(
"conversation.roomArchivingStanzas"
,
false
);
roomsArchived
=
StringUtils
.
stringToCollection
(
JiveGlobals
.
getProperty
(
"conversation.roomsArchived"
,
""
));
if
(
roomArchivingEnabled
&&
!
metadataArchivingEnabled
)
{
Log
.
warn
(
"Metadata archiving must be enabled when room archiving is enabled. Overriding setting."
);
...
...
@@ -393,11 +391,6 @@ public class ConversationManager implements Startable, ComponentEventListener{
return
roomArchivingEnabled
;
}
public
boolean
isRoomArchivingStanzasEnabled
()
{
return
roomArchivingStanzasEnabled
;
}
/**
* Sets whether message archiving is enabled for group chats. When enabled, all messages in group conversations are stored in the database unless
* a list of rooms was specified in {@link #getRoomsArchived()} . Note: it's not possible for meta-data archiving to be disabled when room
...
...
@@ -414,12 +407,7 @@ public class ConversationManager implements Startable, ComponentEventListener{
this
.
metadataArchivingEnabled
=
true
;
}
}
public
void
setRoomArchivingStanzasEnabled
(
boolean
enabled
)
{
this
.
roomArchivingStanzasEnabled
=
enabled
;
JiveGlobals
.
setProperty
(
"conversation.roomArchivingStanzas"
,
Boolean
.
toString
(
enabled
));
// Force metadata archiving enabled.
}
/**
* Returns list of room names whose messages will be archived. When room archiving is enabled and this list is empty then messages of all local
* rooms will be archived. However, when name of rooms are defined in this list then only messages of those rooms will be archived.
...
...
@@ -750,7 +738,7 @@ public class ConversationManager implements Startable, ComponentEventListener{
* @param date
* date when the message was sent.
*/
void
processRoomMessage
(
JID
roomJID
,
JID
sender
,
String
nickname
,
String
body
,
String
stanza
,
Date
date
)
{
void
processRoomMessage
(
JID
roomJID
,
JID
sender
,
String
nickname
,
String
body
,
Date
date
)
{
String
conversationKey
=
getRoomConversationKey
(
roomJID
);
synchronized
(
conversationKey
.
intern
())
{
Conversation
conversation
=
conversations
.
get
(
conversationKey
);
...
...
@@ -788,7 +776,7 @@ public class ConversationManager implements Startable, ComponentEventListener{
JID
jid
=
new
JID
(
roomJID
+
"/"
+
nickname
);
if
(
body
!=
null
)
{
/* OF-677 - Workaround to prevent null messages being archived */
messageQueue
.
add
(
new
ArchivedMessage
(
conversation
.
getConversationID
(),
sender
,
jid
,
date
,
body
,
roomArchivingStanzasEnabled
?
stanza
:
""
,
false
));
messageQueue
.
add
(
new
ArchivedMessage
(
conversation
.
getConversationID
(),
sender
,
jid
,
date
,
body
,
""
,
false
));
}
}
// Notify listeners of the conversation update.
...
...
@@ -1106,9 +1094,6 @@ public class ConversationManager implements Startable, ComponentEventListener{
if
(
roomArchivingEnabled
)
{
metadataArchivingEnabled
=
true
;
}
}
else
if
(
property
.
equals
(
"conversation.roomArchivingStanzas"
)
)
{
String
value
=
(
String
)
params
.
get
(
"value"
);
roomArchivingStanzasEnabled
=
Boolean
.
valueOf
(
value
);
}
else
if
(
property
.
equals
(
"conversation.roomsArchived"
))
{
String
value
=
(
String
)
params
.
get
(
"value"
);
roomsArchived
=
StringUtils
.
stringToCollection
(
value
);
...
...
@@ -1164,8 +1149,6 @@ public class ConversationManager implements Startable, ComponentEventListener{
messageArchivingEnabled
=
false
;
}
else
if
(
property
.
equals
(
"conversation.roomArchiving"
))
{
roomArchivingEnabled
=
false
;
}
else
if
(
property
.
equals
(
"conversation.roomArchivingStanzas"
))
{
roomArchivingStanzasEnabled
=
false
;
}
else
if
(
property
.
equals
(
"conversation.roomsArchived"
))
{
roomsArchived
=
Collections
.
emptyList
();
}
else
if
(
property
.
equals
(
"conversation.idleTime"
))
{
...
...
src/plugins/monitoring/src/java/org/jivesoftware/openfire/archive/GroupConversationInterceptor.java
View file @
c6abe791
...
...
@@ -112,7 +112,7 @@ public class GroupConversationInterceptor implements MUCEventListener, Startable
public
void
messageReceived
(
JID
roomJID
,
JID
user
,
String
nickname
,
Message
message
)
{
// Process this event in the senior cluster member or local JVM when not in a cluster
if
(
ClusterManager
.
isSeniorClusterMember
())
{
conversationManager
.
processRoomMessage
(
roomJID
,
user
,
nickname
,
message
.
getBody
(),
message
.
toXML
(),
new
Date
());
conversationManager
.
processRoomMessage
(
roomJID
,
user
,
nickname
,
message
.
getBody
(),
new
Date
());
}
else
{
boolean
withBody
=
conversationManager
.
isRoomArchivingEnabled
()
&&
(
...
...
@@ -121,7 +121,7 @@ public class GroupConversationInterceptor implements MUCEventListener, Startable
ConversationEventsQueue
eventsQueue
=
conversationManager
.
getConversationEventsQueue
();
eventsQueue
.
addGroupChatEvent
(
conversationManager
.
getRoomConversationKey
(
roomJID
),
ConversationEvent
.
roomMessageReceived
(
roomJID
,
user
,
nickname
,
withBody
?
message
.
getBody
()
:
null
,
message
.
toXML
(),
new
Date
()));
ConversationEvent
.
roomMessageReceived
(
roomJID
,
user
,
nickname
,
withBody
?
message
.
getBody
()
:
null
,
new
Date
()));
}
}
...
...
src/plugins/monitoring/src/web/archiving-settings.jsp
View file @
c6abe791
...
...
@@ -161,7 +161,6 @@
boolean
update
=
request
.
getParameter
(
"update"
)
!=
null
;
boolean
messageArchiving
=
conversationManager
.
isMessageArchivingEnabled
();
boolean
roomArchiving
=
conversationManager
.
isRoomArchivingEnabled
();
boolean
roomArchivingStanzas
=
conversationManager
.
isRoomArchivingStanzasEnabled
();
int
idleTime
=
ParamUtils
.
getIntParameter
(
request
,
"idleTime"
,
conversationManager
.
getIdleTime
());
int
maxTime
=
ParamUtils
.
getIntParameter
(
request
,
"maxTime"
,
conversationManager
.
getMaxTime
());
...
...
@@ -187,7 +186,6 @@
boolean
metadataArchiving
=
request
.
getParameter
(
"metadataArchiving"
)
!=
null
;
messageArchiving
=
request
.
getParameter
(
"messageArchiving"
)
!=
null
;
roomArchiving
=
request
.
getParameter
(
"roomArchiving"
)
!=
null
;
roomArchivingStanzas
=
request
.
getParameter
(
"roomArchivingStanzas"
)
!=
null
;
String
roomsArchived
=
request
.
getParameter
(
"roomsArchived"
);
// Validate params
...
...
@@ -216,7 +214,6 @@
conversationManager
.
setMetadataArchivingEnabled
(
metadataArchiving
);
conversationManager
.
setMessageArchivingEnabled
(
messageArchiving
);
conversationManager
.
setRoomArchivingEnabled
(
roomArchiving
);
conversationManager
.
setRoomArchivingStanzasEnabled
(
roomArchivingStanzas
);
conversationManager
.
setRoomsArchived
(
StringUtils
.
stringToCollection
(
roomsArchived
));
conversationManager
.
setIdleTime
(
idleTime
);
conversationManager
.
setMaxTime
(
maxTime
);
...
...
@@ -284,10 +281,6 @@
<td><fmt:message
key=
"archive.settings.group_chats"
/></td>
<td><input
type=
"checkbox"
name=
"roomArchiving"
<%=
conversationManager
.
isRoomArchivingEnabled
()
?
"checked"
:
""
%>
/></td>
</tr>
<tr>
<td><fmt:message
key=
"archive.settings.group_chats.stanzas"
/></td>
<td><input
type=
"checkbox"
name=
"roomArchivingStanzas"
<%=
conversationManager
.
isRoomArchivingStanzasEnabled
()
?
"checked"
:
""
%>
/></td>
</tr>
<tr>
<td><fmt:message
key=
"archive.settings.certain_rooms"
/></td>
<td><textarea
name=
"roomsArchived"
cols=
"30"
rows=
"2"
wrap=
"virtual"
><%=
StringUtils
.
collectionToString
(
conversationManager
.
getRoomsArchived
())
%></textarea></td>
...
...
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