summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authorGravatar default2024-12-20 09:04:17 +0100
committerGravatar default2024-12-20 09:04:17 +0100
commit156d5280196c948369b186999a74c7062272b5b2 (patch)
tree18f5c38d052b4ace38142ce09202a4d3f3e6be72 /data.c
parentUpdated RELEASE_NOTES. (diff)
downloadsnac2-156d5280196c948369b186999a74c7062272b5b2.tar.gz
snac2-156d5280196c948369b186999a74c7062272b5b2.tar.xz
snac2-156d5280196c948369b186999a74c7062272b5b2.zip
Add contact metrics to og:description.
Diffstat (limited to 'data.c')
-rw-r--r--data.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/data.c b/data.c
index 823975e..36c41f3 100644
--- a/data.c
+++ b/data.c
@@ -2842,7 +2842,7 @@ xs_str *notify_check_time(snac *snac, int reset)
2842 2842
2843xs_dict *markers_get(snac *snac, const xs_list *markers) 2843xs_dict *markers_get(snac *snac, const xs_list *markers)
2844{ 2844{
2845 xs_dict *data = NULL; 2845 xs *data = NULL;
2846 xs_dict *returns = xs_dict_new(); 2846 xs_dict *returns = xs_dict_new();
2847 xs *fn = xs_fmt("%s/markers.json", snac->basedir); 2847 xs *fn = xs_fmt("%s/markers.json", snac->basedir);
2848 const xs_str *v = NULL; 2848 const xs_str *v = NULL;
@@ -2868,7 +2868,7 @@ xs_dict *markers_get(snac *snac, const xs_list *markers)
2868xs_dict *markers_set(snac *snac, const char *home_marker, const char *notify_marker) 2868xs_dict *markers_set(snac *snac, const char *home_marker, const char *notify_marker)
2869/* gets or sets notification marker */ 2869/* gets or sets notification marker */
2870{ 2870{
2871 xs_dict *data = NULL; 2871 xs *data = NULL;
2872 xs_dict *written = xs_dict_new(); 2872 xs_dict *written = xs_dict_new();
2873 xs *fn = xs_fmt("%s/markers.json", snac->basedir); 2873 xs *fn = xs_fmt("%s/markers.json", snac->basedir);
2874 FILE *f; 2874 FILE *f;
@@ -2882,19 +2882,21 @@ xs_dict *markers_set(snac *snac, const char *home_marker, const char *notify_mar
2882 data = xs_dict_new(); 2882 data = xs_dict_new();
2883 2883
2884 if (!xs_is_null(home_marker)) { 2884 if (!xs_is_null(home_marker)) {
2885 xs_dict *home = xs_dict_new(); 2885 xs *home = xs_dict_new();
2886 xs *s_tid = tid(0);
2886 home = xs_dict_append(home, "last_read_id", home_marker); 2887 home = xs_dict_append(home, "last_read_id", home_marker);
2887 home = xs_dict_append(home, "version", xs_stock(0)); 2888 home = xs_dict_append(home, "version", xs_stock(0));
2888 home = xs_dict_append(home, "updated_at", tid(0)); 2889 home = xs_dict_append(home, "updated_at", s_tid);
2889 data = xs_dict_set(data, "home", home); 2890 data = xs_dict_set(data, "home", home);
2890 written = xs_dict_append(written, "home", home); 2891 written = xs_dict_append(written, "home", home);
2891 } 2892 }
2892 2893
2893 if (!xs_is_null(notify_marker)) { 2894 if (!xs_is_null(notify_marker)) {
2894 xs_dict *notify = xs_dict_new(); 2895 xs *notify = xs_dict_new();
2896 xs *s_tid = tid(0);
2895 notify = xs_dict_append(notify, "last_read_id", notify_marker); 2897 notify = xs_dict_append(notify, "last_read_id", notify_marker);
2896 notify = xs_dict_append(notify, "version", xs_stock(0)); 2898 notify = xs_dict_append(notify, "version", xs_stock(0));
2897 notify = xs_dict_append(notify, "updated_at", tid(0)); 2899 notify = xs_dict_append(notify, "updated_at", s_tid);
2898 data = xs_dict_set(data, "notifications", notify); 2900 data = xs_dict_set(data, "notifications", notify);
2899 written = xs_dict_append(written, "notifications", notify); 2901 written = xs_dict_append(written, "notifications", notify);
2900 } 2902 }