commit 1001744

default  ·  2024-07-31 04:22:13 +0000 UTC
parent a09ea11
Notify objects include the original message.
3 files changed,  +6, -3
M data.c
M snac.h
+3, -1
 1@@ -949,7 +949,7 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor,
 2     if (strcmp(utype, "Follow") == 0)
 3         objid = actor;
 4 
 5-    notify_add(snac, type, utype, actor, objid != NULL ? objid : id);
 6+    notify_add(snac, type, utype, actor, objid != NULL ? objid : id, msg);
 7 }
 8 
 9 /** messages **/
10@@ -2180,6 +2180,8 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
11 
12                                 snac_log(snac, xs_fmt("'Move': unfollowing %s", old_account));
13                             }
14+
15+                            do_notify = 1;
16                         }
17                         else
18                             snac_log(snac, xs_fmt("'Move' error: old actor %s not found in %s 'alsoKnownAs'",
M data.c
+2, -1
 1@@ -2517,7 +2517,7 @@ xs_str *notify_check_time(snac *snac, int reset)
 2 
 3 
 4 void notify_add(snac *snac, const char *type, const char *utype,
 5-                const char *actor, const char *objid)
 6+                const char *actor, const char *objid, const xs_dict *msg)
 7 /* adds a new notification */
 8 {
 9     xs *ntid = tid(0);
10@@ -2537,6 +2537,7 @@ void notify_add(snac *snac, const char *type, const char *utype,
11     noti = xs_dict_append(noti, "utype", utype);
12     noti = xs_dict_append(noti, "actor", actor);
13     noti = xs_dict_append(noti, "date",  date);
14+    noti = xs_dict_append(noti, "msg",   msg);
15 
16     if (!xs_is_null(objid))
17         noti = xs_dict_append(noti, "objid", objid);
M snac.h
+1, -1
1@@ -207,7 +207,7 @@ void lastlog_write(snac *snac, const char *source);
2 
3 xs_str *notify_check_time(snac *snac, int reset);
4 void notify_add(snac *snac, const char *type, const char *utype,
5-                const char *actor, const char *objid);
6+                const char *actor, const char *objid, const xs_dict *msg);
7 xs_dict *notify_get(snac *snac, const char *id);
8 int notify_new_num(snac *snac);
9 xs_list *notify_list(snac *snac, int skip, int show);