From: Ari Johnson Date: Wed, 16 Dec 2015 01:18:30 +0000 (-0500) Subject: Fix recently-introduced bug in channel connect/disconnect broadcasts X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=4880257e804b2cb4be4ba1fca8305cd29d286e0e;p=cobramush.git Fix recently-introduced bug in channel connect/disconnect broadcasts --- 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