Don't try to admire empty messages.

This commit is contained in:
default 2022-12-03 20:45:58 +01:00
parent 76bfc366ea
commit bd0149ee0d

6
html.c
View file

@ -1288,15 +1288,21 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
if (strcmp(action, L("Like")) == 0) { if (strcmp(action, L("Like")) == 0) {
xs *msg = msg_admiration(&snac, id, "Like"); xs *msg = msg_admiration(&snac, id, "Like");
if (msg != NULL) {
post(&snac, msg); post(&snac, msg);
timeline_admire(&snac, msg, id, snac.actor, 1); timeline_admire(&snac, msg, id, snac.actor, 1);
} }
}
else else
if (strcmp(action, L("Boost")) == 0) { if (strcmp(action, L("Boost")) == 0) {
xs *msg = msg_admiration(&snac, id, "Announce"); xs *msg = msg_admiration(&snac, id, "Announce");
if (msg != NULL) {
post(&snac, msg); post(&snac, msg);
timeline_admire(&snac, msg, id, snac.actor, 0); timeline_admire(&snac, msg, id, snac.actor, 0);
} }
}
else else
if (strcmp(action, L("MUTE")) == 0) { if (strcmp(action, L("MUTE")) == 0) {
mute(&snac, actor); mute(&snac, actor);