0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

Remove CheckEmpty() from macro scope.

This commit is contained in:
Jason Volk 2016-08-18 01:51:49 -07:00
parent 2352528ffb
commit 1e07182f3e
2 changed files with 16 additions and 7 deletions

View file

@ -25,6 +25,8 @@
#pragma once
#define HAVE_IRCD_MATCH_H
#define EmptyString(x) ((x) == NULL || *(x) == '\0')
#ifdef __cplusplus
namespace ircd {
@ -68,9 +70,6 @@ extern int irccmp(const char *s1, const char *s2);
*/
extern int ircncmp(const char *s1, const char *s2, int n);
#define EmptyString(x) ((x) == NULL || *(x) == '\0')
#define CheckEmpty(x) EmptyString(x) ? "" : x
/* Below are used for radix trees and the like */
static inline void irccasecanon(char *str)
{

View file

@ -900,11 +900,21 @@ ms_sjoin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
*mbuf = '\0';
if(pargs)
{
static const auto check_empty([]
(const char *const &str)
{
return EmptyString(str)? "" : str;
});
sendto_channel_local(chan::ALL_MEMBERS, chptr,
":%s MODE %s %s %s %s %s %s",
fakesource_p->name, chptr->name.c_str(), modebuf,
para[0], CheckEmpty(para[1]),
CheckEmpty(para[2]), CheckEmpty(para[3]));
":%s MODE %s %s %s %s %s %s",
fakesource_p->name,
chptr->name.c_str(),
modebuf,
para[0],
check_empty(para[1]),
check_empty(para[2]),
check_empty(para[3]));
}
if(!joins && !(chptr->mode.mode & chan::mode::PERMANENT) && isnew)