mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-29 07:53:37 +00:00
If it's a one-post-only page, show the post content instead of the bio.
This commit is contained in:
parent
89b64de531
commit
c33fa82755
1 changed files with 15 additions and 5 deletions
20
html.c
20
html.c
|
@ -597,12 +597,21 @@ xs_html *html_user_head(snac *user, char *desc)
|
||||||
|
|
||||||
/* create a description field */
|
/* create a description field */
|
||||||
xs *s_desc = NULL;
|
xs *s_desc = NULL;
|
||||||
|
int n;
|
||||||
|
|
||||||
if (desc == NULL)
|
if (desc == NULL)
|
||||||
s_desc = xs_dup(xs_dict_get(user->config, "bio"));
|
s_desc = xs_dup(xs_dict_get(user->config, "bio"));
|
||||||
else
|
else
|
||||||
s_desc = xs_dup(desc);
|
s_desc = xs_dup(desc);
|
||||||
|
|
||||||
|
/* shorten desc to a reasonable size */
|
||||||
|
for (n = 0; s_desc[n]; n++) {
|
||||||
|
if (n > 256 && (s_desc[n] == ' ' || s_desc[n] == '\n'))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
s_desc[n] = '\0';
|
||||||
|
|
||||||
/* og properties */
|
/* og properties */
|
||||||
xs_html_add(head,
|
xs_html_add(head,
|
||||||
xs_html_sctag("meta",
|
xs_html_sctag("meta",
|
||||||
|
@ -1849,15 +1858,16 @@ xs_str *html_timeline(snac *user, const xs_list *list, int local,
|
||||||
char *v;
|
char *v;
|
||||||
double t = ftime();
|
double t = ftime();
|
||||||
|
|
||||||
char *desc = NULL;
|
xs *desc = NULL;
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (xs_list_len(list) == 1) {
|
if (xs_list_len(list) == 1) {
|
||||||
/* only one element? pick the description from the source */
|
/* only one element? pick the description from the source */
|
||||||
xs_dict *d = xs_list_get(list, 0);
|
char *id = xs_list_get(list, 0);
|
||||||
desc = xs_dict_get(d, "sourceContent");
|
xs *d = NULL;
|
||||||
|
object_get_by_md5(id, &d);
|
||||||
|
if (d && (v = xs_dict_get(d, "sourceContent")) != NULL)
|
||||||
|
desc = xs_dup(v);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
xs_html *head;
|
xs_html *head;
|
||||||
xs_html *body;
|
xs_html *body;
|
||||||
|
|
Loading…
Reference in a new issue