From 9c5885c6b6f5adce072e50885e95c5b7c6c7c428 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Sun, 3 Jul 2011 15:41:22 -0700 Subject: [PATCH] Let XEP-0202 specify the local timezone offset in the config. --- sleekxmpp/plugins/xep_0202/time.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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',