summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2022-12-03 20:45:58 +0100
committerGravatar default2022-12-03 20:45:58 +0100
commitbd0149ee0d2b38d2aab97ef5096ca1a3cb529086 (patch)
tree5fed2dfb13a80d6be2f127d749b2c7f88ae8c392
parentUpdated TODO. (diff)
downloadsnac2-bd0149ee0d2b38d2aab97ef5096ca1a3cb529086.tar.gz
snac2-bd0149ee0d2b38d2aab97ef5096ca1a3cb529086.tar.xz
snac2-bd0149ee0d2b38d2aab97ef5096ca1a3cb529086.zip
Don't try to admire empty messages.
-rw-r--r--html.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/html.c b/html.c
index b8bb1af..6f85c83 100644
--- a/html.c
+++ b/html.c
@@ -1288,14 +1288,20 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
1288 1288
1289 if (strcmp(action, L("Like")) == 0) { 1289 if (strcmp(action, L("Like")) == 0) {
1290 xs *msg = msg_admiration(&snac, id, "Like"); 1290 xs *msg = msg_admiration(&snac, id, "Like");
1291 post(&snac, msg); 1291
1292 timeline_admire(&snac, msg, id, snac.actor, 1); 1292 if (msg != NULL) {
1293 post(&snac, msg);
1294 timeline_admire(&snac, msg, id, snac.actor, 1);
1295 }
1293 } 1296 }
1294 else 1297 else
1295 if (strcmp(action, L("Boost")) == 0) { 1298 if (strcmp(action, L("Boost")) == 0) {
1296 xs *msg = msg_admiration(&snac, id, "Announce"); 1299 xs *msg = msg_admiration(&snac, id, "Announce");
1297 post(&snac, msg); 1300
1298 timeline_admire(&snac, msg, id, snac.actor, 0); 1301 if (msg != NULL) {
1302 post(&snac, msg);
1303 timeline_admire(&snac, msg, id, snac.actor, 0);
1304 }
1299 } 1305 }
1300 else 1306 else
1301 if (strcmp(action, L("MUTE")) == 0) { 1307 if (strcmp(action, L("MUTE")) == 0) {