mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 22:45:05 +00:00
Also show unfollows in the notification area.
This commit is contained in:
parent
5b3c7d45bb
commit
7db4de872d
2 changed files with 6 additions and 3 deletions
|
@ -686,7 +686,7 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor,
|
||||||
enqueue_telegram(body, bot, chat_id);
|
enqueue_telegram(body, bot, chat_id);
|
||||||
|
|
||||||
/* finally, store it in the notification folder */
|
/* finally, store it in the notification folder */
|
||||||
if (strcmp(type, "Follow") == 0)
|
if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0)
|
||||||
objid = id;
|
objid = id;
|
||||||
|
|
||||||
notify_add(snac, type, utype, actor, objid != NULL ? objid : id);
|
notify_add(snac, type, utype, actor, objid != NULL ? objid : id);
|
||||||
|
|
7
html.c
7
html.c
|
@ -1437,7 +1437,7 @@ xs_str *html_notifications(snac *snac)
|
||||||
"<form autocomplete=\"off\" "
|
"<form autocomplete=\"off\" "
|
||||||
"method=\"post\" action=\"%s/admin/clear-notifications\" id=\"clear\">\n"
|
"method=\"post\" action=\"%s/admin/clear-notifications\" id=\"clear\">\n"
|
||||||
"<input type=\"submit\" class=\"snac-btn-like\" value=\"%s\">\n"
|
"<input type=\"submit\" class=\"snac-btn-like\" value=\"%s\">\n"
|
||||||
"</form><p>", snac->actor, L("Clear all"));
|
"</form><p>\n", snac->actor, L("Clear all"));
|
||||||
s = xs_str_cat(s, s1);
|
s = xs_str_cat(s, s1);
|
||||||
|
|
||||||
while (xs_list_iter(&p, &v)) {
|
while (xs_list_iter(&p, &v)) {
|
||||||
|
@ -1498,13 +1498,16 @@ xs_str *html_notifications(snac *snac)
|
||||||
else
|
else
|
||||||
if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0)
|
if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0)
|
||||||
label = L("Finished poll");
|
label = L("Finished poll");
|
||||||
|
else
|
||||||
|
if (strcmp(type, "Undo") == 0 && strcmp(utype, "Follow") == 0)
|
||||||
|
label = L("Unfollow");
|
||||||
|
|
||||||
xs *s1 = xs_fmt("<div class=\"snac-post-with-desc\">\n"
|
xs *s1 = xs_fmt("<div class=\"snac-post-with-desc\">\n"
|
||||||
"<p><b>%s by <a href=\"%s\">%s</a></b>:</p>\n",
|
"<p><b>%s by <a href=\"%s\">%s</a></b>:</p>\n",
|
||||||
label, actor_id, a_name);
|
label, actor_id, a_name);
|
||||||
s = xs_str_cat(s, s1);
|
s = xs_str_cat(s, s1);
|
||||||
|
|
||||||
if (strcmp(type, "Follow") == 0) {
|
if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) {
|
||||||
s = xs_str_cat(s, "<div class=\"snac-post\">\n");
|
s = xs_str_cat(s, "<div class=\"snac-post\">\n");
|
||||||
|
|
||||||
s = html_msg_icon(snac, s, obj);
|
s = html_msg_icon(snac, s, obj);
|
||||||
|
|
Loading…
Reference in a new issue