mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 14:35:04 +00:00
New function timeline_simple_list().
This commit is contained in:
parent
2614a8b3cb
commit
af6d31ff83
5 changed files with 17 additions and 10 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
A big disk layout rework, to make it more efficient when timelines get very big. Please take note that you must run `snac upgrade` when you install this version over an already existing one.
|
||||
|
||||
Fixed HTML loose close tag (contributed by kensata).
|
||||
Fixed HTML loose close tag (contributed by kensanata).
|
||||
|
||||
Fixed bug when closing sendmail pipe (contributed by jpgarcia and themusicgod1).
|
||||
|
||||
|
|
|
@ -1094,7 +1094,7 @@ int activitypub_get_handler(d_char *req, char *q_path,
|
|||
else
|
||||
if (strcmp(p_path, "outbox") == 0) {
|
||||
xs *id = xs_fmt("%s/outbox", snac.actor);
|
||||
xs *elems = timeline_list(&snac, "public", 20);
|
||||
xs *elems = timeline_simple_list(&snac, "public", 20);
|
||||
xs *list = xs_list_new();
|
||||
msg = msg_collection(&snac, id);
|
||||
char *p, *v;
|
||||
|
|
16
data.c
16
data.c
|
@ -839,8 +839,8 @@ d_char *timeline_top_level(d_char *list)
|
|||
}
|
||||
|
||||
|
||||
d_char *timeline_list(snac *snac, const char *idx_name, int max)
|
||||
/* returns a timeline */
|
||||
d_char *timeline_simple_list(snac *snac, const char *idx_name, int max)
|
||||
/* returns a timeline (with all entries) */
|
||||
{
|
||||
int c_max;
|
||||
|
||||
|
@ -851,8 +851,16 @@ d_char *timeline_list(snac *snac, const char *idx_name, int max)
|
|||
if (max > c_max)
|
||||
max = c_max;
|
||||
|
||||
xs *idx = xs_fmt("%s/%s.idx", snac->basedir, idx_name);
|
||||
xs *list = index_list_desc(idx, max);
|
||||
xs *idx = xs_fmt("%s/%s.idx", snac->basedir, idx_name);
|
||||
|
||||
return index_list_desc(idx, max);
|
||||
}
|
||||
|
||||
|
||||
d_char *timeline_list(snac *snac, const char *idx_name, int max)
|
||||
/* returns a timeline (only top level entries) */
|
||||
{
|
||||
xs *list = timeline_simple_list(snac, idx_name, max);
|
||||
|
||||
return timeline_top_level(list);
|
||||
}
|
||||
|
|
6
html.c
6
html.c
|
@ -549,8 +549,6 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, int local, int level, int
|
|||
}
|
||||
|
||||
if (level == 0) {
|
||||
char *p;
|
||||
|
||||
s = xs_str_cat(s, "<div class=\"snac-post\">\n");
|
||||
|
||||
if (boosts == NULL)
|
||||
|
@ -558,7 +556,7 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, int local, int level, int
|
|||
|
||||
if (xs_list_len(boosts)) {
|
||||
/* if somebody boosted this, show as origin */
|
||||
p = xs_list_get(boosts, 0);
|
||||
char *p = xs_list_get(boosts, -1);
|
||||
xs *actor_r = NULL;
|
||||
|
||||
if (xs_list_in(boosts, snac->md5) != -1) {
|
||||
|
@ -1096,7 +1094,7 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char *
|
|||
if (strcmp(p_path, ".rss") == 0) {
|
||||
/* public timeline in RSS format */
|
||||
d_char *rss;
|
||||
xs *elems = timeline_list(&snac, "public", 20);
|
||||
xs *elems = timeline_simple_list(&snac, "public", 20);
|
||||
xs *bio = not_really_markdown(xs_dict_get(snac.config, "bio"));
|
||||
char *p, *v;
|
||||
|
||||
|
|
1
snac.h
1
snac.h
|
@ -79,6 +79,7 @@ d_char *follower_list(snac *snac);
|
|||
|
||||
double timeline_mtime(snac *snac);
|
||||
int timeline_del(snac *snac, char *id);
|
||||
d_char *timeline_simple_list(snac *snac, const char *idx_name, int max);
|
||||
d_char *timeline_list(snac *snac, const char *idx_name, int max);
|
||||
int timeline_add(snac *snac, char *id, char *o_msg, char *parent, char *referrer);
|
||||
void timeline_admire(snac *snac, char *o_msg, char *id, char *admirer, int like);
|
||||
|
|
Loading…
Reference in a new issue