*
* Known contributors to this file:
* Steve McClure, 2000
+ * Markus Armbruster, 2005-2011
*/
#include <config.h>
clear_telegram_is_new(natid to)
{
last_tel[to].tel_type = 0;
- last_tel[to].tel_from = 0;
+ last_tel[to].tel_from = NATID_BAD;
last_tel[to].tel_date = 0;
}
struct iovec iov[2];
int fd;
char box[1024];
- int new_tele = 0;
struct player *other;
if (type == TEL_ANNOUNCE)
len = strlen(message);
tel.tel_length = len;
tel.tel_type = type;
+ tel.tel_cont = !telegram_is_new(to, &tel);
iov[0].iov_base = &tel;
iov[0].iov_len = sizeof(tel);
iov[1].iov_base = message;
continue;
if (!player->god && (getrejects(from, np) & REJ_ANNO))
continue;
- np->nat_ann++;
- putnat(np);
+ if (!np->nat_ann || !tel.tel_cont) {
+ np->nat_ann++;
+ putnat(np);
+ }
}
} else {
- new_tele = telegram_is_new(to, &tel);
- np->nat_tgms += new_tele || np->nat_tgms == 0;
- putnat(np);
-
- if (new_tele && np->nat_flags & NF_INFORM) {
- if (NULL != (other = getplayer(to))) {
- if (np->nat_tgms == 1)
- pr_inform(other, "[new tele]\n");
- else
- pr_inform(other, "[%d new teles]\n", np->nat_tgms);
+ if (!np->nat_tgms || !tel.tel_cont) {
+ np->nat_tgms++;
+ putnat(np);
+ if (np->nat_flags & NF_INFORM) {
+ other = getplayer(to);
+ if (other) {
+ if (np->nat_tgms == 1)
+ pr_inform(other, "[new tele]\n");
+ else
+ pr_inform(other, "[%d new teles]\n", np->nat_tgms);
+ }
}
}
}