about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDebXWoody <stefan@debxwoody.de>2020-10-24 20:11:37 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-10-28 09:06:49 +0100
commit15f45fcfe1b5a4f9c8419eb153b71a9e33c09870 (patch)
treed18a04e99e6e130ae96c9e81233cce01266ef8b3
parentda513a924c2e0ac456a18c32c97314f103fc09c6 (diff)
downloadprofani-tty-15f45fcfe1b5a4f9c8419eb153b71a9e33c09870.tar.gz
Fixed Date format for MAM request
Using g_date_time_new_now_utc instead of g_date_time_new_now_local
Using g_date_time_format(timestamp, "%FT%TZ") instead of "%FT%T%:::z"

Edit:
DebXWoody created this patch because ejabberd returned an error with the
old date format.
-rw-r--r--src/xmpp/iq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index d583eda0..07acdf14 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -2551,10 +2551,10 @@ iq_mam_request(ProfChatWin* win)
     xmpp_ctx_t* const ctx = connection_get_ctx();
     char* id = connection_create_stanza_id();
 
-    GDateTime* now = g_date_time_new_now_local();
+    GDateTime* now = g_date_time_new_now_utc();
     GDateTime* timestamp = g_date_time_add_days(now, -1);
     g_date_time_unref(now);
-    gchar* datestr = g_date_time_format(timestamp, "%FT%T%:::z");
+    gchar* datestr = g_date_time_format(timestamp, "%FT%TZ");
     xmpp_stanza_t* iq = stanza_create_mam_iq(ctx, win->barejid, datestr);
     g_free(datestr);
     g_date_time_unref(timestamp);