commit f5d3859
default
·
2023-02-08 13:47:23 +0000 UTC
parent 5d126d0
Added the user to the notification.
1 files changed,
+6,
-3
+6,
-3
1@@ -780,10 +780,10 @@ xs_dict *msg_note(snac *snac, xs_str *content, xs_val *rcpts, xs_str *in_reply_t
2 }
3
4
5-void notify(snac *snac, char *type, char *utype, char *actor, char *msg)
6+void notify(snac *snac, xs_str *type, xs_str *utype, xs_str *actor, xs_dict *msg)
7 /* notifies the user of relevant events */
8 {
9- char *object = NULL;
10+ xs_val *object = NULL;
11
12 if (strcmp(type, "Create") == 0) {
13 /* only notify of notes specifically for us */
14@@ -812,7 +812,10 @@ void notify(snac *snac, char *type, char *utype, char *actor, char *msg)
15 }
16
17 /* prepare message body */
18- xs *body = xs_str_new(NULL);
19+ xs *body = xs_fmt("User : @%s@%s\n",
20+ xs_dict_get(snac->config, "uid"),
21+ xs_dict_get(srv_config, "host")
22+ );
23
24 if (strcmp(utype, "(null)") != 0) {
25 xs *s1 = xs_fmt("Type : %s + %s\n", type, utype);