xmpppy gives us the UTC time, we convert it to localtime
This commit is contained in:
parent
b372567405
commit
eef71fcb27
|
@ -20,6 +20,7 @@
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
from calendar import timegm
|
||||||
|
|
||||||
import common.xmpp
|
import common.xmpp
|
||||||
|
|
||||||
|
@ -169,8 +170,8 @@ class Connection:
|
||||||
"""Called when we recieve a message"""
|
"""Called when we recieve a message"""
|
||||||
mtype = msg.getType()
|
mtype = msg.getType()
|
||||||
tim = msg.getTimestamp()
|
tim = msg.getTimestamp()
|
||||||
print tim
|
|
||||||
tim = time.strptime(tim, '%Y%m%dT%H:%M:%S')
|
tim = time.strptime(tim, '%Y%m%dT%H:%M:%S')
|
||||||
|
tim = time.localtime(timegm(tim))
|
||||||
msgtxt = msg.getBody()
|
msgtxt = msg.getBody()
|
||||||
xtags = msg.getTags('x')
|
xtags = msg.getTags('x')
|
||||||
encTag = None
|
encTag = None
|
||||||
|
|
|
@ -184,7 +184,28 @@ class Preferences_window:
|
||||||
buf2 = {}
|
buf2 = {}
|
||||||
jids = {}
|
jids = {}
|
||||||
if widget.get_active():
|
if widget.get_active():
|
||||||
|
#save buffers and close windows
|
||||||
|
for acct in gajim.connections:
|
||||||
|
buf1[acct] = {}
|
||||||
|
buf2[acct] = {}
|
||||||
|
jids[acct] = self.plugin.windows[acct]['chats'].keys()
|
||||||
|
for jid in jids[acct]:
|
||||||
|
buf1[acct][jid] = self.plugin.windows[acct]['chats'][jid].\
|
||||||
|
xmls[jid].get_widget('conversation_textview').get_buffer()
|
||||||
|
buf2[acct][jid] = self.plugin.windows[acct]['chats'][jid].\
|
||||||
|
xmls[jid].get_widget('message_textview').get_buffer()
|
||||||
|
self.plugin.windows[acct]['chats'][jid].window.destroy()
|
||||||
gajim.config.set('usetabbedchat', True)
|
gajim.config.set('usetabbedchat', True)
|
||||||
|
#open new tabbed chat windows
|
||||||
|
for acct in gajim.connections:
|
||||||
|
for jid in jids[acct]:
|
||||||
|
user = self.plugin.roster.contacts[acct][jid][0]
|
||||||
|
self.plugin.roster.new_chat(user, acct)
|
||||||
|
self.plugin.windows[acct]['chats'][jid].xmls[jid].\
|
||||||
|
get_widget('conversation_textview').set_buffer(\
|
||||||
|
buf1[acct][jid])
|
||||||
|
self.plugin.windows[acct]['chats'][jid].xmls[jid].\
|
||||||
|
get_widget('message_textview').set_buffer(buf2[acct][jid])
|
||||||
else:
|
else:
|
||||||
gajim.config.set('usetabbedchat', False)
|
gajim.config.set('usetabbedchat', False)
|
||||||
self.plugin.save_config()
|
self.plugin.save_config()
|
||||||
|
|
Loading…
Reference in New Issue