summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-05-30 14:58:41 +0200
committerGravatar default2023-05-30 14:58:41 +0200
commitf2a91d8d4802ae6c6c604af07b2ff98a2a3c2b4f (patch)
tree4eec795293fc6c5a64eba588689cfabcadaba435
parentAdd ended polls to the notification area. (diff)
downloadsnac2-f2a91d8d4802ae6c6c604af07b2ff98a2a3c2b4f.tar.gz
snac2-f2a91d8d4802ae6c6c604af07b2ff98a2a3c2b4f.tar.xz
snac2-f2a91d8d4802ae6c6c604af07b2ff98a2a3c2b4f.zip
Label closed polls correctly in the notification area.
-rw-r--r--html.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/html.c b/html.c
index 38cdfe6..8854d0c 100644
--- a/html.c
+++ b/html.c
@@ -1352,8 +1352,9 @@ xs_str *html_notifications(snac *snac)
1352 continue; 1352 continue;
1353 1353
1354 xs *obj = NULL; 1354 xs *obj = NULL;
1355 const char *type = xs_dict_get(noti, "type"); 1355 const char *type = xs_dict_get(noti, "type");
1356 const char *id = xs_dict_get(noti, "objid"); 1356 const char *utype = xs_dict_get(noti, "utype");
1357 const char *id = xs_dict_get(noti, "objid");
1357 1358
1358 if (!valid_status(object_get(id, &obj))) 1359 if (!valid_status(object_get(id, &obj)))
1359 continue; 1360 continue;
@@ -1390,8 +1391,16 @@ xs_str *html_notifications(snac *snac)
1390 1391
1391 s = xs_str_cat(s, "<div>\n"); 1392 s = xs_str_cat(s, "<div>\n");
1392 1393
1394 const char *label = type;
1395
1396 if (strcmp(type, "Create") == 0)
1397 label = L("Mention");
1398 else
1399 if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0)
1400 label = L("Finished poll");
1401
1393 xs *s1 = xs_fmt("<p><b>%s by <a href=\"%s\">%s</a></b>:</p>\n", 1402 xs *s1 = xs_fmt("<p><b>%s by <a href=\"%s\">%s</a></b>:</p>\n",
1394 strcmp(type, "Create") == 0 ? "Mention" : type, actor_id, a_name); 1403 label, actor_id, a_name);
1395 s = xs_str_cat(s, s1); 1404 s = xs_str_cat(s, s1);
1396 1405
1397 if (strcmp(type, "Follow") == 0) { 1406 if (strcmp(type, "Follow") == 0) {