don't fail when we get a wrong time format when requesting contact time
This commit is contained in:
parent
9d307570df
commit
c7c5d0f66d
|
@ -1682,10 +1682,13 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
||||||
def dst(self, dt):
|
def dst(self, dt):
|
||||||
return ZERO
|
return ZERO
|
||||||
|
|
||||||
|
try:
|
||||||
t = datetime.datetime.strptime(utc_time, '%Y-%m-%dT%H:%M:%SZ')
|
t = datetime.datetime.strptime(utc_time, '%Y-%m-%dT%H:%M:%SZ')
|
||||||
t = t.replace(tzinfo=UTC())
|
t = t.replace(tzinfo=UTC())
|
||||||
|
|
||||||
time_info = t.astimezone(contact_tz()).strftime('%c')
|
time_info = t.astimezone(contact_tz()).strftime('%c')
|
||||||
|
except ValueError, e:
|
||||||
|
log.info('Wrong time format: %s' % str(e))
|
||||||
|
|
||||||
id_ = iq_obj.getID()
|
id_ = iq_obj.getID()
|
||||||
if id_ in self.groupchat_jids:
|
if id_ in self.groupchat_jids:
|
||||||
who = self.groupchat_jids[id_]
|
who = self.groupchat_jids[id_]
|
||||||
|
|
Loading…
Reference in New Issue