forked from 0ad/0ad
Fix BSD and OSX build that don't provide the AT&T version of timezone used by 6141c5c4fa
. Refs #3832, D514.
Mostly reviewed by: leper Tested on Windows by: Stan This was SVN commit r19947.
This commit is contained in:
parent
79537fee3b
commit
9a5e1ddedb
@ -25,10 +25,6 @@
|
||||
|
||||
#include "i18n/L10n.h"
|
||||
|
||||
#if OS_WIN
|
||||
#include "lib/sysdep/os/win/wposix/wtime.h"
|
||||
#endif
|
||||
|
||||
#include "lib/external_libraries/enet.h"
|
||||
#include "lib/utf8.h"
|
||||
#include "network/NetServer.h"
|
||||
@ -948,14 +944,8 @@ std::time_t XmppClient::ComputeTimestamp(const glooxwrapper::Message& msg) const
|
||||
if (!msg.when())
|
||||
return std::time(nullptr);
|
||||
|
||||
glooxwrapper::string timestampStr = msg.when()->stamp();
|
||||
struct tm timestamp = {0};
|
||||
|
||||
// See http://xmpp.org/extensions/xep-0082.html#sect-idp285136 for format
|
||||
if (!strptime(timestampStr.c_str(), "%Y-%m-%dT%H:%M:%SZ", ×tamp))
|
||||
LOGERROR("Received delayed message with corrupted timestamp %s", timestampStr.to_string());
|
||||
|
||||
return std::mktime(×tamp) - timezone;
|
||||
// See XEP-0082 for the date format
|
||||
return g_L10n.ParseDateTime(msg.when()->stamp().to_string(), "Y-M-d'T'H:m:sZ", Locale::getUS()) / 1000.0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user