|
@@ -3493,7 +3493,15 @@ xs_dict *markers_get(snac *snac, const xs_list *markers)
|
|
|
xs_list_foreach(markers, v) {
|
|
xs_list_foreach(markers, v) {
|
|
|
const xs_dict *mark = xs_dict_get(data, v);
|
|
const xs_dict *mark = xs_dict_get(data, v);
|
|
|
if (!xs_is_null(mark)) {
|
|
if (!xs_is_null(mark)) {
|
|
|
- returns = xs_dict_append(returns, v, mark);
|
|
|
|
|
|
|
+ xs_dict *copy = xs_dup(mark);
|
|
|
|
|
+ const xs_val *datetime = xs_dict_get(mark, "updated_at");
|
|
|
|
|
+ if (!xs_is_null(datetime) && datetime[0] != '2') {
|
|
|
|
|
+ /* fix wrong timestamp format */
|
|
|
|
|
+ struct timeval tv;
|
|
|
|
|
+ if (sscanf(datetime, "%lu.%lu", &(tv.tv_sec), &(tv.tv_usec))==2)
|
|
|
|
|
+ xs_dict_set(copy, "updated_at", rfctime(0, &tv));
|
|
|
|
|
+ }
|
|
|
|
|
+ returns = xs_dict_append(returns, v, copy);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return returns;
|
|
return returns;
|
|
@@ -3517,20 +3525,20 @@ xs_dict *markers_set(snac *snac, const char *home_marker, const char *notify_mar
|
|
|
|
|
|
|
|
if (!xs_is_null(home_marker)) {
|
|
if (!xs_is_null(home_marker)) {
|
|
|
xs *home = xs_dict_new();
|
|
xs *home = xs_dict_new();
|
|
|
- xs *s_tid = tid(0);
|
|
|
|
|
|
|
+ xs *s_datetime = rfctime(0, NULL);
|
|
|
home = xs_dict_append(home, "last_read_id", home_marker);
|
|
home = xs_dict_append(home, "last_read_id", home_marker);
|
|
|
home = xs_dict_append(home, "version", xs_stock(0));
|
|
home = xs_dict_append(home, "version", xs_stock(0));
|
|
|
- home = xs_dict_append(home, "updated_at", s_tid);
|
|
|
|
|
|
|
+ home = xs_dict_append(home, "updated_at", s_datetime);
|
|
|
data = xs_dict_set(data, "home", home);
|
|
data = xs_dict_set(data, "home", home);
|
|
|
written = xs_dict_append(written, "home", home);
|
|
written = xs_dict_append(written, "home", home);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!xs_is_null(notify_marker)) {
|
|
if (!xs_is_null(notify_marker)) {
|
|
|
xs *notify = xs_dict_new();
|
|
xs *notify = xs_dict_new();
|
|
|
- xs *s_tid = tid(0);
|
|
|
|
|
|
|
+ xs *s_datetime = rfctime(0, NULL);
|
|
|
notify = xs_dict_append(notify, "last_read_id", notify_marker);
|
|
notify = xs_dict_append(notify, "last_read_id", notify_marker);
|
|
|
notify = xs_dict_append(notify, "version", xs_stock(0));
|
|
notify = xs_dict_append(notify, "version", xs_stock(0));
|
|
|
- notify = xs_dict_append(notify, "updated_at", s_tid);
|
|
|
|
|
|
|
+ notify = xs_dict_append(notify, "updated_at", s_datetime);
|
|
|
data = xs_dict_set(data, "notifications", notify);
|
|
data = xs_dict_set(data, "notifications", notify);
|
|
|
written = xs_dict_append(written, "notifications", notify);
|
|
written = xs_dict_append(written, "notifications", notify);
|
|
|
}
|
|
}
|