mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
Added support for one-entry timeline.
This commit is contained in:
parent
a66bbd4360
commit
f124d7accb
2 changed files with 15 additions and 3 deletions
17
html.c
17
html.c
|
@ -721,15 +721,26 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char *
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (xs_startswith(p_path, "p/") == 0) {
|
if (xs_startswith(p_path, "p/")) {
|
||||||
/* a timeline with just one entry */
|
/* a timeline with just one entry */
|
||||||
|
xs *id = xs_fmt("%s/%s", snac.actor, p_path);
|
||||||
|
xs *fn = _timeline_find_fn(&snac, id);
|
||||||
|
|
||||||
|
if (fn != NULL) {
|
||||||
|
xs *list = xs_list_new();
|
||||||
|
list = xs_list_append(list, fn);
|
||||||
|
|
||||||
|
*body = html_timeline(&snac, list, 1);
|
||||||
|
*b_size = strlen(*body);
|
||||||
|
status = 200;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (xs_startswith(p_path, "s/") == 0) {
|
if (xs_startswith(p_path, "s/")) {
|
||||||
/* a static file */
|
/* a static file */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (xs_startswith(p_path, "h/") == 0) {
|
if (xs_startswith(p_path, "h/")) {
|
||||||
/* an entry from the history */
|
/* an entry from the history */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
1
snac.h
1
snac.h
|
@ -61,6 +61,7 @@ int follower_check(snac *snac, char *actor);
|
||||||
d_char *follower_list(snac *snac);
|
d_char *follower_list(snac *snac);
|
||||||
|
|
||||||
int timeline_here(snac *snac, char *id);
|
int timeline_here(snac *snac, char *id);
|
||||||
|
d_char *_timeline_find_fn(snac *snac, char *id);
|
||||||
d_char *timeline_find(snac *snac, char *id);
|
d_char *timeline_find(snac *snac, char *id);
|
||||||
void timeline_del(snac *snac, char *id);
|
void timeline_del(snac *snac, char *id);
|
||||||
d_char *timeline_get(snac *snac, char *fn);
|
d_char *timeline_get(snac *snac, char *fn);
|
||||||
|
|
Loading…
Reference in a new issue