1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

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.
This commit is contained in:
DebXWoody 2020-10-24 20:11:37 +02:00 committed by Michael Vetter
parent da513a924c
commit 15f45fcfe1

View File

@ -2551,10 +2551,10 @@ iq_mam_request(ProfChatWin* win)
xmpp_ctx_t* const ctx = connection_get_ctx(); xmpp_ctx_t* const ctx = connection_get_ctx();
char* id = connection_create_stanza_id(); 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); GDateTime* timestamp = g_date_time_add_days(now, -1);
g_date_time_unref(now); 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); xmpp_stanza_t* iq = stanza_create_mam_iq(ctx, win->barejid, datestr);
g_free(datestr); g_free(datestr);
g_date_time_unref(timestamp); g_date_time_unref(timestamp);