mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
Label closed polls correctly in the notification area.
This commit is contained in:
parent
dc9d6520ee
commit
f2a91d8d48
1 changed files with 12 additions and 3 deletions
11
html.c
11
html.c
|
@ -1353,6 +1353,7 @@ xs_str *html_notifications(snac *snac)
|
|||
|
||||
xs *obj = NULL;
|
||||
const char *type = xs_dict_get(noti, "type");
|
||||
const char *utype = xs_dict_get(noti, "utype");
|
||||
const char *id = xs_dict_get(noti, "objid");
|
||||
|
||||
if (!valid_status(object_get(id, &obj)))
|
||||
|
@ -1390,8 +1391,16 @@ xs_str *html_notifications(snac *snac)
|
|||
|
||||
s = xs_str_cat(s, "<div>\n");
|
||||
|
||||
const char *label = type;
|
||||
|
||||
if (strcmp(type, "Create") == 0)
|
||||
label = L("Mention");
|
||||
else
|
||||
if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0)
|
||||
label = L("Finished poll");
|
||||
|
||||
xs *s1 = xs_fmt("<p><b>%s by <a href=\"%s\">%s</a></b>:</p>\n",
|
||||
strcmp(type, "Create") == 0 ? "Mention" : type, actor_id, a_name);
|
||||
label, actor_id, a_name);
|
||||
s = xs_str_cat(s, s1);
|
||||
|
||||
if (strcmp(type, "Follow") == 0) {
|
||||
|
|
Loading…
Reference in a new issue