summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-07-03 15:41:22 -0700
committerLance Stout <lancestout@gmail.com>2011-07-03 15:41:22 -0700
commit9c5885c6b6f5adce072e50885e95c5b7c6c7c428 (patch)
tree2d9b6b4d9a2a7dd8a32d666634989c5c8f08f34c /sleekxmpp/plugins
parentec3a14e6d91e61c76147d8415f7246086fd9d435 (diff)
downloadslixmpp-9c5885c6b6f5adce072e50885e95c5b7c6c7c428.tar.gz
slixmpp-9c5885c6b6f5adce072e50885e95c5b7c6c7c428.tar.bz2
slixmpp-9c5885c6b6f5adce072e50885e95c5b7c6c7c428.tar.xz
slixmpp-9c5885c6b6f5adce072e50885e95c5b7c6c7c428.zip
Let XEP-0202 specify the local timezone offset in the config.
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r--sleekxmpp/plugins/xep_0202/time.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sleekxmpp/plugins/xep_0202/time.py b/sleekxmpp/plugins/xep_0202/time.py
index f944bcb3..bcad8bc8 100644
--- a/sleekxmpp/plugins/xep_0202/time.py
+++ b/sleekxmpp/plugins/xep_0202/time.py
@@ -32,13 +32,15 @@ class xep_0202(base_plugin):
self.description = 'Entity Time'
self.stanza = stanza
+ self.tz_offset = self.config.get('tz_offset', 0)
+
# As a default, respond to time requests with the
# local time returned by XEP-0082. However, a
# custom function can be supplied which accepts
# the JID of the entity to query for the time.
self.local_time = self.config.get('local_time', None)
if not self.local_time:
- self.local_time = lambda x: xep_0082.datetime()
+ self.local_time = lambda x: xep_0082.datetime(offset=self.tz_offset)
self.xmpp.registerHandler(
Callback('Entity Time',