diff --git a/nets/net_irc.c b/nets/net_irc.c index bf131d6..10567c0 100644 --- a/nets/net_irc.c +++ b/nets/net_irc.c @@ -945,8 +945,12 @@ int _irc_relay_send(const char *channel, enum channel_user_modes modes, const ch /* If something specific specified, use the override, otherwise use the same thing. * This allows relay modules to customize the hostmask if they want. */ - hostsender = S_OR(hostsender, sender); - snprintf(hostname, sizeof(hostname), "%s/%s", relayname, hostsender); + if (!strlen_zero(hostsender)) { + /* We were provided a hostname/IP address directly for this part that we can use. */ + safe_strncpy(hostname, hostsender, sizeof(hostname)); + } else { + snprintf(hostname, sizeof(hostname), "%s/%s", relayname, sender); + } /* It's not our job to filter messages, clients can do that. For example, decimal 1 is legitimate for CTCP commands. */ diff --git a/nets/net_msp.c b/nets/net_msp.c index f45845d..1a1f422 100644 --- a/nets/net_msp.c +++ b/nets/net_msp.c @@ -89,7 +89,6 @@ static int strnsep(const char **restrict var, char **restrict buf, size_t *restr if (!*len) { *buf = NULL; /* There is nothing more to read, that's the end of the buffer */ } - bbs_debug(4, "Parsed token '%s'\n", *var); return 0; } if (!*len) { @@ -280,9 +279,11 @@ static int handle_msp(struct msp *restrict msp, const char *ip) } else { /* Directed to a particular user (or channel). */ if (!isalpha(*msp->recip)) { + char nativenick[64]; /* Begins with a non-numeric character. * Assume it's the name of an IRC channel. */ - res = irc_relay_send(msp->recip, CHANNEL_USER_MODE_NONE, "MSP", msp->sender, NULL, msp->message, NULL); + snprintf(nativenick, sizeof(nativenick), "%s/%s", "MSP", msp->sender); + res = irc_relay_send(msp->recip, CHANNEL_USER_MODE_NONE, "MSP", nativenick, ip, msp->message, NULL); if (res) { MSP_ERROR(msp, "Channel does not exist"); return -1;