diff options
| author | 2024-01-24 09:51:16 +0100 | |
|---|---|---|
| committer | 2024-01-24 09:51:16 +0100 | |
| commit | 0b08649a0d2a380f3b638c2c160aa20eefb20197 (patch) | |
| tree | 24ddfd677538b953f73e84d4f3c14bd0f5282a1c | |
| parent | Moved the mutual and bot emojis after the link, where they belong. (diff) | |
| download | snac2-0b08649a0d2a380f3b638c2c160aa20eefb20197.tar.gz snac2-0b08649a0d2a380f3b638c2c160aa20eefb20197.tar.xz snac2-0b08649a0d2a380f3b638c2c160aa20eefb20197.zip | |
Added a fix to also show the mutual emoji in the people page.
| -rw-r--r-- | html.c | 10 |
1 files changed, 6 insertions, 4 deletions
| @@ -102,7 +102,7 @@ xs_str *actor_name(xs_dict *actor) | |||
| 102 | 102 | ||
| 103 | 103 | ||
| 104 | xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date, | 104 | xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date, |
| 105 | const char *udate, const char *url, int priv) | 105 | const char *udate, const char *url, int priv, int in_people) |
| 106 | { | 106 | { |
| 107 | xs_html *actor_icon = xs_html_tag("p", NULL); | 107 | xs_html *actor_icon = xs_html_tag("p", NULL); |
| 108 | 108 | ||
| @@ -128,7 +128,9 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date, | |||
| 128 | if (user) { | 128 | if (user) { |
| 129 | fwer = follower_check(user, actor_id); | 129 | fwer = follower_check(user, actor_id); |
| 130 | fwing = following_check(user, actor_id); | 130 | fwing = following_check(user, actor_id); |
| 131 | } | ||
| 131 | 132 | ||
| 133 | if (user && !in_people) { | ||
| 132 | /* if this actor is a follower or being followed, create an | 134 | /* if this actor is a follower or being followed, create an |
| 133 | anchored link to the people page instead of the actor url */ | 135 | anchored link to the people page instead of the actor url */ |
| 134 | if (fwer || fwing) { | 136 | if (fwer || fwing) { |
| @@ -259,7 +261,7 @@ xs_html *html_msg_icon(snac *user, char *actor_id, const xs_dict *msg) | |||
| 259 | date = xs_dict_get(msg, "published"); | 261 | date = xs_dict_get(msg, "published"); |
| 260 | udate = xs_dict_get(msg, "updated"); | 262 | udate = xs_dict_get(msg, "updated"); |
| 261 | 263 | ||
| 262 | actor_icon = html_actor_icon(user, actor, date, udate, url, priv); | 264 | actor_icon = html_actor_icon(user, actor, date, udate, url, priv, 0); |
| 263 | } | 265 | } |
| 264 | 266 | ||
| 265 | return actor_icon; | 267 | return actor_icon; |
| @@ -2099,7 +2101,7 @@ xs_html *html_people_list(snac *snac, xs_list *list, char *header, char *t) | |||
| 2099 | xs_html_attr("name", md5)), | 2101 | xs_html_attr("name", md5)), |
| 2100 | xs_html_tag("div", | 2102 | xs_html_tag("div", |
| 2101 | xs_html_attr("class", "snac-post-header"), | 2103 | xs_html_attr("class", "snac-post-header"), |
| 2102 | html_actor_icon(NULL, actor, xs_dict_get(actor, "published"), NULL, NULL, 0))); | 2104 | html_actor_icon(snac, actor, xs_dict_get(actor, "published"), NULL, NULL, 0, 1))); |
| 2103 | 2105 | ||
| 2104 | /* content (user bio) */ | 2106 | /* content (user bio) */ |
| 2105 | char *c = xs_dict_get(actor, "summary"); | 2107 | char *c = xs_dict_get(actor, "summary"); |
| @@ -2294,7 +2296,7 @@ xs_str *html_notifications(snac *user) | |||
| 2294 | xs_html_add(entry, | 2296 | xs_html_add(entry, |
| 2295 | xs_html_tag("div", | 2297 | xs_html_tag("div", |
| 2296 | xs_html_attr("class", "snac-post"), | 2298 | xs_html_attr("class", "snac-post"), |
| 2297 | html_actor_icon(user, actor, NULL, NULL, NULL, 0))); | 2299 | html_actor_icon(user, actor, NULL, NULL, NULL, 0, 0))); |
| 2298 | } | 2300 | } |
| 2299 | else { | 2301 | else { |
| 2300 | xs *md5 = xs_md5_hex(id, strlen(id)); | 2302 | xs *md5 = xs_md5_hex(id, strlen(id)); |