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
8f26268b
Commit
8f26268b
authored
Dec 17, 2015
by
Dave Cridland
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #458 from guusdk/OF-856
OF-856: Cherry Picking of linuschien solution
parents
c0c1eaa7
45fa9970
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
JdbcPersistenceManager.java
.../openfire/plugin/archive/impl/JdbcPersistenceManager.java
+4
-11
IQRetrieveHandler.java
...on/openfire/plugin/archive/xep0136/IQRetrieveHandler.java
+14
-5
No files found.
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/impl/JdbcPersistenceManager.java
View file @
8f26268b
...
...
@@ -95,7 +95,6 @@ public class JdbcPersistenceManager implements PersistenceManager {
public
static
final
String
CONVERSATION_WITH_JID
=
"ofMessageArchive.toJID"
;
// public static final String CONVERSATION_WITH_JID = "c.withJid";
public
static
final
String
MESSAGE_ID
=
"ofMessageArchive.messageID"
;
public
static
final
String
MESSAGE_SENT_DATE
=
"ofMessageArchive.sentDate"
;
...
...
@@ -126,7 +125,6 @@ public class JdbcPersistenceManager implements PersistenceManager {
// public static final String SELECT_PARTICIPANTS_BY_CONVERSATION =
// "SELECT participantId,startTime,endTime,jid FROM archiveParticipants WHERE conversationId =? ORDER BY startTime";
public
static
final
String
SELECT_MESSAGES
=
"SELECT DISTINCT "
+
"ofMessageArchive.fromJID, "
+
"ofMessageArchive.toJID, "
+
"ofMessageArchive.sentDate, "
+
"ofMessageArchive.stanza, "
+
"ofMessageArchive.messageID, "
+
"ofConParticipant.bareJID "
...
...
@@ -168,7 +166,7 @@ public class JdbcPersistenceManager implements PersistenceManager {
public
Date
getAuditedStartDate
(
Date
startDate
)
{
long
maxRetrievable
=
JiveGlobals
.
getIntProperty
(
"conversation.maxRetrievable"
,
ConversationManager
.
DEFAULT_MAX_RETRIEVABLE
)
*
JiveConstants
.
DAY
;
Date
result
;
Date
result
=
startDate
;
if
(
maxRetrievable
>
0
)
{
Date
now
=
new
Date
();
Date
maxRetrievableDate
=
new
Date
(
now
.
getTime
()
-
maxRetrievable
);
...
...
@@ -176,11 +174,7 @@ public class JdbcPersistenceManager implements PersistenceManager {
result
=
maxRetrievableDate
;
}
else
if
(
startDate
.
before
(
maxRetrievableDate
))
{
result
=
maxRetrievableDate
;
}
else
{
result
=
startDate
;
}
}
else
{
result
=
startDate
;
}
return
result
;
}
...
...
@@ -887,5 +881,4 @@ public class JdbcPersistenceManager implements PersistenceManager {
return
false
;
}
}
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/xep0136/IQRetrieveHandler.java
View file @
8f26268b
...
...
@@ -75,8 +75,12 @@ public class IQRetrieveHandler extends AbstractIQHandler {
final
List
<
ArchivedMessage
>
messages
=
conversation
.
getMessages
()
.
subList
(
fromIndex
,
toIndex
);
for
(
ArchivedMessage
message
:
messages
)
{
addMessageElement
(
chatElement
,
conversation
,
message
);
for
(
int
i
=
0
;
i
<
messages
.
size
();
i
++)
{
if
(
i
==
0
)
{
addMessageElement
(
chatElement
,
conversation
,
messages
.
get
(
i
),
null
);
}
else
{
addMessageElement
(
chatElement
,
conversation
,
messages
.
get
(
i
),
messages
.
get
(
i
-
1
));
}
}
if
(
resultSet
!=
null
)
{
...
...
@@ -98,11 +102,16 @@ public class IQRetrieveHandler extends AbstractIQHandler {
}
private
Element
addMessageElement
(
Element
parentElement
,
Conversation
conversation
,
ArchivedMessage
message
)
{
Conversation
conversation
,
ArchivedMessage
message
,
ArchivedMessage
previousMessage
)
{
final
Element
messageElement
;
final
long
secs
;
final
long
secs
;
if
(
previousMessage
==
null
)
{
secs
=
(
message
.
getTime
().
getTime
()
-
conversation
.
getStart
().
getTime
())
/
1000
;
}
else
{
secs
=
(
message
.
getTime
().
getTime
()
-
previousMessage
.
getTime
().
getTime
())
/
1000
;
}
messageElement
=
parentElement
.
addElement
(
message
.
getDirection
()
.
toString
());
messageElement
.
addAttribute
(
"secs"
,
Long
.
toString
(
secs
));
...
...
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