Use correct file date on Jingle FT

- XEP-0234 demands UTC
- we missed the 'Z' at the end
- simplified the code
This commit is contained in:
Philipp Hörist 2017-08-07 13:03:48 +02:00
parent a2e2fb2ed1
commit 1eeb53bee6
1 changed files with 3 additions and 5 deletions

View File

@ -30,6 +30,7 @@ import os
import time
from enum import IntEnum, unique
from datetime import datetime
import gtkgui_helpers
import tooltips
@ -682,11 +683,8 @@ class FileTransfersWindow:
def __convert_date(self, epoch):
# Converts date-time from seconds from epoch to iso 8601
import time, datetime
ts = time.gmtime(epoch)
dt = datetime.datetime(ts.tm_year, ts.tm_mon, ts.tm_mday, ts.tm_hour,
ts.tm_min, ts.tm_sec)
return dt.isoformat()
dt = datetime.utcfromtimestamp(epoch)
return dt.isoformat() + 'Z'
def get_send_file_props(self, account, contact, file_path, file_name,
file_desc=''):