1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Get MAM since yesterday

Later we will have several options.
Getting everything since last timestamp (if none everything at all).
Getting everything since today + configure time (1 week).

Should also have a reload all command like conversations once you
cleared the history.

All MAM messages should be written into sql db.
And then probably displayed from there so that regular history works
too.
This commit is contained in:
Michael Vetter 2020-04-12 00:06:36 +02:00
parent dd566d8d56
commit aedecee962

View File

@ -2508,7 +2508,13 @@ iq_mam_request(ProfChatWin *win)
xmpp_ctx_t * const ctx = connection_get_ctx();
char *id = connection_create_stanza_id();
xmpp_stanza_t *iq = stanza_create_mam_iq(ctx, win->barejid, "2020-01-06T00:00:00Z");
GDateTime *timestamp = g_date_time_new_now_local();
timestamp = g_date_time_add_days(timestamp, -1);
gchar *datestr = g_date_time_format(timestamp,"%FT%T%:::z");
xmpp_stanza_t *iq = stanza_create_mam_iq(ctx, win->barejid, datestr);
g_free(datestr);
g_date_time_unref(timestamp);
// iq_id_handler_add(id, _http_upload_response_id_handler, NULL, upload);
free(id);