summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authorGravatar default2022-10-02 18:16:58 +0200
committerGravatar default2022-10-02 18:16:58 +0200
commitf82124a705d9c5350b92fba6a03c556c1fd5b2b0 (patch)
tree0382d0058097f25340de8077c5498a46b05736bd /data.c
parentImplemented local timeline cache. (diff)
downloadsnac2-f82124a705d9c5350b92fba6a03c556c1fd5b2b0.tar.gz
snac2-f82124a705d9c5350b92fba6a03c556c1fd5b2b0.tar.xz
snac2-f82124a705d9c5350b92fba6a03c556c1fd5b2b0.zip
The history is shown at the bottom of the local timeline.
Diffstat (limited to 'data.c')
-rw-r--r--data.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/data.c b/data.c
index 5de26c1..8c07a7b 100644
--- a/data.c
+++ b/data.c
@@ -914,6 +914,37 @@ int history_del(snac *snac, char *id)
914} 914}
915 915
916 916
917d_char *history_list(snac *snac)
918{
919 d_char *list;
920 xs *spec;
921 glob_t globbuf;
922
923 list = xs_list_new();
924 spec = xs_fmt("%s/history/" "*.html", snac->basedir);
925
926 if (glob(spec, 0, NULL, &globbuf) == 0) {
927 int n;
928 char *fn;
929
930 for (n = 0; (fn = globbuf.gl_pathv[n]) != NULL; n++) {
931 char *p;
932
933 if ((p = strrchr(fn, '/')) != NULL) {
934 *p++ = '\0';
935
936 if (*p != '_')
937 list = xs_list_append(list, p);
938 }
939 }
940 }
941
942 globfree(&globbuf);
943
944 return list;
945}
946
947
917void enqueue_input(snac *snac, char *msg, char *req, int retries) 948void enqueue_input(snac *snac, char *msg, char *req, int retries)
918/* enqueues an input message */ 949/* enqueues an input message */
919{ 950{