Fix telegram notifications during read (toggle inform on)

Reset number of pending telegrams before delete prompt instead of
after.

Before, the client claimed pending telegrams at that prompt, because
it wasn't C_INFORMed of the read, yet.  Worse, if more telegrams
arrived while sitting at the prompt, the reset clobbered their number
and sent a bogus clear C_INFORM message, effectively hiding the new
arrivals from the player.
This commit is contained in:
Markus Armbruster 2011-11-21 20:05:45 +01:00
parent a0e91cbc5e
commit e8f0495950

View file

@ -132,6 +132,14 @@ rea(void)
if (res < 0) if (res < 0)
pr("\n> Mailbox corrupt, tell the deity.\n"); pr("\n> Mailbox corrupt, tell the deity.\n");
if (*kind != 'a') {
if (np->nat_flags & NF_INFORM) {
pr_inform(player, "\n");
np->nat_tgms = 0;
putnat(np);
}
}
if (teles > 0 && player->cnum == num && may_delete) { if (teles > 0 && player->cnum == num && may_delete) {
pr("\n"); pr("\n");
if (teles == 1) { if (teles == 1) {
@ -174,13 +182,6 @@ rea(void)
pr("No %ss for %s at the moment...\n", kind, cname(num)); pr("No %ss for %s at the moment...\n", kind, cname(num));
} }
(void)fclose(telfp); (void)fclose(telfp);
if (*kind != 'a') {
if (np->nat_flags & NF_INFORM) {
pr_inform(player, "\n");
np->nat_tgms = 0;
putnat(np);
}
}
return RET_OK; return RET_OK;
} }