Commit 912765b7 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Fixed time response packet.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@662 b35dd754-fafc-0310-a699-88a17e54d16e
parent c83d4946
......@@ -59,23 +59,23 @@ public class IQTimeHandler extends IQHandler implements ServerFeaturesProvider {
public IQ handleIQ(IQ packet) {
IQ response = null;
buildResponse();
response = IQ.createResultIQ(packet);
response.setChildElement(buildResponse());
return response;
}
/**
* Build the responseElement packet
*/
private void buildResponse() {
private Element buildResponse() {
Element response = responseElement.createCopy();
Date current = new Date();
responseElement.element("utc").setText(UTC_FORMAT.format(current));
response.element("utc").setText(UTC_FORMAT.format(current));
StringBuffer display = new StringBuffer(DATE_FORMAT.format(current));
display.append(' ');
display.append(TIME_FORMAT.format(current));
responseElement.element("display").setText(display.toString());
response.element("display").setText(display.toString());
return response;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment