summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/activitypub.c b/activitypub.c
index 406aee8..8a91f6a 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1135,23 +1135,29 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
1135 } 1135 }
1136 else 1136 else
1137 if (strcmp(type, "Create") == 0) { 1137 if (strcmp(type, "Create") == 0) {
1138 if (is_muted(snac, actor))
1139 snac_log(snac, xs_fmt("ignored 'Create' + '%s' from muted actor %s", utype, actor));
1140
1138 if (strcmp(utype, "Note") == 0) { 1141 if (strcmp(utype, "Note") == 0) {
1139 if (is_muted(snac, actor)) 1142 char *id = xs_dict_get(object, "id");
1140 snac_log(snac, xs_fmt("ignored 'Note' from muted actor %s", actor)); 1143 char *in_reply_to = xs_dict_get(object, "inReplyTo");
1141 else { 1144 xs *wrk = NULL;
1142 char *id = xs_dict_get(object, "id");
1143 char *in_reply_to = xs_dict_get(object, "inReplyTo");
1144 xs *wrk = NULL;
1145 1145
1146 timeline_request(snac, &in_reply_to, &wrk); 1146 timeline_request(snac, &in_reply_to, &wrk);
1147 1147
1148 if (timeline_add(snac, id, object)) { 1148 if (timeline_add(snac, id, object)) {
1149 snac_log(snac, xs_fmt("new 'Note' %s %s", actor, id)); 1149 snac_log(snac, xs_fmt("new 'Note' %s %s", actor, id));
1150 do_notify = 1; 1150 do_notify = 1;
1151 }
1152 } 1151 }
1153 } 1152 }
1154 else 1153 else
1154 if (strcmp(utype, "Question") == 0) {
1155 char *id = xs_dict_get(object, "id");
1156
1157 if (timeline_add(snac, id, object))
1158 snac_log(snac, xs_fmt("new 'Question' %s %s", actor, id));
1159 }
1160 else
1155 snac_debug(snac, 1, xs_fmt("ignored 'Create' for object type '%s'", utype)); 1161 snac_debug(snac, 1, xs_fmt("ignored 'Create' for object type '%s'", utype));
1156 } 1162 }
1157 else 1163 else
@@ -1223,6 +1229,14 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
1223 snac_log(snac, xs_fmt("updated post %s", id)); 1229 snac_log(snac, xs_fmt("updated post %s", id));
1224 } 1230 }
1225 else 1231 else
1232 if (strcmp(utype, "Question") == 0) {
1233 char *id = xs_dict_get(object, "id");
1234
1235 object_add_ow(id, object);
1236
1237 snac_log(snac, xs_fmt("updated poll %s", id));
1238 }
1239 else
1226 snac_log(snac, xs_fmt("ignored 'Update' for object type '%s'", utype)); 1240 snac_log(snac, xs_fmt("ignored 'Update' for object type '%s'", utype));
1227 } 1241 }
1228 else 1242 else