commit 20af5d6

default  ·  2024-08-01 16:48:01 +0000 UTC
parent f14ea27
In 'Move' notifications, show the old account below the originator one.
1 files changed,  +16, -0
M html.c
M html.c
+16, -0
 1@@ -2531,6 +2531,22 @@ xs_str *html_notifications(snac *user, int skip, int show)
 2                     xs_html_attr("class", "snac-post"),
 3                     html_actor_icon(user, actor, NULL, NULL, NULL, 0, 0)));
 4         }
 5+        else
 6+        if (strcmp(type, "Move") == 0) {
 7+            const xs_dict *o_msg = xs_dict_get(noti, "msg");
 8+            const char *target;
 9+
10+            if (xs_type(o_msg) == XSTYPE_DICT && (target = xs_dict_get(o_msg, "target"))) {
11+                xs *old_actor = NULL;
12+
13+                if (valid_status(actor_get(target, &old_actor))) {
14+                    xs_html_add(entry,
15+                        xs_html_tag("div",
16+                            xs_html_attr("class", "snac-post"),
17+                            html_actor_icon(user, old_actor, NULL, NULL, NULL, 0, 0)));
18+                }
19+            }
20+        }
21         else {
22             xs *md5 = xs_md5_hex(id, strlen(id));
23