]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/wu.c
Update copyright notice
[empserver] / src / lib / subs / wu.c
index 4c84aeab898d446a94be6bffffbf22fcbd561753..89585cc5cf27353884ff23a8cc03bbd169d3d314 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2015, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Steve McClure, 2000
- *     Markus Armbruster, 2005-2015
+ *     Markus Armbruster, 2005-2016
  */
 
 #include <config.h>
 #include <stdarg.h>
 #include <sys/uio.h>
 #include <unistd.h>
-#include "file.h"
 #include "misc.h"
 #include "nat.h"
 #include "optlist.h"
-#include "player.h"
 #include "prototypes.h"
-#include "server.h"
 #include "tel.h"
+#include "update.h"
 
 static struct telstr last_tel[MAXNOC];
 
@@ -54,18 +52,13 @@ clear_telegram_is_new(natid to)
     last_tel[to].tel_from = NATID_BAD;
 }
 
-/*
- * telegram_is_new counts new telegrams the same as read_telegrams in
- * lib/commands/mail.c and lib/commands/rea.c
- */
-
 static int
 telegram_is_new(natid to, struct telstr *tel)
 {
     if (tel->tel_from != last_tel[to].tel_from
        || tel->tel_type != last_tel[to].tel_type
        || (tel->tel_type != TEL_UPDATE
-           && abs(tel->tel_date - last_tel[to].tel_date) > TEL_SECONDS)) {
+           && tel->tel_date - last_tel[to].tel_date > TEL_SECONDS)) {
        last_tel[to] = *tel;
        return 1;
     }
@@ -160,7 +153,7 @@ typed_wu(natid from, natid to, char *message, int type)
        for (to = 0; NULL != (np = getnatp(to)); to++) {
            if (np->nat_stat < STAT_SANCT)
                continue;
-           if (!player->god && (getrejects(from, np) & REJ_ANNO))
+           if (!nat_accepts(to, from, REJ_ANNO))
                continue;
            if (!np->nat_ann || !tel.tel_cont) {
                np->nat_ann++;