diff --git a/dist/treebird20.css b/dist/treebird20.css index 40a2a4e..e8b5314 100644 --- a/dist/treebird20.css +++ b/dist/treebird20.css @@ -570,10 +570,25 @@ svg.in-reply-to-icon .notification-compact .notification-stats { - color: #500000; font-size: 10px; } +.notification-compact .notification-stats .status-interact +{ + margin-top: 2px; +} + +.notification-compact .notification-stats svg +{ + width: 15px; + height: 15px; +} + +.notification-compact .notification-stats .statbtn +{ + padding: 2px 4px; +} + .notification-info { margin-top: 7px; @@ -763,7 +778,7 @@ svg.in-reply-to-icon .status-interact { - margin: 8px 0 0 0; + margin: 6px 0 0 0; } .status-interact table.ui-table @@ -778,6 +793,11 @@ svg.in-reply-to-icon padding: 0; } +.status-interact table.ui-table td +{ + vertical-align: middle; /* Exception in notifications sidebar */ +} + /*************************** * Element Grouping * **************************/ @@ -1151,7 +1171,7 @@ p} } -.status-interact label +.status-interact .statbtn { display: block; padding: 3px 8px; @@ -1351,6 +1371,12 @@ p} left: 0; } +.attachment-link +{ + font-weight: bold; + font-size: 14px; +} + .sensitive.attachment-link::after, .sensitive.attachment-audio::after { diff --git a/src/attachments.c b/src/attachments.c index 4f65536..dd2983f 100644 --- a/src/attachments.c +++ b/src/attachments.c @@ -32,6 +32,7 @@ struct attachments_args { + struct session* ssn; struct mstdnt_attachment* atts; mstdnt_bool sensitive; }; @@ -118,32 +119,39 @@ void cleanup_media_ids(struct session* ssn, char** media_ids) free(media_ids); } -char* construct_attachment(mstdnt_bool sensitive, struct mstdnt_attachment* att, int* str_size) +char* construct_attachment(struct session* ssn, + mstdnt_bool sensitive, + struct mstdnt_attachment* att, + int* str_size) { char* att_html; size_t s; const char* attachment_str; if (!att) return NULL; - switch (att->type) - { - case MSTDNT_ATTACHMENT_IMAGE: - attachment_str = data_attachment_image_html; break; - case MSTDNT_ATTACHMENT_GIFV: - attachment_str = data_attachment_gifv_html; break; - case MSTDNT_ATTACHMENT_VIDEO: - attachment_str = data_attachment_video_html; break; - case MSTDNT_ATTACHMENT_AUDIO: - attachment_str = data_attachment_audio_html; break; - case MSTDNT_ATTACHMENT_UNKNOWN: // Fall through - default: - attachment_str = data_attachment_link_html; break; - } + if (ssn->config.stat_attachments) + switch (att->type) + { + case MSTDNT_ATTACHMENT_IMAGE: + attachment_str = data_attachment_image_html; break; + case MSTDNT_ATTACHMENT_GIFV: + attachment_str = data_attachment_gifv_html; break; + case MSTDNT_ATTACHMENT_VIDEO: + attachment_str = data_attachment_video_html; break; + case MSTDNT_ATTACHMENT_AUDIO: + attachment_str = data_attachment_audio_html; break; + case MSTDNT_ATTACHMENT_UNKNOWN: // Fall through + default: + attachment_str = data_attachment_link_html; break; + } + else + attachment_str = data_attachment_link_html; // Images/visible content displays sensitive placeholder after - if (att->type == MSTDNT_ATTACHMENT_IMAGE || - att->type == MSTDNT_ATTACHMENT_GIFV || - att->type == MSTDNT_ATTACHMENT_VIDEO) + if ((att->type == MSTDNT_ATTACHMENT_IMAGE || + att->type == MSTDNT_ATTACHMENT_GIFV || + att->type == MSTDNT_ATTACHMENT_VIDEO) && + ssn->config.stat_attachments) { s = easprintf(&att_html, attachment_str, att->url, @@ -162,13 +170,17 @@ char* construct_attachment(mstdnt_bool sensitive, struct mstdnt_attachment* att, static char* construct_attachments_voidwrap(void* passed, size_t index, int* res) { struct attachments_args* args = passed; - return construct_attachment(args->sensitive, args->atts + index, res); + return construct_attachment(args->ssn, args->sensitive, args->atts + index, res); } -char* construct_attachments(mstdnt_bool sensitive, struct mstdnt_attachment* atts, size_t atts_len, size_t* str_size) +char* construct_attachments(struct session* ssn, + mstdnt_bool sensitive, + struct mstdnt_attachment* atts, + size_t atts_len, + size_t* str_size) { size_t elements_size; - struct attachments_args args = { atts, sensitive }; + struct attachments_args args = { ssn, atts, sensitive }; char* elements = construct_func_strings(construct_attachments_voidwrap, &args, atts_len, &elements_size); char* att_view; diff --git a/src/attachments.h b/src/attachments.h index a23d9b8..3a5c384 100644 --- a/src/attachments.h +++ b/src/attachments.h @@ -32,7 +32,7 @@ int try_upload_media(struct mstdnt_storage** storage, char*** media_ids); void cleanup_media_storages(struct session* ssn, struct mstdnt_storage* storage); void cleanup_media_ids(struct session* ssn, char** media_ids); -char* construct_attachment(mstdnt_bool sensitive, struct mstdnt_attachment* att, int* str_size); -char* construct_attachments(mstdnt_bool sensitive, struct mstdnt_attachment* atts, size_t atts_len, size_t* str_size); +char* construct_attachment(struct session* ssn, mstdnt_bool sensitive, struct mstdnt_attachment* att, int* str_size); +char* construct_attachments(struct session* ssn, mstdnt_bool sensitive, struct mstdnt_attachment* atts, size_t atts_len, size_t* str_size); #endif // ATTACHMENTS_H diff --git a/src/notifications.c b/src/notifications.c index 7c290f8..d621cae 100644 --- a/src/notifications.c +++ b/src/notifications.c @@ -99,10 +99,9 @@ char* construct_notification_compact(struct session* ssn, if (notif->status) { - easprintf(¬if_stats, "%d - %d - %d", - notif->status->replies_count, - notif->status->reblogs_count, - notif->status->favourites_count); + if (notif->type == MSTDNT_NOTIFICATION_MENTION) + notif_stats = construct_interaction_buttons(ssn, notif->status, NULL, + STATUS_NO_LIKEBOOST | STATUS_NO_DOPAMEME); status_format = reformat_status(ssn, notif->status->content, notif->status->emojis, diff --git a/src/status.c b/src/status.c index 82839c3..3f68c6f 100644 --- a/src/status.c +++ b/src/status.c @@ -188,6 +188,8 @@ char* construct_interaction_buttons(struct session* ssn, char* emoji_picker_html = NULL; char* reactions_btn_html = NULL; char* time_str; + int show_nums = (flags & STATUS_NO_DOPAMEME) != STATUS_NO_DOPAMEME && + ssn->config.stat_dope; size_t s; // Emojo picker @@ -202,12 +204,15 @@ char* construct_interaction_buttons(struct session* ssn, status->id, emoji_picker_html ? emoji_picker_html : ""); - if (status->replies_count) - easprintf(&reply_count, NUM_STR, status->replies_count); - if (status->reblogs_count) - easprintf(&repeat_count, NUM_STR, status->reblogs_count); - if (status->favourites_count) - easprintf(&favourites_count, NUM_STR, status->favourites_count); + if (show_nums) + { + if (status->replies_count) + easprintf(&reply_count, NUM_STR, status->replies_count); + if (status->reblogs_count) + easprintf(&repeat_count, NUM_STR, status->reblogs_count); + if (status->favourites_count) + easprintf(&favourites_count, NUM_STR, status->favourites_count); + } easprintf(&likeboost_html, data_likeboost_html, config_url_prefix, @@ -230,7 +235,9 @@ char* construct_interaction_buttons(struct session* ssn, status->favourited ? "un" : "", status->favourited ? "active" : "", favourites_count ? favourites_count : "", - likeboost_html ? likeboost_html : "", + (likeboost_html && + ssn->config.stat_oneclicksoftware && + (flags & STATUS_NO_LIKEBOOST) != STATUS_NO_LIKEBOOST ? likeboost_html : ""), reactions_btn_html ? reactions_btn_html : "", config_url_prefix, status->id, @@ -550,7 +557,7 @@ char* construct_status(struct session* ssn, } if (status->media_attachments_len) - attachments = construct_attachments(status->sensitive, status->media_attachments, status->media_attachments_len, NULL); + attachments = construct_attachments(ssn, status->sensitive, status->media_attachments, status->media_attachments_len, NULL); if (status->pleroma.emoji_reactions_len) emoji_reactions = construct_emoji_reactions(status->id, status->pleroma.emoji_reactions, status->pleroma.emoji_reactions_len, NULL); if (notif && notif->type != MSTDNT_NOTIFICATION_MENTION) diff --git a/src/status.h b/src/status.h index 622cd1f..def4168 100644 --- a/src/status.h +++ b/src/status.h @@ -27,6 +27,8 @@ #define STATUS_REPLY (1<<0) #define STATUS_FOCUSED (1<<1) #define STATUS_EMOJI_PICKER (1<<2) +#define STATUS_NO_LIKEBOOST (1<<3) +#define STATUS_NO_DOPAMEME (1<<4) struct construct_statuses_args { diff --git a/static/config_general.html b/static/config_general.html index 7a0a148..ef4b060 100644 --- a/static/config_general.html +++ b/static/config_general.html @@ -26,18 +26,18 @@
- |