diff options
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/activitypub.c b/activitypub.c index 194511e..702840c 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -1558,37 +1558,38 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req) | |||
| 1558 | } | 1558 | } |
| 1559 | else | 1559 | else |
| 1560 | if (strcmp(type, "Announce") == 0) { /** **/ | 1560 | if (strcmp(type, "Announce") == 0) { /** **/ |
| 1561 | xs *a_msg = NULL; | 1561 | if (is_limited(snac, actor)) |
| 1562 | xs *wrk = NULL; | 1562 | snac_log(snac, xs_fmt("dropped 'Announce' from limited actor %s", actor)); |
| 1563 | else { | ||
| 1564 | xs *a_msg = NULL; | ||
| 1565 | xs *wrk = NULL; | ||
| 1563 | 1566 | ||
| 1564 | if (xs_type(object) == XSTYPE_DICT) | 1567 | if (xs_type(object) == XSTYPE_DICT) |
| 1565 | object = xs_dict_get(object, "id"); | 1568 | object = xs_dict_get(object, "id"); |
| 1566 | 1569 | ||
| 1567 | timeline_request(snac, &object, &wrk, 0); | 1570 | timeline_request(snac, &object, &wrk, 0); |
| 1568 | 1571 | ||
| 1569 | if (is_limited(snac, actor)) | 1572 | if (valid_status(object_get(object, &a_msg))) { |
| 1570 | snac_log(snac, xs_fmt("dropped 'Announce' from limited actor %s", actor)); | 1573 | const char *who = xs_dict_get(a_msg, "attributedTo"); |
| 1571 | else | ||
| 1572 | if (valid_status(object_get(object, &a_msg))) { | ||
| 1573 | const char *who = xs_dict_get(a_msg, "attributedTo"); | ||
| 1574 | 1574 | ||
| 1575 | if (who && !is_muted(snac, who)) { | 1575 | if (who && !is_muted(snac, who)) { |
| 1576 | /* bring the actor */ | 1576 | /* bring the actor */ |
| 1577 | xs *who_o = NULL; | 1577 | xs *who_o = NULL; |
| 1578 | 1578 | ||
| 1579 | if (valid_status(actor_request(snac, who, &who_o))) { | 1579 | if (valid_status(actor_request(snac, who, &who_o))) { |
| 1580 | timeline_admire(snac, object, actor, 0); | 1580 | timeline_admire(snac, object, actor, 0); |
| 1581 | snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object)); | 1581 | snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object)); |
| 1582 | do_notify = 1; | 1582 | do_notify = 1; |
| 1583 | } | ||
| 1584 | else | ||
| 1585 | snac_log(snac, xs_fmt("dropped 'Announce' on actor request error %s", who)); | ||
| 1583 | } | 1586 | } |
| 1584 | else | 1587 | else |
| 1585 | snac_log(snac, xs_fmt("dropped 'Announce' on actor request error %s", who)); | 1588 | snac_log(snac, xs_fmt("ignored 'Announce' about muted actor %s", who)); |
| 1586 | } | 1589 | } |
| 1587 | else | 1590 | else |
| 1588 | snac_log(snac, xs_fmt("ignored 'Announce' about muted actor %s", who)); | 1591 | snac_debug(snac, 1, xs_fmt("error requesting 'Announce' object %s", object)); |
| 1589 | } | 1592 | } |
| 1590 | else | ||
| 1591 | snac_debug(snac, 1, xs_fmt("error requesting 'Announce' object %s", object)); | ||
| 1592 | } | 1593 | } |
| 1593 | else | 1594 | else |
| 1594 | if (strcmp(type, "Update") == 0) { /** **/ | 1595 | if (strcmp(type, "Update") == 0) { /** **/ |