From 7db4de872d043593b63de09cea27bd350e3e5f58 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 4 Jul 2023 14:07:33 +0200 Subject: Also show unfollows in the notification area. --- activitypub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activitypub.c') diff --git a/activitypub.c b/activitypub.c index ce72f3f..de7de6a 100644 --- a/activitypub.c +++ b/activitypub.c @@ -686,7 +686,7 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor, enqueue_telegram(body, bot, chat_id); /* finally, store it in the notification folder */ - if (strcmp(type, "Follow") == 0) + if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) objid = id; notify_add(snac, type, utype, actor, objid != NULL ? objid : id); -- cgit v1.2.3 From 78b468f013cc2624a4b9044393eb2c86556c98b7 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 4 Jul 2023 14:23:12 +0200 Subject: More unfollow notification tweaks. --- activitypub.c | 5 ++++- html.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'activitypub.c') diff --git a/activitypub.c b/activitypub.c index de7de6a..d0ef866 100644 --- a/activitypub.c +++ b/activitypub.c @@ -686,8 +686,11 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor, enqueue_telegram(body, bot, chat_id); /* finally, store it in the notification folder */ - if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) + if (strcmp(type, "Follow") == 0) objid = id; + else + if (strcmp(utype, "Follow") == 0) + objid = actor; notify_add(snac, type, utype, actor, objid != NULL ? objid : id); } diff --git a/html.c b/html.c index ce7f511..c9d6edd 100644 --- a/html.c +++ b/html.c @@ -1510,7 +1510,7 @@ xs_str *html_notifications(snac *snac) if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) { s = xs_str_cat(s, "
\n"); - s = html_msg_icon(snac, s, obj); + s = html_actor_icon(s, actor, NULL, NULL, NULL, 0); s = xs_str_cat(s, "
\n"); } -- cgit v1.2.3 From 6fce560f015ba126675a770f035bff3971f64f1c Mon Sep 17 00:00:00 2001 From: default Date: Tue, 4 Jul 2023 16:54:41 +0200 Subject: The actor bio now accepts tags. --- activitypub.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'activitypub.c') diff --git a/activitypub.c b/activitypub.c index d0ef866..4791ac3 100644 --- a/activitypub.c +++ b/activitypub.c @@ -839,6 +839,7 @@ xs_dict *msg_actor(snac *snac) xs *ctxt = xs_list_new(); xs *icon = xs_dict_new(); xs *keys = xs_dict_new(); + xs *tags = xs_list_new(); xs *avtr = NULL; xs *kid = NULL; xs *f_bio = NULL; @@ -856,8 +857,10 @@ xs_dict *msg_actor(snac *snac) msg = xs_dict_set(msg, "preferredUsername", snac->uid); msg = xs_dict_set(msg, "published", xs_dict_get(snac->config, "published")); - f_bio = not_really_markdown(xs_dict_get(snac->config, "bio"), NULL); + xs *f_bio_2 = not_really_markdown(xs_dict_get(snac->config, "bio"), NULL); + process_tags(snac, f_bio_2, &f_bio, &tags); msg = xs_dict_set(msg, "summary", f_bio); + msg = xs_dict_set(msg, "tag", tags); char *folders[] = { "inbox", "outbox", "followers", "following", NULL }; for (n = 0; folders[n]; n++) { -- cgit v1.2.3 From 7e5b02be3f3c4bf3b215f300dae240c23065919f Mon Sep 17 00:00:00 2001 From: default Date: Tue, 4 Jul 2023 16:57:17 +0200 Subject: Fixed weird prototype of process_tags(). --- activitypub.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'activitypub.c') diff --git a/activitypub.c b/activitypub.c index 4791ac3..fa592e7 100644 --- a/activitypub.c +++ b/activitypub.c @@ -449,7 +449,7 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg) } -void process_tags(snac *snac, const char *content, xs_str **n_content, xs_list **tag) +xs_str *process_tags(snac *snac, const char *content, xs_list **tag) /* parses mentions and tags from content */ { 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 * n++; } - *n_content = nc; - *tag = tl; + *tag = tl; + + return nc; } @@ -858,7 +859,7 @@ xs_dict *msg_actor(snac *snac) msg = xs_dict_set(msg, "published", xs_dict_get(snac->config, "published")); xs *f_bio_2 = not_really_markdown(xs_dict_get(snac->config, "bio"), NULL); - process_tags(snac, f_bio_2, &f_bio, &tags); + f_bio = process_tags(snac, f_bio_2, &tags); msg = xs_dict_set(msg, "summary", f_bio); msg = xs_dict_set(msg, "tag", tags); @@ -1059,7 +1060,7 @@ xs_dict *msg_note(snac *snac, const xs_str *content, const xs_val *rcpts, irt = xs_val_new(XSTYPE_NULL); /* extract the mentions and hashtags and convert the content */ - process_tags(snac, fc2, &fc1, &tag); + fc1 = process_tags(snac, fc2, &tag); /* create the attachment list, if there are any */ if (!xs_is_null(attach)) { -- cgit v1.2.3