commit f2a91d8

default  ·  2023-05-30 12:58:41 +0000 UTC
parent dc9d652
Label closed polls correctly in the notification area.
1 files changed,  +12, -3
M html.c
M html.c
+12, -3
 1@@ -1352,8 +1352,9 @@ xs_str *html_notifications(snac *snac)
 2             continue;
 3 
 4         xs *obj = NULL;
 5-        const char *type = xs_dict_get(noti, "type");
 6-        const char *id   = xs_dict_get(noti, "objid");
 7+        const char *type  = xs_dict_get(noti, "type");
 8+        const char *utype = xs_dict_get(noti, "utype");
 9+        const char *id    = xs_dict_get(noti, "objid");
10 
11         if (!valid_status(object_get(id, &obj)))
12             continue;
13@@ -1390,8 +1391,16 @@ xs_str *html_notifications(snac *snac)
14 
15         s = xs_str_cat(s, "<div>\n");
16 
17+        const char *label = type;
18+
19+        if (strcmp(type, "Create") == 0)
20+            label = L("Mention");
21+        else
22+        if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0)
23+            label = L("Finished poll");
24+
25         xs *s1 = xs_fmt("<p><b>%s by <a href=\"%s\">%s</a></b>:</p>\n",
26-            strcmp(type, "Create") == 0 ? "Mention" : type, actor_id, a_name);
27+            label, actor_id, a_name);
28         s = xs_str_cat(s, s1);
29 
30         if (strcmp(type, "Follow") == 0) {