From 2273abfc8350025920a2a2708a39252e180432ee Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Mon, 4 Apr 2022 19:40:31 +0000 Subject: [PATCH] Cleanup CSS (broken commit) FossilOrigin-Name: 6bf13bee2e60ab41d3c7da0d401b8a0f6cba62f76f93e2a71c8b5a9fb8945f6c --- dist/treebird20.css | 20 ++++++++++++++++---- src/account.c | 5 ++++- src/status.c | 24 +++++++++++++++++++++--- static/account.html | 2 +- 4 files changed, 42 insertions(+), 9 deletions(-) diff --git a/dist/treebird20.css b/dist/treebird20.css index 7111d27..a754527 100644 --- a/dist/treebird20.css +++ b/dist/treebird20.css @@ -535,7 +535,7 @@ svg.in-reply-to-icon display: inline; float: right; font-size: 12px; - margin: 3px 3px 0 3px; + margin: 3px 0 0 3px; } .status-interact @@ -703,16 +703,27 @@ svg.in-reply-to-icon { display: inline-block; position: relative; - left: 160px; - top: 200px; + left: 155px; + top: 185px; font-weight: bold; text-shadow: 0px 2px 6px #000; } +.acct-banner +{ + overflow: hidden; +} + + .acct-displayname { font-size: 26px; - display: block; + display: inline-block; + white-space: nowrap; + text-overflow: ellipsis; + padding: 6px 6px 8px; + overflow: hidden; + max-width: 420px !important; color: #fff; } @@ -721,6 +732,7 @@ svg.in-reply-to-icon font-size: 14px; color: #dadada; display: block; + padding-left: 6px; font-weight: bold; text-shadow: 0px 0px 5px #000; } diff --git a/src/account.c b/src/account.c index 3dd1fbd..0075497 100644 --- a/src/account.c +++ b/src/account.c @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +#include #include #include "base_page.h" #include "error.h" @@ -61,7 +62,7 @@ char* construct_account_page(mastodont_t* api, else cleanup = 1; - if (acct->note) + if (acct->note && strcmp(acct->note, "") != 0) { info_html = construct_account_info(acct, NULL); } @@ -76,6 +77,8 @@ char* construct_account_page(mastodont_t* api, acct->following_count, "Followers", acct->followers_count, + acct->following ? "active" : "", + acct->following ? "Following!" : "Follow", acct->avatar, info_html ? info_html : "", statuses_html); diff --git a/src/status.c b/src/status.c index 955b480..93bbb3a 100644 --- a/src/status.c +++ b/src/status.c @@ -157,9 +157,9 @@ char* reformat_status(char* content) } char* construct_status(mastodont_t* api, - struct mstdnt_status* status, + struct mstdnt_status* local_status, int* size, - struct mstdnt_notification* notif, + struct mstdnt_notification* local_notif, uint8_t flags) { char* stat_html; @@ -172,7 +172,23 @@ char* construct_status(mastodont_t* api, char* emoji_reactions = NULL; char* notif_info = NULL; char* in_reply_to_str = NULL; + struct mstdnt_status* status = local_status; + // Create a "fake" notification header which contains information for + // the reblogged status + struct mstdnt_notification notif_reblog; + struct mstdnt_notification* notif = local_notif; + + // Repoint value if it's a reblog + if (status->reblog) + { + status = status->reblog; + // Point to our account + notif_reblog.account = &(local_status->account); + notif_reblog.type = MSTDNT_NOTIFICATION_REBLOG; + notif = ¬if_reblog; + } char* parse_content = status->content; + if (status->replies_count) easprintf(&reply_count, NUM_STR, status->replies_count); if (status->reblogs_count) @@ -187,7 +203,9 @@ char* construct_status(mastodont_t* api, easprintf(¬if_info, data_notification_html, notif->account->avatar, notif->account->display_name, - notification_type_str(notif->type), + // Use compact type string, which looks better + // for self-boosts + local_status->reblog ? notification_type_compact_str(notif->type) : notification_type_str(notif->type), notification_type_svg(notif->type)); if (status->in_reply_to_id && status->in_reply_to_account_id) diff --git a/static/account.html b/static/account.html index 23682ca..bb9ba4d 100644 --- a/static/account.html +++ b/static/account.html @@ -22,7 +22,7 @@ %d - +