summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c
index c88b0ce..afbe7af 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1168,6 +1168,33 @@ xs_dict *msg_admiration(snac *snac, char *object, char *type)
1168} 1168}
1169 1169
1170 1170
1171xs_dict *msg_repulsion(snac *user, char *id, char *type)
1172/* creates an Undo + admiration message */
1173{
1174 xs *a_msg = NULL;
1175 xs_dict *msg = NULL;
1176
1177 if (valid_status(object_get(id, &a_msg))) {
1178 /* create a clone of the original admiration message */
1179 xs *object = msg_admiration(user, id, type);
1180
1181 /* delete the published date */
1182 object = xs_dict_del(object, "published");
1183
1184 /* create an undo message for this object */
1185 msg = msg_undo(user, object);
1186
1187 /* copy the 'to' field */
1188 msg = xs_dict_set(msg, "to", xs_dict_get(object, "to"));
1189
1190 /* now we despise this */
1191 object_unadmire(id, user->actor, *type == 'L' ? 1 : 0);
1192 }
1193
1194 return msg;
1195}
1196
1197
1171xs_dict *msg_actor(snac *snac) 1198xs_dict *msg_actor(snac *snac)
1172/* create a Person message for this actor */ 1199/* create a Person message for this actor */
1173{ 1200{