diff options
author | louiz’ <louiz@louiz.org> | 2016-08-23 20:47:05 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2016-08-23 20:48:39 +0200 |
commit | a195939cdaca343013d32ae902839ffdb28c33cb (patch) | |
tree | d9043075211b59e7cee824e6f0b7f966f2099ee0 /louloulibs | |
parent | 20b187daa02a2fc4eda708ac3be406b88060c06c (diff) | |
download | biboumi-a195939cdaca343013d32ae902839ffdb28c33cb.tar.gz biboumi-a195939cdaca343013d32ae902839ffdb28c33cb.tar.bz2 biboumi-a195939cdaca343013d32ae902839ffdb28c33cb.tar.xz biboumi-a195939cdaca343013d32ae902839ffdb28c33cb.zip |
Don't use put_time() because it’s not in gcc 4.9, in shitty-debian “stable”
Use strftime instead
Diffstat (limited to 'louloulibs')
-rw-r--r-- | louloulibs/xmpp/xmpp_component.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/louloulibs/xmpp/xmpp_component.cpp b/louloulibs/xmpp/xmpp_component.cpp index 22121f6..46c070a 100644 --- a/louloulibs/xmpp/xmpp_component.cpp +++ b/louloulibs/xmpp/xmpp_component.cpp @@ -17,7 +17,6 @@ #include <uuid.h> #include <cstdlib> -#include <iomanip> #include <louloulibs.h> #ifdef SYSTEMD_FOUND @@ -446,9 +445,10 @@ void XmppComponent::send_history_message(const std::string& muc_name, const std: XmlNode delay("delay"); delay["xmlns"] = "urn:xmpp:delay"; delay["from"] = muc_name + "@" + this->served_hostname; - std::stringstream date_ss; - date_ss << std::put_time(std::gmtime(×tamp), "%FT%Tz") << std::endl; - delay["stamp"] = date_ss.str(); + constexpr std::size_t stamp_size = 20; + char date_buf[stamp_size]; + std::strftime(date_buf, stamp_size, "%FT%Tz", std::gmtime(×tamp)); + delay["stamp"] = date_buf; message.add_child(std::move(delay)); this->send_stanza(message); |