From e510875f649bc08adba3051785ce9140ca43137c Mon Sep 17 00:00:00 2001 From: Florian Fieber Date: Sun, 19 Aug 2012 16:20:58 +0200 Subject: Fix certificate expiration scheduler timedelta.seconds does not store the total seconds of a time span. Internally, seconds is the next smaller unit to days, hence timedelta.seconds will never exceed (or reach) the number of seconds in a day (60*60*24=86400) --- sleekxmpp/xmlstream/xmlstream.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sleekxmpp') diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index df06d067..246bc205 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -901,9 +901,15 @@ class XMLStream(object): log.warn('CERT: Certificate has expired.') restart() + try: + total_seconds = cert_ttl.total_seconds() + except AttributeError: + # for Python < 2.7 + total_seconds = (cert_ttl.microseconds + (cert_ttl.seconds + cert_ttl.days * 24 * 3600) * 10**6) / 10**6 + log.info('CERT: Time until certificate expiration: %s' % cert_ttl) self.schedule('Certificate Expiration', - cert_ttl.seconds, + total_seconds, restart) def _start_keepalive(self, event): -- cgit v1.2.3 From 1ca0c463334f71214f8d78d63ec4220100cc7ff1 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 23 Aug 2012 00:23:32 -0700 Subject: Special plugin loading case for xep_0115 no longer needed. --- sleekxmpp/basexmpp.py | 7 ------- 1 file changed, 7 deletions(-) (limited to 'sleekxmpp') diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py index 282c0c31..244d19c5 100644 --- a/sleekxmpp/basexmpp.py +++ b/sleekxmpp/basexmpp.py @@ -226,13 +226,6 @@ class BaseXMPP(XMLStream): - The send queue processor - The scheduler """ - if 'xep_0115' in self.plugin: - name = 'xep_0115' - if not hasattr(self.plugin[name], 'post_inited'): - if hasattr(self.plugin[name], 'post_init'): - self.plugin[name].post_init() - self.plugin[name].post_inited = True - for name in self.plugin: if not hasattr(self.plugin[name], 'post_inited'): if hasattr(self.plugin[name], 'post_init'): -- cgit v1.2.3 From e68b07dbce6b03ef99a19886a9b53808e5a04289 Mon Sep 17 00:00:00 2001 From: Florian Fieber Date: Thu, 23 Aug 2012 03:55:17 +0200 Subject: Fix get_blocked() in XEP-0191 --- sleekxmpp/plugins/xep_0191/blocking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sleekxmpp') diff --git a/sleekxmpp/plugins/xep_0191/blocking.py b/sleekxmpp/plugins/xep_0191/blocking.py index 4a87479a..57632319 100644 --- a/sleekxmpp/plugins/xep_0191/blocking.py +++ b/sleekxmpp/plugins/xep_0191/blocking.py @@ -48,7 +48,7 @@ class XEP_0191(BasePlugin): def get_blocked(self, ifrom=None, block=True, timeout=None, callback=None): iq = self.xmpp.Iq() iq['type'] = 'get' - iq['from'] = 'ifrom' + iq['from'] = ifrom iq.enable('blocklist') return iq.send(block=block, timeout=timeout, callback=callback) -- cgit v1.2.3 From c7ec6a72cda41c7dbbdd4193d795b5dd8df4843f Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Fri, 24 Aug 2012 11:47:21 -0700 Subject: Add catch-all chatstate event. --- sleekxmpp/plugins/xep_0085/chat_states.py | 1 + 1 file changed, 1 insertion(+) (limited to 'sleekxmpp') diff --git a/sleekxmpp/plugins/xep_0085/chat_states.py b/sleekxmpp/plugins/xep_0085/chat_states.py index 17e19d35..17f82afd 100644 --- a/sleekxmpp/plugins/xep_0085/chat_states.py +++ b/sleekxmpp/plugins/xep_0085/chat_states.py @@ -52,4 +52,5 @@ class XEP_0085(BasePlugin): def _handle_chat_state(self, msg): state = msg['chat_state'] log.debug("Chat State: %s, %s", state, msg['from'].jid) + self.xmpp.event('chatstate', msg) self.xmpp.event('chatstate_%s' % state, msg) -- cgit v1.2.3