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
d0d3adf2
Commit
d0d3adf2
authored
May 05, 2015
by
JonnyHeavey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced manual xep0082 datetime definition with existing implementation
parent
4dfa5f49
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
IQQueryHandler.java
...eucon/openfire/plugin/archive/xep0313/IQQueryHandler.java
+6
-5
No files found.
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/xep0313/IQQueryHandler.java
View file @
d0d3adf2
...
@@ -17,6 +17,7 @@ import org.jivesoftware.openfire.auth.UnauthorizedException;
...
@@ -17,6 +17,7 @@ import org.jivesoftware.openfire.auth.UnauthorizedException;
import
org.jivesoftware.openfire.disco.ServerFeaturesProvider
;
import
org.jivesoftware.openfire.disco.ServerFeaturesProvider
;
import
org.jivesoftware.openfire.handler.IQHandler
;
import
org.jivesoftware.openfire.handler.IQHandler
;
import
org.jivesoftware.openfire.session.LocalClientSession
;
import
org.jivesoftware.openfire.session.LocalClientSession
;
import
org.jivesoftware.util.XMPPDateTimeFormat
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.xmpp.forms.DataForm
;
import
org.xmpp.forms.DataForm
;
...
@@ -39,7 +40,8 @@ public class IQQueryHandler extends AbstractIQHandler implements
...
@@ -39,7 +40,8 @@ public class IQQueryHandler extends AbstractIQHandler implements
private
static
final
Logger
Log
=
LoggerFactory
.
getLogger
(
IQHandler
.
class
);
private
static
final
Logger
Log
=
LoggerFactory
.
getLogger
(
IQHandler
.
class
);
private
static
final
String
NAMESPACE
=
"urn:xmpp:mam:0"
;
private
static
final
String
NAMESPACE
=
"urn:xmpp:mam:0"
;
private
static
final
String
MODULE_NAME
=
"Message Archive Management Query Handler"
;
private
static
final
String
MODULE_NAME
=
"Message Archive Management Query Handler"
;
private
static
final
DateFormat
XEP0082_DATE_FORMAT
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss'Z'"
);
XMPPDateTimeFormat
xmppDateTimeFormat
=
new
XMPPDateTimeFormat
();
protected
IQQueryHandler
()
{
protected
IQQueryHandler
()
{
super
(
MODULE_NAME
,
"query"
,
NAMESPACE
);
super
(
MODULE_NAME
,
"query"
,
NAMESPACE
);
...
@@ -139,10 +141,10 @@ public class IQQueryHandler extends AbstractIQHandler implements
...
@@ -139,10 +141,10 @@ public class IQQueryHandler extends AbstractIQHandler implements
Date
endDate
=
null
;
Date
endDate
=
null
;
try
{
try
{
if
(
startField
!=
null
)
{
if
(
startField
!=
null
)
{
startDate
=
XEP0082_DATE_FORMAT
.
parse
(
startField
);
startDate
=
xmppDateTimeFormat
.
parseString
(
startField
);
}
}
if
(
endField
!=
null
)
{
if
(
endField
!=
null
)
{
endDate
=
XEP0082_DATE_FORMAT
.
parse
(
endField
);
endDate
=
xmppDateTimeFormat
.
parseString
(
endField
);
}
}
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
Log
.
error
(
"Error parsing query date filters."
,
e
);
Log
.
error
(
"Error parsing query date filters."
,
e
);
...
@@ -219,8 +221,7 @@ public class IQQueryHandler extends AbstractIQHandler implements
...
@@ -219,8 +221,7 @@ public class IQQueryHandler extends AbstractIQHandler implements
Element
forwarded
=
result
.
addElement
(
"forwarded"
,
"urn:xmpp:forward:0"
);
Element
forwarded
=
result
.
addElement
(
"forwarded"
,
"urn:xmpp:forward:0"
);
Element
delay
=
forwarded
.
addElement
(
"delay"
,
"urn:xmpp:delay"
);
Element
delay
=
forwarded
.
addElement
(
"delay"
,
"urn:xmpp:delay"
);
XEP0082_DATE_FORMAT
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"UTC"
));
delay
.
addAttribute
(
"stamp"
,
XMPPDateTimeFormat
.
format
(
archivedMessage
.
getTime
()));
delay
.
addAttribute
(
"stamp"
,
XEP0082_DATE_FORMAT
.
format
(
archivedMessage
.
getTime
()));
Document
stanza
;
Document
stanza
;
try
{
try
{
...
...
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