diff options
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c index 32d0697..6770039 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -972,6 +972,26 @@ xs_dict *msg_actor(snac *snac) | |||
| 972 | msg = xs_dict_set(msg, "image", d); | 972 | msg = xs_dict_set(msg, "image", d); |
| 973 | } | 973 | } |
| 974 | 974 | ||
| 975 | /* add the metadata as attachments of PropertyValue */ | ||
| 976 | xs_dict *metadata = xs_dict_get(snac->config, "metadata"); | ||
| 977 | if (xs_type(metadata) == XSTYPE_DICT) { | ||
| 978 | xs *attach = xs_list_new(); | ||
| 979 | xs_str *k; | ||
| 980 | xs_str *v; | ||
| 981 | |||
| 982 | while (xs_dict_iter(&metadata, &k, &v)) { | ||
| 983 | xs *d = xs_dict_new(); | ||
| 984 | |||
| 985 | d = xs_dict_append(d, "type", "PropertyValue"); | ||
| 986 | d = xs_dict_append(d, "name", k); | ||
| 987 | d = xs_dict_append(d, "value", v); | ||
| 988 | |||
| 989 | attach = xs_list_append(attach, d); | ||
| 990 | } | ||
| 991 | |||
| 992 | msg = xs_dict_set(msg, "attachment", attach); | ||
| 993 | } | ||
| 994 | |||
| 975 | return msg; | 995 | return msg; |
| 976 | } | 996 | } |
| 977 | 997 | ||