mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Also show the 'updated' timestamp.
This commit is contained in:
parent
3d2ce3a8f3
commit
32eb3fb041
1 changed files with 24 additions and 9 deletions
25
html.c
25
html.c
|
@ -37,7 +37,8 @@ int login(snac *snac, char *headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
d_char *html_actor_icon(snac *snac, d_char *os, char *actor, char *date, char *url, int priv)
|
d_char *html_actor_icon(snac *snac, d_char *os, char *actor,
|
||||||
|
const char *date, const char *udate, const char *url, int priv)
|
||||||
{
|
{
|
||||||
xs *s = xs_str_new(NULL);
|
xs *s = xs_str_new(NULL);
|
||||||
|
|
||||||
|
@ -107,10 +108,22 @@ d_char *html_actor_icon(snac *snac, d_char *os, char *actor, char *date, char *u
|
||||||
s = xs_str_cat(s, "<br>\n \n");
|
s = xs_str_cat(s, "<br>\n \n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
xs *sd = xs_crop(xs_dup(date), 0, 10);
|
xs *date_label = xs_crop(xs_dup(date), 0, 10);
|
||||||
|
xs *date_title = xs_dup(date);
|
||||||
|
|
||||||
|
if (!xs_is_null(udate)) {
|
||||||
|
xs *sd = xs_crop(xs_dup(udate), 0, 10);
|
||||||
|
|
||||||
|
date_label = xs_str_cat(date_label, " / ");
|
||||||
|
date_label = xs_str_cat(date_label, sd);
|
||||||
|
|
||||||
|
date_title = xs_str_cat(date_title, " / ");
|
||||||
|
date_title = xs_str_cat(date_title, udate);
|
||||||
|
}
|
||||||
|
|
||||||
xs *s1 = xs_fmt(
|
xs *s1 = xs_fmt(
|
||||||
"<br>\n<time class=\"dt-published snac-pubdate\" title=\"%s\">%s</time>\n",
|
"<br>\n<time class=\"dt-published snac-pubdate\" title=\"%s\">%s</time>\n",
|
||||||
date, sd);
|
date_title, date_label);
|
||||||
|
|
||||||
s = xs_str_cat(s, s1);
|
s = xs_str_cat(s, s1);
|
||||||
}
|
}
|
||||||
|
@ -129,6 +142,7 @@ d_char *html_msg_icon(snac *snac, d_char *os, char *msg)
|
||||||
|
|
||||||
if (actor_id && valid_status(actor_get(snac, actor_id, &actor))) {
|
if (actor_id && valid_status(actor_get(snac, actor_id, &actor))) {
|
||||||
char *date = NULL;
|
char *date = NULL;
|
||||||
|
char *udate = NULL;
|
||||||
char *url = NULL;
|
char *url = NULL;
|
||||||
int priv = 0;
|
int priv = 0;
|
||||||
|
|
||||||
|
@ -138,8 +152,9 @@ d_char *html_msg_icon(snac *snac, d_char *os, char *msg)
|
||||||
priv = !is_msg_public(snac, msg);
|
priv = !is_msg_public(snac, msg);
|
||||||
|
|
||||||
date = xs_dict_get(msg, "published");
|
date = xs_dict_get(msg, "published");
|
||||||
|
udate = xs_dict_get(msg, "updated");
|
||||||
|
|
||||||
os = html_actor_icon(snac, os, actor, date, url, priv);
|
os = html_actor_icon(snac, os, actor, date, udate, url, priv);
|
||||||
}
|
}
|
||||||
|
|
||||||
return os;
|
return os;
|
||||||
|
@ -879,7 +894,7 @@ d_char *html_people_list(snac *snac, d_char *os, d_char *list, const char *heade
|
||||||
if (valid_status(actor_get(snac, actor_id, &actor))) {
|
if (valid_status(actor_get(snac, actor_id, &actor))) {
|
||||||
s = xs_str_cat(s, "<div class=\"snac-post\">\n");
|
s = xs_str_cat(s, "<div class=\"snac-post\">\n");
|
||||||
|
|
||||||
s = html_actor_icon(snac, s, actor, xs_dict_get(actor, "published"), NULL, 0);
|
s = html_actor_icon(snac, s, actor, xs_dict_get(actor, "published"), NULL, NULL, 0);
|
||||||
|
|
||||||
|
|
||||||
/* content (user bio) */
|
/* content (user bio) */
|
||||||
|
|
Loading…
Reference in a new issue