summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-10-19 17:56:05 +0200
committerTor Andersson <tor@ccxvii.net>2021-10-22 22:43:15 +0200
commit399530d2c913b3262db7ffaff3129a5dda3a1a8f (patch)
treef231ba599d1f2a550e05d065509b06e0b1eb921e
parent36f1551b3359abc776596c6ac0e60ac10040a3de (diff)
downloadserver-399530d2c913b3262db7ffaff3129a5dda3a1a8f.tar.gz
server: Skip reminder notifications if mailer is not loaded.
-rw-r--r--server.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/server.js b/server.js
index 7ec15ba..cc81a18 100644
--- a/server.js
+++ b/server.js
@@ -1114,6 +1114,8 @@ function mail_your_turn_notification_to_offline_users(game_id, old_active, activ
}
function notify_your_turn_reminder() {
+ if (!mailer)
+ return;
for (let item of QUERY_LIST_YOUR_TURN.all()) {
if (!QUERY_IS_SOLO.get(item.game_id)) {
mail_your_turn_notification(item, item.game_id, '+25 hours');
@@ -1122,6 +1124,8 @@ function notify_your_turn_reminder() {
}
function notify_ready_to_start_reminder() {
+ if (!mailer)
+ return;
for (let game of QUERY_LIST_UNSTARTED_GAMES.all()) {
let players = QUERY_PLAYERS.all(game.game_id);
if (RULES[game.title_id].ready(game.scenario, players)) {