diff options
| author | 2023-07-14 09:05:27 +0200 | |
|---|---|---|
| committer | 2023-07-14 09:05:27 +0200 | |
| commit | 43d2e80dc55b1bdea7ca31b5350eefc56a62fffe (patch) | |
| tree | 31af6daf3f512a49973a5615a3f66491289b0b3a | |
| parent | Fixed prototypes. (diff) | |
| download | penes-snac2-43d2e80dc55b1bdea7ca31b5350eefc56a62fffe.tar.gz penes-snac2-43d2e80dc55b1bdea7ca31b5350eefc56a62fffe.tar.xz penes-snac2-43d2e80dc55b1bdea7ca31b5350eefc56a62fffe.zip | |
Use the right object id when storing Announce + Create + Note objects.
| -rw-r--r-- | activitypub.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/activitypub.c b/activitypub.c index 0b621d4..665d54e 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -177,12 +177,14 @@ int timeline_request(snac *snac, char **id, xs_str **wrk, int level) | |||
| 177 | if (xs_is_null(type)) | 177 | if (xs_is_null(type)) |
| 178 | type = "(null)"; | 178 | type = "(null)"; |
| 179 | 179 | ||
| 180 | srv_debug(0, xs_fmt("timeline_request type %s '%s'", *id, type)); | 180 | srv_debug(0, xs_fmt("timeline_request type %s '%s'", nid, type)); |
| 181 | 181 | ||
| 182 | if (strcmp(type, "Create") == 0) { | 182 | if (strcmp(type, "Create") == 0) { |
| 183 | /* some software like lemmy nest Announce + Create + Note */ | 183 | /* some software like lemmy nest Announce + Create + Note */ |
| 184 | if (!xs_is_null(object = xs_dict_get(object, "object"))) | 184 | if (!xs_is_null(object = xs_dict_get(object, "object"))) { |
| 185 | type = xs_dict_get(object, "type"); | 185 | type = xs_dict_get(object, "type"); |
| 186 | nid = xs_dict_get(object, "id"); | ||
| 187 | } | ||
| 186 | else | 188 | else |
| 187 | type = "(null)"; | 189 | type = "(null)"; |
| 188 | } | 190 | } |
| @@ -198,7 +200,7 @@ int timeline_request(snac *snac, char **id, xs_str **wrk, int level) | |||
| 198 | char *in_reply_to = xs_dict_get(object, "inReplyTo"); | 200 | char *in_reply_to = xs_dict_get(object, "inReplyTo"); |
| 199 | 201 | ||
| 200 | /* store */ | 202 | /* store */ |
| 201 | timeline_add(snac, *id, object); | 203 | timeline_add(snac, nid, object); |
| 202 | 204 | ||
| 203 | /* recurse! */ | 205 | /* recurse! */ |
| 204 | if (level < 32) | 206 | if (level < 32) |