aboutsummaryrefslogtreecommitdiff
path: root/src/QXmppEntityTimeManager.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-11-08 09:26:45 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-11-08 09:26:45 +0000
commit63de60dac600542823843223ee091ace86725361 (patch)
tree089ca055f352e739db9c1242ae92b93aef43ea2b /src/QXmppEntityTimeManager.cpp
parentcb8b6cb286e923dfc8b7fe0fa9d30a4da3b84e95 (diff)
downloadqxmpp-63de60dac600542823843223ee091ace86725361.tar.gz
QXmppEntityTimeIq should store timezone offsets in seconds
and handle parsing / serialisation internally.
Diffstat (limited to 'src/QXmppEntityTimeManager.cpp')
-rw-r--r--src/QXmppEntityTimeManager.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/QXmppEntityTimeManager.cpp b/src/QXmppEntityTimeManager.cpp
index 443229df..239bcfae 100644
--- a/src/QXmppEntityTimeManager.cpp
+++ b/src/QXmppEntityTimeManager.cpp
@@ -69,19 +69,7 @@ bool QXmppEntityTimeManager::handleStanza(const QDomElement &element)
responseIq.setUtc(utc);
currentTime.setTimeSpec(Qt::UTC);
- int tzo_sec = utc.secsTo(currentTime);
- QTime tzo_time;
- if(tzo_sec < 0)
- tzo_time = tzo_time.addSecs(-tzo_sec);
- else
- tzo_time = tzo_time.addSecs(tzo_sec);
- QString tzo;
- if(tzo_sec < 0)
- tzo = "-" + tzo_time.toString("hh:mm");
- else
- tzo = "+" + tzo_time.toString("hh:mm");
-
- responseIq.setTzo(tzo);
+ responseIq.setTzo(utc.secsTo(currentTime));
client()->sendPacket(responseIq);
}