From 4880257e804b2cb4be4ba1fca8305cd29d286e0e Mon Sep 17 00:00:00 2001 From: Ari Johnson Date: Tue, 15 Dec 2015 20:18:30 -0500 Subject: [PATCH] Fix recently-introduced bug in channel connect/disconnect broadcasts --- hdrs/extchat.h | 1 + src/extchat.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hdrs/extchat.h b/hdrs/extchat.h index b005bb2..2c9fef1 100644 --- a/hdrs/extchat.h +++ b/hdrs/extchat.h @@ -69,6 +69,7 @@ struct chanuser { #define CB_CHECKQUIET 0x1 /* Check for quiet flag on recipients */ #define CB_NOSPOOF 0x2 /* Use nospoof emits */ #define CB_PRESENCE 0x4 /* This is a presence message, not sound */ +#define CB_NONAME 0x8 /* Omit player name from broadcast */ #define CUdbref(u) ((u)->who) #define CUtype(u) ((u)->type) diff --git a/src/extchat.c b/src/extchat.c index c685b9c..3f2a461 100644 --- a/src/extchat.c +++ b/src/extchat.c @@ -3072,8 +3072,8 @@ chat_player_announce(dbref player, char *msg, int ungag) if (u) { if (!Channel_Quiet(c) && (Channel_Admin(c) || Channel_Director(c) || (!Chanuser_Hide(u) && !Dark(player)))) - format_channel_broadcast(c, u, player, CB_CHECKQUIET | CB_PRESENCE, - msg, NULL); + format_channel_broadcast(c, u, player, CB_CHECKQUIET | CB_PRESENCE + | CB_NONAME, msg, NULL); if (ungag) CUtype(u) &= ~CU_GAG; } @@ -3708,7 +3708,10 @@ format_channel_broadcast(CHAN *chan, CHANUSER *u, dbref victim, int flags, else if (u &&CUtitle(u)) title = CUtitle(u); - if (Channel_NoNames(chan)) { + if (flags & CB_NONAME) { + flags &= ~CB_NONAME; + snprintf(buff, BUFFER_LEN, "%s %s", ChanObjName(chan), msg); + } else if (Channel_NoNames(chan)) { if (Channel_NoTitles(chan) || !title) snprintf(buff, BUFFER_LEN, "%s %s %s", ChanObjName(chan), "Someone", msg); else -- 2.30.2