diff options
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/activitypub.c b/activitypub.c index ce72f3f..fa592e7 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -449,7 +449,7 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg) | |||
| 449 | } | 449 | } |
| 450 | 450 | ||
| 451 | 451 | ||
| 452 | void process_tags(snac *snac, const char *content, xs_str **n_content, xs_list **tag) | 452 | xs_str *process_tags(snac *snac, const char *content, xs_list **tag) |
| 453 | /* parses mentions and tags from content */ | 453 | /* parses mentions and tags from content */ |
| 454 | { | 454 | { |
| 455 | xs_str *nc = xs_str_new(NULL); | 455 | xs_str *nc = xs_str_new(NULL); |
| @@ -559,8 +559,9 @@ void process_tags(snac *snac, const char *content, xs_str **n_content, xs_list * | |||
| 559 | n++; | 559 | n++; |
| 560 | } | 560 | } |
| 561 | 561 | ||
| 562 | *n_content = nc; | 562 | *tag = tl; |
| 563 | *tag = tl; | 563 | |
| 564 | return nc; | ||
| 564 | } | 565 | } |
| 565 | 566 | ||
| 566 | 567 | ||
| @@ -688,6 +689,9 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor, | |||
| 688 | /* finally, store it in the notification folder */ | 689 | /* finally, store it in the notification folder */ |
| 689 | if (strcmp(type, "Follow") == 0) | 690 | if (strcmp(type, "Follow") == 0) |
| 690 | objid = id; | 691 | objid = id; |
| 692 | else | ||
| 693 | if (strcmp(utype, "Follow") == 0) | ||
| 694 | objid = actor; | ||
| 691 | 695 | ||
| 692 | notify_add(snac, type, utype, actor, objid != NULL ? objid : id); | 696 | notify_add(snac, type, utype, actor, objid != NULL ? objid : id); |
| 693 | } | 697 | } |
| @@ -836,6 +840,7 @@ xs_dict *msg_actor(snac *snac) | |||
| 836 | xs *ctxt = xs_list_new(); | 840 | xs *ctxt = xs_list_new(); |
| 837 | xs *icon = xs_dict_new(); | 841 | xs *icon = xs_dict_new(); |
| 838 | xs *keys = xs_dict_new(); | 842 | xs *keys = xs_dict_new(); |
| 843 | xs *tags = xs_list_new(); | ||
| 839 | xs *avtr = NULL; | 844 | xs *avtr = NULL; |
| 840 | xs *kid = NULL; | 845 | xs *kid = NULL; |
| 841 | xs *f_bio = NULL; | 846 | xs *f_bio = NULL; |
| @@ -853,8 +858,10 @@ xs_dict *msg_actor(snac *snac) | |||
| 853 | msg = xs_dict_set(msg, "preferredUsername", snac->uid); | 858 | msg = xs_dict_set(msg, "preferredUsername", snac->uid); |
| 854 | msg = xs_dict_set(msg, "published", xs_dict_get(snac->config, "published")); | 859 | msg = xs_dict_set(msg, "published", xs_dict_get(snac->config, "published")); |
| 855 | 860 | ||
| 856 | f_bio = not_really_markdown(xs_dict_get(snac->config, "bio"), NULL); | 861 | xs *f_bio_2 = not_really_markdown(xs_dict_get(snac->config, "bio"), NULL); |
| 862 | f_bio = process_tags(snac, f_bio_2, &tags); | ||
| 857 | msg = xs_dict_set(msg, "summary", f_bio); | 863 | msg = xs_dict_set(msg, "summary", f_bio); |
| 864 | msg = xs_dict_set(msg, "tag", tags); | ||
| 858 | 865 | ||
| 859 | char *folders[] = { "inbox", "outbox", "followers", "following", NULL }; | 866 | char *folders[] = { "inbox", "outbox", "followers", "following", NULL }; |
| 860 | for (n = 0; folders[n]; n++) { | 867 | for (n = 0; folders[n]; n++) { |
| @@ -1053,7 +1060,7 @@ xs_dict *msg_note(snac *snac, const xs_str *content, const xs_val *rcpts, | |||
| 1053 | irt = xs_val_new(XSTYPE_NULL); | 1060 | irt = xs_val_new(XSTYPE_NULL); |
| 1054 | 1061 | ||
| 1055 | /* extract the mentions and hashtags and convert the content */ | 1062 | /* extract the mentions and hashtags and convert the content */ |
| 1056 | process_tags(snac, fc2, &fc1, &tag); | 1063 | fc1 = process_tags(snac, fc2, &tag); |
| 1057 | 1064 | ||
| 1058 | /* create the attachment list, if there are any */ | 1065 | /* create the attachment list, if there are any */ |
| 1059 | if (!xs_is_null(attach)) { | 1066 | if (!xs_is_null(attach)) { |