forked from github/server
Nobody needs to see empty messages in the CR
This commit is contained in:
parent
0fc37c9c59
commit
671e976ad6
2 changed files with 8 additions and 6 deletions
|
@ -522,10 +522,10 @@ static void render_messages(FILE * F, faction * f, message_list * msgs)
|
||||||
#endif
|
#endif
|
||||||
crbuffer[0] = '\0';
|
crbuffer[0] = '\0';
|
||||||
if (cr_render(m->msg, crbuffer, (const void *)f) == 0) {
|
if (cr_render(m->msg, crbuffer, (const void *)f) == 0) {
|
||||||
if (!printed)
|
if (crbuffer[0] && !printed) {
|
||||||
fprintf(F, "MESSAGE %u\n", messagehash(m->msg));
|
fprintf(F, "MESSAGE %u\n", messagehash(m->msg));
|
||||||
if (crbuffer[0])
|
|
||||||
fputs(crbuffer, F);
|
fputs(crbuffer, F);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log_error("could not render cr-message %p: %s\n", m->msg, m->msg->type->name);
|
log_error("could not render cr-message %p: %s\n", m->msg, m->msg->type->name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,11 +30,13 @@ extern "C" {
|
||||||
|
|
||||||
struct message_type;
|
struct message_type;
|
||||||
|
|
||||||
typedef struct message_list {
|
typedef struct mlist {
|
||||||
struct mlist {
|
|
||||||
struct mlist *next;
|
struct mlist *next;
|
||||||
struct message *msg;
|
struct message *msg;
|
||||||
} *begin, **end;
|
};
|
||||||
|
|
||||||
|
typedef struct message_list {
|
||||||
|
struct mlist *begin, **end;
|
||||||
} message_list;
|
} message_list;
|
||||||
|
|
||||||
extern void free_messagelist(message_list * msgs);
|
extern void free_messagelist(message_list * msgs);
|
||||||
|
|
Loading…
Reference in a new issue