aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-12-20 09:04:17 +0100
committerdefault <nobody@localhost>2024-12-20 09:04:17 +0100
commit156d5280196c948369b186999a74c7062272b5b2 (patch)
tree18f5c38d052b4ace38142ce09202a4d3f3e6be72 /html.c
parent55fb7dcbef819478c8d54a0161fb1330622a762e (diff)
Add contact metrics to og:description.
Diffstat (limited to 'html.c')
-rw-r--r--html.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/html.c b/html.c
index 8c00961..d85c673 100644
--- a/html.c
+++ b/html.c
@@ -642,6 +642,17 @@ xs_html *html_user_head(snac *user, const char *desc, const char *url)
else
s_desc = xs_dup(desc);
+ /* show metrics in og:description? */
+ if (xs_is_true(xs_dict_get(user->config, "show_contact_metrics"))) {
+ xs *fwers = follower_list(user);
+ xs *fwing = following_list(user);
+
+ xs *s1 = xs_fmt(L("%d following, %d followers ยท "),
+ xs_list_len(fwing), xs_list_len(fwers));
+
+ s_desc = xs_str_prepend_i(s_desc, s1);
+ }
+
/* shorten desc to a reasonable size */
for (n = 0; s_desc[n]; n++) {
if (n > 512 && (s_desc[n] == ' ' || s_desc[n] == '\n'))