diff --git a/Makefile b/Makefile index 2175b68..482acc1 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,11 @@ $(PAGES_DIR)/navigation.chtml: $(PAGES_DIR)/navigation.html ./filec $< data_navigation_html > $@ $(PAGES_DIR)/config_sidebar.chtml: $(PAGES_DIR)/config_sidebar.html ./filec $< data_config_sidebar_html > $@ +$(PAGES_DIR)/like_svg.chtml: $(PAGES_DIR)/like_svg.html + ./filec $< data_like_svg_html > $@ +$(PAGES_DIR)/repeat_svg.chtml: $(PAGES_DIR)/repeat_svg.html + ./filec $< data_repeat_svg_html > $@ + $(MASTODONT_DIR): git clone $(MASTODONT_URL) || true diff --git a/dist/treebird20.css b/dist/treebird20.css index ce54071..a4ad934 100644 --- a/dist/treebird20.css +++ b/dist/treebird20.css @@ -308,6 +308,18 @@ ul li:first-child a.sidebarbtn font-weight: bold; } +.notification-info svg +{ + width: 16px; + height: 16px; + stroke: #aa0000; +} + +.notification-info svg.like +{ + fill: #aa0000; +} + .notification-compact .notification-content { color: #808080; diff --git a/src/notifications.c b/src/notifications.c index e6659df..847cf64 100644 --- a/src/notifications.c +++ b/src/notifications.c @@ -29,6 +29,8 @@ #include "../static/notifications.chtml" #include "../static/notification.chtml" #include "../static/notification_compact.chtml" +#include "../static/like_svg.chtml" +#include "../static/repeat_svg.chtml" char* construct_notification(struct mstdnt_notification* notif, int* size) { @@ -55,6 +57,7 @@ char* construct_notification_compact(struct mstdnt_notification* notif, int* siz char* notif_stats = NULL; const char* type_str = notification_type_str(notif->type); + const char* type_svg = notification_type_svg(notif->type); if (notif->status) easprintf(¬if_stats, "%d - %d - %d", @@ -67,6 +70,7 @@ char* construct_notification_compact(struct mstdnt_notification* notif, int* siz notif->account->avatar, notif->account->display_name, type_str, + type_svg, /* Might show follower address */ notif->type == MSTDNT_NOTIFICATION_FOLLOW ? notif->account->acct : diff --git a/src/status.c b/src/status.c index c940610..82068b1 100644 --- a/src/status.c +++ b/src/status.c @@ -106,6 +106,7 @@ char* construct_status(struct mstdnt_status* status, uint8_t flags) { char* stat_html; + const char* type_svg = notification_type_svg(notif->type); // Counts char* reply_count = NULL; @@ -128,7 +129,8 @@ char* construct_status(struct mstdnt_status* status, easprintf(¬if_info, data_notification_html, notif->account->avatar, notif->account->display_name, - notification_type_str(notif->type)); + notification_type_str(notif->type), + type_svg); size_t s = easprintf(&stat_html, data_status_html, diff --git a/src/type_string.c b/src/type_string.c index 53fa4ed..e6ed90b 100644 --- a/src/type_string.c +++ b/src/type_string.c @@ -17,6 +17,8 @@ */ #include "type_string.h" +#include "../static/like_svg.chtml" +#include "../static/repeat_svg.chtml" const char* notification_type_str(mstdnt_notification_t type) { @@ -31,3 +33,18 @@ const char* notification_type_str(mstdnt_notification_t type) default: return ""; } } + + +const char* notification_type_svg(mstdnt_notification_t type) +{ + switch (type) + { + case MSTDNT_NOTIFICATION_FOLLOW: return ""; + case MSTDNT_NOTIFICATION_FOLLOW_REQUEST: return ""; + case MSTDNT_NOTIFICATION_REBLOG: return data_repeat_svg_html; + case MSTDNT_NOTIFICATION_FAVOURITE: return data_like_svg_html; + case MSTDNT_NOTIFICATION_POLL: return ""; + case MSTDNT_NOTIFICATION_EMOJI_REACT: return ""; + default: return ""; + } +} diff --git a/src/type_string.h b/src/type_string.h index b10777d..0e01d79 100644 --- a/src/type_string.h +++ b/src/type_string.h @@ -21,6 +21,7 @@ #include #include "l10n.h" +const char* notification_type_svg(mstdnt_notification_t type); const char* notification_type_str(mstdnt_notification_t type); #endif // TYPE_STRING_H diff --git a/static/like_svg.html b/static/like_svg.html new file mode 100644 index 0000000..3b6527c --- /dev/null +++ b/static/like_svg.html @@ -0,0 +1 @@ + diff --git a/static/notification.html b/static/notification.html index 683cfcd..30f6ee1 100644 --- a/static/notification.html +++ b/static/notification.html @@ -3,5 +3,6 @@
%s %s + %s
diff --git a/static/notification_compact.html b/static/notification_compact.html index 77e5b68..f90a0a9 100644 --- a/static/notification_compact.html +++ b/static/notification_compact.html @@ -5,7 +5,7 @@
- %s %s + %s %s %s
%s
%s
diff --git a/static/repeat_svg.html b/static/repeat_svg.html new file mode 100644 index 0000000..6712353 --- /dev/null +++ b/static/repeat_svg.html @@ -0,0 +1 @@ +