mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
Refactor umodes.
This commit is contained in:
parent
2088193118
commit
f33b369609
83 changed files with 433 additions and 385 deletions
|
@ -38,7 +38,7 @@ h_can_join(hook_data_channel *data)
|
||||||
client::client *source_p = data->client;
|
client::client *source_p = data->client;
|
||||||
const auto &chptr(data->chptr);
|
const auto &chptr(data->chptr);
|
||||||
|
|
||||||
if((chptr->mode.mode & mymode) && !IsAdmin(source_p)) {
|
if((chptr->mode.mode & mymode) && !is(*source_p, umode::ADMIN)) {
|
||||||
sendto_one_numeric(source_p, 519, "%s :Cannot join channel (+A) - you are not an IRC server administrator", chptr->name.c_str());
|
sendto_one_numeric(source_p, 519, "%s :Cannot join channel (+A) - you are not an IRC server administrator", chptr->name.c_str());
|
||||||
data->approved = chan::mode::ERR_CUSTOM;
|
data->approved = chan::mode::ERR_CUSTOM;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ h_can_join(hook_data_channel *data)
|
||||||
client::client *source_p = data->client;
|
client::client *source_p = data->client;
|
||||||
const auto &chptr(data->chptr);
|
const auto &chptr(data->chptr);
|
||||||
|
|
||||||
if(!(chptr->mode.mode & mymode) && !IsSSLClient(source_p)) {
|
if(!(chptr->mode.mode & mymode) && !is(*source_p, umode::SSLCLIENT)) {
|
||||||
/* XXX This is equal to ERR_THROTTLE */
|
/* XXX This is equal to ERR_THROTTLE */
|
||||||
sendto_one_numeric(source_p, 480, "%s :Cannot join channel (-U) - SSL/TLS required", chptr->name.c_str());
|
sendto_one_numeric(source_p, 480, "%s :Cannot join channel (-U) - SSL/TLS required", chptr->name.c_str());
|
||||||
data->approved = chan::mode::ERR_CUSTOM;
|
data->approved = chan::mode::ERR_CUSTOM;
|
||||||
|
|
|
@ -39,7 +39,7 @@ h_can_join(hook_data_channel *data)
|
||||||
client::client *source_p = data->client;
|
client::client *source_p = data->client;
|
||||||
const auto &chptr(data->chptr);
|
const auto &chptr(data->chptr);
|
||||||
|
|
||||||
if((chptr->mode.mode & mymode) && !IsOper(source_p)) {
|
if((chptr->mode.mode & mymode) && !is(*source_p, umode::OPER)) {
|
||||||
sendto_one_numeric(source_p, 520, "%s :Cannot join channel (+O) - you are not an IRC operator", chptr->name.c_str());
|
sendto_one_numeric(source_p, 520, "%s :Cannot join channel (+O) - you are not an IRC operator", chptr->name.c_str());
|
||||||
data->approved = chan::mode::ERR_CUSTOM;
|
data->approved = chan::mode::ERR_CUSTOM;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,10 +44,10 @@ hdl_can_kick(hook_data_channel_approval *data)
|
||||||
client::client *who = data->target;
|
client::client *who = data->target;
|
||||||
const auto &chptr(data->chptr);
|
const auto &chptr(data->chptr);
|
||||||
|
|
||||||
if(IsOper(source_p))
|
if(is(*source_p, umode::OPER))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if((chptr->mode.mode & mymode) && IsOper(who))
|
if((chptr->mode.mode & mymode) && is(*who, umode::OPER))
|
||||||
{
|
{
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s attempted to kick %s from %s (which is +M)",
|
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s attempted to kick %s from %s (which is +M)",
|
||||||
source_p->name, who->name, chptr->name.c_str());
|
source_p->name, who->name, chptr->name.c_str());
|
||||||
|
|
|
@ -38,7 +38,7 @@ h_can_join(hook_data_channel *data)
|
||||||
client::client *source_p = data->client;
|
client::client *source_p = data->client;
|
||||||
const auto &chptr(data->chptr);
|
const auto &chptr(data->chptr);
|
||||||
|
|
||||||
if((chptr->mode.mode & mymode) && !IsSSLClient(source_p)) {
|
if((chptr->mode.mode & mymode) && !is(*source_p, umode::SSLCLIENT)) {
|
||||||
/* XXX This is equal to ERR_THROTTLE */
|
/* XXX This is equal to ERR_THROTTLE */
|
||||||
sendto_one_numeric(source_p, 480, "%s :Cannot join channel (+S) - SSL/TLS required", chptr->name.c_str());
|
sendto_one_numeric(source_p, 480, "%s :Cannot join channel (+S) - SSL/TLS required", chptr->name.c_str());
|
||||||
data->approved = chan::mode::ERR_CUSTOM;
|
data->approved = chan::mode::ERR_CUSTOM;
|
||||||
|
|
|
@ -24,6 +24,6 @@ h_can_create_channel_authenticated(hook_data_client_approval *data)
|
||||||
{
|
{
|
||||||
client::client *source_p = data->client;
|
client::client *source_p = data->client;
|
||||||
|
|
||||||
if (suser(user(*source_p)).empty() && !IsOper(source_p))
|
if (suser(user(*source_p)).empty() && !is(*source_p, umode::OPER))
|
||||||
data->approved = ERR_NEEDREGGEDNICK;
|
data->approved = ERR_NEEDREGGEDNICK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ h_can_create_channel_authenticated(hook_data_client_approval *data)
|
||||||
{
|
{
|
||||||
client::client *source_p = data->client;
|
client::client *source_p = data->client;
|
||||||
|
|
||||||
if (!IsOper(source_p))
|
if (!is(*source_p, umode::OPER))
|
||||||
{
|
{
|
||||||
sendto_one_notice(source_p, ":*** Channel creation is restricted to network staff only.");
|
sendto_one_notice(source_p, ":*** Channel creation is restricted to network staff only.");
|
||||||
data->approved = ERR_NEEDREGGEDNICK;
|
data->approved = ERR_NEEDREGGEDNICK;
|
||||||
|
|
|
@ -44,5 +44,5 @@ eb_oper(const char *data, client::client *client_p, chan::chan *chptr, mode::typ
|
||||||
return HasPrivilege(client_p, data) ? MATCH : NOMATCH;
|
return HasPrivilege(client_p, data) ? MATCH : NOMATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
return IsOper(client_p) ? MATCH : NOMATCH;
|
return is(*client_p, umode::OPER) ? MATCH : NOMATCH;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,5 +35,5 @@ static int eb_ssl(const char *data, client::client *client_p,
|
||||||
if (data != NULL)
|
if (data != NULL)
|
||||||
return INVALID;
|
return INVALID;
|
||||||
|
|
||||||
return IsSSLClient(client_p) ? MATCH : NOMATCH;
|
return is(*client_p, umode::SSLCLIENT) ? MATCH : NOMATCH;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ static int eb_usermode(const char *data, client::client *client_p,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ((client_p->umodes & modes_ack) == modes_ack &&
|
return ((client_p->mode & modes_ack) == modes_ack &&
|
||||||
!(client_p->umodes & modes_nak)) ?
|
!(client_p->mode & modes_nak)) ?
|
||||||
MATCH : NOMATCH;
|
MATCH : NOMATCH;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ h_noi_umode_changed(hook_data_umode_changed *hdata)
|
||||||
{
|
{
|
||||||
client::client *source_p = hdata->client;
|
client::client *source_p = hdata->client;
|
||||||
|
|
||||||
if (my(*source_p) && !IsOper(source_p) && !is_invisible(*source_p)) {
|
if (my(*source_p) && !is(*source_p, umode::OPER) && !is(*source_p, umode::INVISIBLE)) {
|
||||||
SetInvisible(source_p);
|
set(*source_p, umode::INVISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ do_dehelper(client::client &source, client::client &target)
|
||||||
{
|
{
|
||||||
const char *fakeparv[4];
|
const char *fakeparv[4];
|
||||||
|
|
||||||
if(!(target.umodes & UMODE_HELPOPS))
|
if(!(target.mode & UMODE_HELPOPS))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s is using DEHELPER on %s",
|
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s is using DEHELPER on %s",
|
||||||
|
@ -145,14 +145,14 @@ h_hdl_stats_request(hook_data_int *hdata)
|
||||||
static void
|
static void
|
||||||
h_hdl_new_remote_user(client::client *client_p)
|
h_hdl_new_remote_user(client::client *client_p)
|
||||||
{
|
{
|
||||||
if (client_p->umodes & UMODE_HELPOPS)
|
if (client_p->mode & UMODE_HELPOPS)
|
||||||
rb_dlinkAddAlloc(client_p, &helper_list);
|
rb_dlinkAddAlloc(client_p, &helper_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
h_hdl_client_exit(hook_data_client_exit *hdata)
|
h_hdl_client_exit(hook_data_client_exit *hdata)
|
||||||
{
|
{
|
||||||
if (hdata->target->umodes & UMODE_HELPOPS)
|
if (hdata->target->mode & UMODE_HELPOPS)
|
||||||
rb_dlinkFindDestroy(hdata->target, &helper_list);
|
rb_dlinkFindDestroy(hdata->target, &helper_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,21 +162,21 @@ h_hdl_umode_changed(hook_data_umode_changed *hdata)
|
||||||
client::client &source = *hdata->client;
|
client::client &source = *hdata->client;
|
||||||
|
|
||||||
/* didn't change +H umode, we don't need to do anything */
|
/* didn't change +H umode, we don't need to do anything */
|
||||||
if (!((hdata->oldumodes ^ source.umodes) & UMODE_HELPOPS))
|
if (!((hdata->oldumodes ^ source.mode) & UMODE_HELPOPS))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (source.umodes & UMODE_HELPOPS)
|
if (source.mode & UMODE_HELPOPS)
|
||||||
{
|
{
|
||||||
if (my(source) && !HasPrivilege(&source, "usermode:helpops"))
|
if (my(source) && !HasPrivilege(&source, "usermode:helpops"))
|
||||||
{
|
{
|
||||||
source.umodes &= ~UMODE_HELPOPS;
|
source.mode &= umode(~UMODE_HELPOPS);
|
||||||
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "usermode:helpops");
|
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "usermode:helpops");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_dlinkAddAlloc(&source, &helper_list);
|
rb_dlinkAddAlloc(&source, &helper_list);
|
||||||
}
|
}
|
||||||
else if (!(source.umodes & UMODE_HELPOPS))
|
else if (!(source.mode & UMODE_HELPOPS))
|
||||||
rb_dlinkFindDestroy(&source, &helper_list);
|
rb_dlinkFindDestroy(&source, &helper_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ h_hdl_whois(hook_data_client *hdata)
|
||||||
client::client &source = *hdata->client;
|
client::client &source = *hdata->client;
|
||||||
client::client *target_p = hdata->target;
|
client::client *target_p = hdata->target;
|
||||||
|
|
||||||
if ((target_p->umodes & UMODE_HELPOPS) && away(user(*target_p)).empty())
|
if ((target_p->mode & UMODE_HELPOPS) && away(user(*target_p)).empty())
|
||||||
{
|
{
|
||||||
sendto_one_numeric(&source, RPL_WHOISHELPOP, form_str(RPL_WHOISHELPOP), target_p->name);
|
sendto_one_numeric(&source, RPL_WHOISHELPOP, form_str(RPL_WHOISHELPOP), target_p->name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,5 +19,5 @@ DECLARE_MODULE_AV2(hide_uncommon_channels, NULL, NULL, NULL, NULL, huc_hfnlist,
|
||||||
static void
|
static void
|
||||||
h_huc_doing_whois_channel_visibility(hook_data_client *hdata)
|
h_huc_doing_whois_channel_visibility(hook_data_client *hdata)
|
||||||
{
|
{
|
||||||
hdata->approved = (is_public(hdata->chptr) && !is_invisible(*hdata->target)) || is_member(hdata->chptr, hdata->client);
|
hdata->approved = (is_public(hdata->chptr) && !is(*hdata->target, umode::INVISIBLE)) || is_member(hdata->chptr, hdata->client);
|
||||||
}
|
}
|
||||||
|
|
|
@ -457,9 +457,9 @@ doing_stats_hook(hook_data_int *hdata)
|
||||||
client::client &source = *hdata->client;
|
client::client &source = *hdata->client;
|
||||||
if(hdata->arg2 != (int) 's')
|
if(hdata->arg2 != (int) 's')
|
||||||
return;
|
return;
|
||||||
if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOper(&source))
|
if((ConfigFileEntry.stats_k_oper_only == 2) && !is(source, umode::OPER))
|
||||||
return;
|
return;
|
||||||
if ((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper(&source))
|
if ((ConfigFileEntry.stats_k_oper_only == 1) && !is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
hurt = hurt_find(source.sockhost);
|
hurt = hurt_find(source.sockhost);
|
||||||
if (hurt != NULL)
|
if (hurt != NULL)
|
||||||
|
|
|
@ -162,14 +162,14 @@ check_umode_change(void *vdata)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* didn't change +h umode, we don't need to do anything */
|
/* didn't change +h umode, we don't need to do anything */
|
||||||
if (!((data->oldumodes ^ source_p->umodes) & user_modes['h']))
|
if (!((data->oldumodes ^ source_p->mode) & user_modes['h']))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (source_p->umodes & user_modes['h'])
|
if (source_p->mode & user_modes['h'])
|
||||||
{
|
{
|
||||||
if (is_ip_spoof(*source_p) || source_p->localClient->mangledhost == NULL || (is_dyn_spoof(*source_p) && strcmp(source_p->host, source_p->localClient->mangledhost)))
|
if (is_ip_spoof(*source_p) || source_p->localClient->mangledhost == NULL || (is_dyn_spoof(*source_p) && strcmp(source_p->host, source_p->localClient->mangledhost)))
|
||||||
{
|
{
|
||||||
source_p->umodes &= ~user_modes['h'];
|
source_p->mode &= umode(~user_modes['h']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (strcmp(source_p->host, source_p->localClient->mangledhost))
|
if (strcmp(source_p->host, source_p->localClient->mangledhost))
|
||||||
|
@ -180,7 +180,7 @@ check_umode_change(void *vdata)
|
||||||
sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
|
sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
|
||||||
source_p->host);
|
source_p->host);
|
||||||
}
|
}
|
||||||
else if (!(source_p->umodes & user_modes['h']))
|
else if (!(source_p->mode & user_modes['h']))
|
||||||
{
|
{
|
||||||
if (source_p->localClient->mangledhost != NULL &&
|
if (source_p->localClient->mangledhost != NULL &&
|
||||||
!strcmp(source_p->host, source_p->localClient->mangledhost))
|
!strcmp(source_p->host, source_p->localClient->mangledhost))
|
||||||
|
@ -197,7 +197,7 @@ check_new_user(void *vdata)
|
||||||
|
|
||||||
if (is_ip_spoof(*source_p))
|
if (is_ip_spoof(*source_p))
|
||||||
{
|
{
|
||||||
source_p->umodes &= ~user_modes['h'];
|
source_p->mode &= umode(~user_modes['h']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
source_p->localClient->mangledhost = (char *)rb_malloc(HOSTLEN + 1);
|
source_p->localClient->mangledhost = (char *)rb_malloc(HOSTLEN + 1);
|
||||||
|
@ -206,8 +206,8 @@ check_new_user(void *vdata)
|
||||||
else
|
else
|
||||||
do_host_cloak_host(source_p->orighost, source_p->localClient->mangledhost);
|
do_host_cloak_host(source_p->orighost, source_p->localClient->mangledhost);
|
||||||
if (is_dyn_spoof(*source_p))
|
if (is_dyn_spoof(*source_p))
|
||||||
source_p->umodes &= ~user_modes['h'];
|
source_p->mode &= umode(~user_modes['h']);
|
||||||
if (source_p->umodes & user_modes['h'])
|
if (source_p->mode & user_modes['h'])
|
||||||
{
|
{
|
||||||
rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host));
|
rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host));
|
||||||
if (irccmp(source_p->host, source_p->orighost))
|
if (irccmp(source_p->host, source_p->orighost))
|
||||||
|
|
|
@ -168,14 +168,14 @@ check_umode_change(void *vdata)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* didn't change +h umode, we don't need to do anything */
|
/* didn't change +h umode, we don't need to do anything */
|
||||||
if (!((data->oldumodes ^ source_p->umodes) & user_modes['h']))
|
if (!((data->oldumodes ^ source_p->mode) & user_modes['h']))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (source_p->umodes & user_modes['h'])
|
if (source_p->mode & user_modes['h'])
|
||||||
{
|
{
|
||||||
if (is_ip_spoof(*source_p) || source_p->localClient->mangledhost == NULL || (is_dyn_spoof(*source_p) && strcmp(source_p->host, source_p->localClient->mangledhost)))
|
if (is_ip_spoof(*source_p) || source_p->localClient->mangledhost == NULL || (is_dyn_spoof(*source_p) && strcmp(source_p->host, source_p->localClient->mangledhost)))
|
||||||
{
|
{
|
||||||
source_p->umodes &= ~user_modes['h'];
|
source_p->mode &= umode(~user_modes['h']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (strcmp(source_p->host, source_p->localClient->mangledhost))
|
if (strcmp(source_p->host, source_p->localClient->mangledhost))
|
||||||
|
@ -186,7 +186,7 @@ check_umode_change(void *vdata)
|
||||||
sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
|
sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
|
||||||
source_p->host);
|
source_p->host);
|
||||||
}
|
}
|
||||||
else if (!(source_p->umodes & user_modes['h']))
|
else if (!(source_p->mode & user_modes['h']))
|
||||||
{
|
{
|
||||||
if (source_p->localClient->mangledhost != NULL &&
|
if (source_p->localClient->mangledhost != NULL &&
|
||||||
!strcmp(source_p->host, source_p->localClient->mangledhost))
|
!strcmp(source_p->host, source_p->localClient->mangledhost))
|
||||||
|
@ -203,7 +203,7 @@ check_new_user(void *vdata)
|
||||||
|
|
||||||
if (is_ip_spoof(*source_p))
|
if (is_ip_spoof(*source_p))
|
||||||
{
|
{
|
||||||
source_p->umodes &= ~user_modes['h'];
|
source_p->mode &= umode(~user_modes['h']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
source_p->localClient->mangledhost = (char *)rb_malloc(HOSTLEN);
|
source_p->localClient->mangledhost = (char *)rb_malloc(HOSTLEN);
|
||||||
|
@ -212,8 +212,8 @@ check_new_user(void *vdata)
|
||||||
else
|
else
|
||||||
do_host_cloak_host(source_p->orighost, source_p->localClient->mangledhost);
|
do_host_cloak_host(source_p->orighost, source_p->localClient->mangledhost);
|
||||||
if (is_dyn_spoof(*source_p))
|
if (is_dyn_spoof(*source_p))
|
||||||
source_p->umodes &= ~user_modes['h'];
|
source_p->mode &= umode(~user_modes['h']);
|
||||||
if (source_p->umodes & user_modes['h'])
|
if (source_p->mode & user_modes['h'])
|
||||||
{
|
{
|
||||||
rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host));
|
rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host));
|
||||||
if (irccmp(source_p->host, source_p->orighost))
|
if (irccmp(source_p->host, source_p->orighost))
|
||||||
|
|
|
@ -162,14 +162,14 @@ check_umode_change(void *vdata)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* didn't change +h umode, we don't need to do anything */
|
/* didn't change +h umode, we don't need to do anything */
|
||||||
if (!((data->oldumodes ^ source_p->umodes) & user_modes['x']))
|
if (!((data->oldumodes ^ source_p->mode) & user_modes['x']))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (source_p->umodes & user_modes['x'])
|
if (source_p->mode & user_modes['x'])
|
||||||
{
|
{
|
||||||
if (is_ip_spoof(*source_p) || source_p->localClient->mangledhost == NULL || (is_dyn_spoof(*source_p) && strcmp(source_p->host, source_p->localClient->mangledhost)))
|
if (is_ip_spoof(*source_p) || source_p->localClient->mangledhost == NULL || (is_dyn_spoof(*source_p) && strcmp(source_p->host, source_p->localClient->mangledhost)))
|
||||||
{
|
{
|
||||||
source_p->umodes &= ~user_modes['x'];
|
source_p->mode &= umode(~user_modes['x']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (strcmp(source_p->host, source_p->localClient->mangledhost))
|
if (strcmp(source_p->host, source_p->localClient->mangledhost))
|
||||||
|
@ -180,7 +180,7 @@ check_umode_change(void *vdata)
|
||||||
sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
|
sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
|
||||||
source_p->host);
|
source_p->host);
|
||||||
}
|
}
|
||||||
else if (!(source_p->umodes & user_modes['x']))
|
else if (!(source_p->mode & user_modes['x']))
|
||||||
{
|
{
|
||||||
if (source_p->localClient->mangledhost != NULL &&
|
if (source_p->localClient->mangledhost != NULL &&
|
||||||
!strcmp(source_p->host, source_p->localClient->mangledhost))
|
!strcmp(source_p->host, source_p->localClient->mangledhost))
|
||||||
|
@ -197,7 +197,7 @@ check_new_user(void *vdata)
|
||||||
|
|
||||||
if (is_ip_spoof(*source_p))
|
if (is_ip_spoof(*source_p))
|
||||||
{
|
{
|
||||||
source_p->umodes &= ~user_modes['x'];
|
source_p->mode &= umode(~user_modes['x']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
source_p->localClient->mangledhost = (char *)rb_malloc(HOSTLEN + 1);
|
source_p->localClient->mangledhost = (char *)rb_malloc(HOSTLEN + 1);
|
||||||
|
@ -206,8 +206,8 @@ check_new_user(void *vdata)
|
||||||
else
|
else
|
||||||
do_host_cloak_host(source_p->orighost, source_p->localClient->mangledhost);
|
do_host_cloak_host(source_p->orighost, source_p->localClient->mangledhost);
|
||||||
if (is_dyn_spoof(*source_p))
|
if (is_dyn_spoof(*source_p))
|
||||||
source_p->umodes &= ~user_modes['x'];
|
source_p->mode &= umode(~user_modes['x']);
|
||||||
if (source_p->umodes & user_modes['x'])
|
if (source_p->mode & user_modes['x'])
|
||||||
{
|
{
|
||||||
rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host));
|
rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host));
|
||||||
if (irccmp(source_p->host, source_p->orighost))
|
if (irccmp(source_p->host, source_p->orighost))
|
||||||
|
|
|
@ -110,14 +110,14 @@ check_umode_change(void *vdata)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* didn't change +h umode, we don't need to do anything */
|
/* didn't change +h umode, we don't need to do anything */
|
||||||
if (!((data->oldumodes ^ source_p->umodes) & user_modes['h']))
|
if (!((data->oldumodes ^ source_p->mode) & user_modes['h']))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (source_p->umodes & user_modes['h'])
|
if (source_p->mode & user_modes['h'])
|
||||||
{
|
{
|
||||||
if (is_ip_spoof(*source_p) || source_p->localClient->mangledhost == NULL || (is_dyn_spoof(*source_p) && strcmp(source_p->host, source_p->localClient->mangledhost)))
|
if (is_ip_spoof(*source_p) || source_p->localClient->mangledhost == NULL || (is_dyn_spoof(*source_p) && strcmp(source_p->host, source_p->localClient->mangledhost)))
|
||||||
{
|
{
|
||||||
source_p->umodes &= ~user_modes['h'];
|
source_p->mode &= umode(~user_modes['h']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (strcmp(source_p->host, source_p->localClient->mangledhost))
|
if (strcmp(source_p->host, source_p->localClient->mangledhost))
|
||||||
|
@ -128,7 +128,7 @@ check_umode_change(void *vdata)
|
||||||
sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
|
sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
|
||||||
source_p->host);
|
source_p->host);
|
||||||
}
|
}
|
||||||
else if (!(source_p->umodes & user_modes['h']))
|
else if (!(source_p->mode & user_modes['h']))
|
||||||
{
|
{
|
||||||
if (source_p->localClient->mangledhost != NULL &&
|
if (source_p->localClient->mangledhost != NULL &&
|
||||||
!strcmp(source_p->host, source_p->localClient->mangledhost))
|
!strcmp(source_p->host, source_p->localClient->mangledhost))
|
||||||
|
@ -145,7 +145,7 @@ check_new_user(void *vdata)
|
||||||
|
|
||||||
if (is_ip_spoof(*source_p))
|
if (is_ip_spoof(*source_p))
|
||||||
{
|
{
|
||||||
source_p->umodes &= ~user_modes['h'];
|
source_p->mode &= umode(~user_modes['h']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
source_p->localClient->mangledhost = (char *)rb_malloc(HOSTLEN);
|
source_p->localClient->mangledhost = (char *)rb_malloc(HOSTLEN);
|
||||||
|
@ -154,8 +154,8 @@ check_new_user(void *vdata)
|
||||||
else
|
else
|
||||||
do_host_cloak(source_p->orighost, source_p->localClient->mangledhost, 0);
|
do_host_cloak(source_p->orighost, source_p->localClient->mangledhost, 0);
|
||||||
if (is_dyn_spoof(*source_p))
|
if (is_dyn_spoof(*source_p))
|
||||||
source_p->umodes &= ~user_modes['h'];
|
source_p->mode &= umode(~user_modes['h']);
|
||||||
if (source_p->umodes & user_modes['h'])
|
if (source_p->mode & user_modes['h'])
|
||||||
{
|
{
|
||||||
rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host));
|
rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host));
|
||||||
if (irccmp(source_p->host, source_p->orighost))
|
if (irccmp(source_p->host, source_p->orighost))
|
||||||
|
|
|
@ -47,18 +47,18 @@ DECLARE_MODULE_AV2(adminwall, NULL, NULL, adminwall_clist, NULL, NULL, NULL, NUL
|
||||||
static void
|
static void
|
||||||
mo_adminwall(struct MsgBuf *msgbuf_p, client::client &client, client::client &source, int parc, const char *parv[])
|
mo_adminwall(struct MsgBuf *msgbuf_p, client::client &client, client::client &source, int parc, const char *parv[])
|
||||||
{
|
{
|
||||||
if(!IsAdmin(&source))
|
if(!is(source, umode::ADMIN))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_NOPRIVS),
|
sendto_one(&source, form_str(ERR_NOPRIVS),
|
||||||
me.name, source.name, "adminwall");
|
me.name, source.name, "adminwall");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sendto_wallops_flags(UMODE_ADMIN, &source, "ADMINWALL - %s", parv[1]);
|
sendto_wallops_flags(umode::ADMIN, &source, "ADMINWALL - %s", parv[1]);
|
||||||
sendto_match_servs(&source, "*", CAP_ENCAP, NOCAPS, "ENCAP * ADMINWALL :%s", parv[1]);
|
sendto_match_servs(&source, "*", CAP_ENCAP, NOCAPS, "ENCAP * ADMINWALL :%s", parv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
me_adminwall(struct MsgBuf *msgbuf_p, client::client &client, client::client &source, int parc, const char *parv[])
|
me_adminwall(struct MsgBuf *msgbuf_p, client::client &client, client::client &source, int parc, const char *parv[])
|
||||||
{
|
{
|
||||||
sendto_wallops_flags(UMODE_ADMIN, &source, "ADMINWALL - %s", parv[1]);
|
sendto_wallops_flags(umode::ADMIN, &source, "ADMINWALL - %s", parv[1]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ m_findforwards(struct MsgBuf *msgbuf_p, client::client &client, client::client &
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
/* Allow ircops to search for forwards to nonexistent channels */
|
/* Allow ircops to search for forwards to nonexistent channels */
|
||||||
if(!IsOper(&source))
|
if(!is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
if((chptr = chan::get(parv[1], std::nothrow)) == NULL || (msptr = get(chptr->members, source, std::nothrow)) == NULL)
|
if((chptr = chan::get(parv[1], std::nothrow)) == NULL || (msptr = get(chptr->members, source, std::nothrow)) == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,7 +63,7 @@ m_identify(struct MsgBuf *msgbuf_p, client::client &client, client::client &sour
|
||||||
}
|
}
|
||||||
|
|
||||||
nick = parv[1][0] == '#' ? SVS_chanserv_NICK : SVS_nickserv_NICK;
|
nick = parv[1][0] == '#' ? SVS_chanserv_NICK : SVS_nickserv_NICK;
|
||||||
if ((target_p = client::find_named_person(nick)) && IsService(target_p))
|
if ((target_p = client::find_named_person(nick)) && is(*target_p, umode::SERVICE))
|
||||||
{
|
{
|
||||||
sendto_one(target_p, ":%s PRIVMSG %s :IDENTIFY %s", get_id(&source, target_p), get_id(target_p, target_p), reconstruct_parv(parc - 1, &parv[1]));
|
sendto_one(target_p, ":%s PRIVMSG %s :IDENTIFY %s", get_id(&source, target_p), get_id(target_p, target_p), reconstruct_parv(parc - 1, &parv[1]));
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ DECLARE_MODULE_AV2(locops, NULL, NULL, locops_clist, NULL, NULL, NULL, NULL, loc
|
||||||
static void
|
static void
|
||||||
m_locops(struct MsgBuf *msgbuf_p, client::client &client, client::client &source, int parc, const char *parv[])
|
m_locops(struct MsgBuf *msgbuf_p, client::client &client, client::client &source, int parc, const char *parv[])
|
||||||
{
|
{
|
||||||
sendto_wallops_flags(UMODE_LOCOPS, &source, "LOCOPS - %s", parv[1]);
|
sendto_wallops_flags(umode::LOCOPS, &source, "LOCOPS - %s", parv[1]);
|
||||||
|
|
||||||
if(rb_dlink_list_length(&cluster_conf_list) > 0)
|
if(rb_dlink_list_length(&cluster_conf_list) > 0)
|
||||||
cluster_generic(&source, "LOCOPS", SHARED_LOCOPS, CAP_CLUSTER,
|
cluster_generic(&source, "LOCOPS", SHARED_LOCOPS, CAP_CLUSTER,
|
||||||
|
@ -68,7 +68,7 @@ ms_locops(struct MsgBuf *msgbuf_p, client::client &client, client::client &sourc
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(find_shared_conf("*", "*", source.servptr->name, SHARED_LOCOPS))
|
if(find_shared_conf("*", "*", source.servptr->name, SHARED_LOCOPS))
|
||||||
sendto_wallops_flags(UMODE_LOCOPS, &source, "SLOCOPS - %s", parv[2]);
|
sendto_wallops_flags(umode::LOCOPS, &source, "SLOCOPS - %s", parv[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -79,6 +79,6 @@ me_locops(struct MsgBuf *msgbuf_p, client::client &client, client::client &sourc
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(find_shared_conf("*", "*", source.servptr->name, SHARED_LOCOPS))
|
if(find_shared_conf("*", "*", source.servptr->name, SHARED_LOCOPS))
|
||||||
sendto_wallops_flags(UMODE_LOCOPS, &source, "SLOCOPS - %s", parv[1]);
|
sendto_wallops_flags(umode::LOCOPS, &source, "SLOCOPS - %s", parv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ mo_ojoin(struct MsgBuf *msgbuf_p, client::client &client, client::client &source
|
||||||
if(move_me == 1)
|
if(move_me == 1)
|
||||||
parv[1]--;
|
parv[1]--;
|
||||||
|
|
||||||
sendto_wallops_flags(UMODE_WALLOP, &me,
|
sendto_wallops_flags(umode::WALLOP, &me,
|
||||||
"OJOIN called for %s by %s!%s@%s",
|
"OJOIN called for %s by %s!%s@%s",
|
||||||
parv[1], source.name, source.username, source.host);
|
parv[1], source.name, source.username, source.host);
|
||||||
ilog(L_MAIN, "OJOIN called for %s by %s",
|
ilog(L_MAIN, "OJOIN called for %s by %s",
|
||||||
|
|
|
@ -103,7 +103,7 @@ mo_okick(struct MsgBuf *msgbuf_p, client::client &client, client::client &source
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendto_wallops_flags(UMODE_WALLOP, &me,
|
sendto_wallops_flags(umode::WALLOP, &me,
|
||||||
"OKICK called for %s %s by %s!%s@%s",
|
"OKICK called for %s %s by %s!%s@%s",
|
||||||
chptr->name.c_str(), target_p->name,
|
chptr->name.c_str(), target_p->name,
|
||||||
source.name, source.username, source.host);
|
source.name, source.username, source.host);
|
||||||
|
|
|
@ -93,7 +93,7 @@ mo_omode(struct MsgBuf *msgbuf_p, client::client &client, client::client &source
|
||||||
rb_strlcat(params, parv[i], sizeof params);
|
rb_strlcat(params, parv[i], sizeof params);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendto_wallops_flags(UMODE_WALLOP, &me,
|
sendto_wallops_flags(umode::WALLOP, &me,
|
||||||
"OMODE called for [%s] [%s] by %s!%s@%s",
|
"OMODE called for [%s] [%s] by %s!%s@%s",
|
||||||
parv[1], params, source.name, source.username, source.host);
|
parv[1], params, source.name, source.username, source.host);
|
||||||
ilog(L_MAIN, "OMODE called for [%s] [%s] by %s",
|
ilog(L_MAIN, "OMODE called for [%s] [%s] by %s",
|
||||||
|
|
|
@ -75,7 +75,7 @@ mo_opme(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
|
|
||||||
msptr->flags |= chan::CHANOP;
|
msptr->flags |= chan::CHANOP;
|
||||||
|
|
||||||
sendto_wallops_flags(UMODE_WALLOP, &me,
|
sendto_wallops_flags(umode::WALLOP, &me,
|
||||||
"OPME called for [%s] by %s!%s@%s",
|
"OPME called for [%s] by %s!%s@%s",
|
||||||
parv[1], source.name, source.username, source.host);
|
parv[1], source.name, source.username, source.host);
|
||||||
ilog(L_MAIN, "OPME called for [%s] by %s",
|
ilog(L_MAIN, "OPME called for [%s] by %s",
|
||||||
|
|
|
@ -143,7 +143,7 @@ m_remove(struct MsgBuf *msgbuf_p, client::client &client, client::client &source
|
||||||
|
|
||||||
if(msptr != NULL)
|
if(msptr != NULL)
|
||||||
{
|
{
|
||||||
if(my(source) && IsService(who))
|
if(my(source) && is(*who, umode::SERVICE))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_ISCHANSERVICE),
|
sendto_one(&source, form_str(ERR_ISCHANSERVICE),
|
||||||
me.name, source.name, who->name, chptr->name.c_str());
|
me.name, source.name, who->name, chptr->name.c_str());
|
||||||
|
|
|
@ -164,7 +164,7 @@ m_displaymsg(struct MsgBuf *msgbuf_p, client::client &source, const char *channe
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* enforce target change on roleplay commands */
|
/* enforce target change on roleplay commands */
|
||||||
if(!is_chanop(msptr) && !is_voiced(msptr) && !IsOper(&source) && !add_channel_target(&source, chptr))
|
if(!is_chanop(msptr) && !is_voiced(msptr) && !is(source, umode::OPER) && !add_channel_target(&source, chptr))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_TARGCHANGE),
|
sendto_one(&source, form_str(ERR_TARGCHANGE),
|
||||||
me.name, source.name, chptr->name.c_str());
|
me.name, source.name, chptr->name.c_str());
|
||||||
|
|
|
@ -28,7 +28,7 @@ block_services_kill(void *vdata)
|
||||||
if (!data->approved)
|
if (!data->approved)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (IsService(data->target))
|
if (is(*data->target, umode::SERVICE))
|
||||||
{
|
{
|
||||||
sendto_one_numeric(data->client, ERR_ISCHANSERVICE,
|
sendto_one_numeric(data->client, ERR_ISCHANSERVICE,
|
||||||
"KILL %s :Cannot kill a network service",
|
"KILL %s :Cannot kill a network service",
|
||||||
|
|
|
@ -21,8 +21,8 @@ h_nl_umode_changed(hook_data_umode_changed *hdata)
|
||||||
{
|
{
|
||||||
client::client *source_p = hdata->client;
|
client::client *source_p = hdata->client;
|
||||||
|
|
||||||
if (my(*source_p) && source_p->umodes & UMODE_LOCOPS)
|
if (my(*source_p) && source_p->mode & umode::LOCOPS)
|
||||||
{
|
{
|
||||||
source_p->umodes &= ~UMODE_LOCOPS;
|
source_p->mode &= ~umode::LOCOPS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,13 +23,13 @@ h_noi_umode_changed(hook_data_umode_changed *hdata)
|
||||||
{
|
{
|
||||||
client::client *source_p = hdata->client;
|
client::client *source_p = hdata->client;
|
||||||
|
|
||||||
if (my(*source_p) && IsOper(source_p) && !IsOperInvis(source_p) &&
|
if (my(*source_p) && is(*source_p, umode::OPER) && !IsOperInvis(source_p) &&
|
||||||
is_invisible(*source_p))
|
is(*source_p, umode::INVISIBLE))
|
||||||
{
|
{
|
||||||
ClearInvisible(source_p);
|
clear(*source_p, umode::INVISIBLE);
|
||||||
/* If they tried /umode +i, complain; do not complain
|
/* If they tried /umode +i, complain; do not complain
|
||||||
* if they opered up while invisible -- jilles */
|
* if they opered up while invisible -- jilles */
|
||||||
if (hdata->oldumodes & UMODE_OPER)
|
if (hdata->oldumodes & umode::OPER)
|
||||||
sendto_one_notice(source_p, ":*** Opers may not set themselves invisible");
|
sendto_one_notice(source_p, ":*** Opers may not set themselves invisible");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,19 +101,19 @@ check_umode_change(void *vdata)
|
||||||
if (!my(*source_p))
|
if (!my(*source_p))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (data->oldumodes & UMODE_OPER && !IsOper(source_p))
|
if (data->oldumodes & umode::OPER && !is(*source_p, umode::OPER))
|
||||||
source_p->umodes &= ~user_modes['p'];
|
source_p->mode &= umode(~user_modes['p']);
|
||||||
|
|
||||||
/* didn't change +p umode, we don't need to do anything */
|
/* didn't change +p umode, we don't need to do anything */
|
||||||
if (!((data->oldumodes ^ source_p->umodes) & user_modes['p']))
|
if (!((data->oldumodes ^ source_p->mode) & user_modes['p']))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (source_p->umodes & user_modes['p'])
|
if (source_p->mode & user_modes['p'])
|
||||||
{
|
{
|
||||||
if (!IsOperOverride(source_p))
|
if (!IsOperOverride(source_p))
|
||||||
{
|
{
|
||||||
sendto_one_notice(source_p, ":*** You need oper:override privilege for +p");
|
sendto_one_notice(source_p, ":*** You need oper:override privilege for +p");
|
||||||
source_p->umodes &= ~user_modes['p'];
|
source_p->mode &= umode(~user_modes['p']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ check_umode_change(void *vdata)
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s has enabled oper-override (+p)",
|
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s has enabled oper-override (+p)",
|
||||||
get_oper_name(source_p));
|
get_oper_name(source_p));
|
||||||
}
|
}
|
||||||
else if (!(source_p->umodes & user_modes['p']))
|
else if (!(source_p->mode & user_modes['p']))
|
||||||
{
|
{
|
||||||
rb_dlink_node *n, *tn;
|
rb_dlink_node *n, *tn;
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ hack_channel_access(void *vdata)
|
||||||
if (data->approved == chan::CHANOP)
|
if (data->approved == chan::CHANOP)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (data->client->umodes & user_modes['p'])
|
if (data->client->mode & user_modes['p'])
|
||||||
{
|
{
|
||||||
update_session_deadline(data->client, NULL);
|
update_session_deadline(data->client, NULL);
|
||||||
data->approved = CHFL_OVERRIDE;
|
data->approved = CHFL_OVERRIDE;
|
||||||
|
@ -173,7 +173,7 @@ hack_can_join(void *vdata)
|
||||||
if (data->approved == 0)
|
if (data->approved == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (data->client->umodes & user_modes['p'])
|
if (data->client->mode & user_modes['p'])
|
||||||
{
|
{
|
||||||
update_session_deadline(data->client, NULL);
|
update_session_deadline(data->client, NULL);
|
||||||
data->approved = 0;
|
data->approved = 0;
|
||||||
|
@ -193,7 +193,7 @@ hack_can_kick(void *vdata)
|
||||||
if (alevel != CHFL_OVERRIDE)
|
if (alevel != CHFL_OVERRIDE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (data->client->umodes & user_modes['p'])
|
if (data->client->mode & user_modes['p'])
|
||||||
{
|
{
|
||||||
update_session_deadline(data->client, NULL);
|
update_session_deadline(data->client, NULL);
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s is using oper-override on %s (KICK %s)",
|
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s is using oper-override on %s (KICK %s)",
|
||||||
|
@ -212,7 +212,7 @@ hack_can_send(void *vdata)
|
||||||
if (data->approved == chan::CAN_SEND_NONOP || data->approved == chan::CAN_SEND_OPV)
|
if (data->approved == chan::CAN_SEND_NONOP || data->approved == chan::CAN_SEND_OPV)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (data->client->umodes & user_modes['p'])
|
if (data->client->mode & user_modes['p'])
|
||||||
{
|
{
|
||||||
data->approved = chan::CAN_SEND_NONOP;
|
data->approved = chan::CAN_SEND_NONOP;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ h_sgo_umode_changed(void *vdata)
|
||||||
if (my_connect(*source_p) || !has_sent_eob(*source_p->servptr))
|
if (my_connect(*source_p) || !has_sent_eob(*source_p->servptr))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(data->oldumodes & UMODE_OPER) && IsOper(source_p))
|
if (!(data->oldumodes & umode::OPER) && is(*source_p, umode::OPER))
|
||||||
sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
|
sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
|
||||||
"%s (%s@%s) is now an operator",
|
"%s (%s@%s) is now an operator",
|
||||||
source_p->name, source_p->username, source_p->host);
|
source_p->name, source_p->username, source_p->host);
|
||||||
|
|
|
@ -52,7 +52,7 @@ show_whois(hook_data_client *data)
|
||||||
|
|
||||||
if(my(*target_p) &&
|
if(my(*target_p) &&
|
||||||
#ifdef OPERONLY
|
#ifdef OPERONLY
|
||||||
IsOper(target_p) &&
|
is(*target_p, umode::OPER) &&
|
||||||
#endif
|
#endif
|
||||||
(source_p != target_p) &&
|
(source_p != target_p) &&
|
||||||
(target_p->snomask & snomask_modes['W']))
|
(target_p->snomask & snomask_modes['W']))
|
||||||
|
|
|
@ -704,14 +704,14 @@ int dump_pcre_config(client::client &client, client::client &source, int parc, c
|
||||||
static
|
static
|
||||||
int spamexpr_info(client::client &client, client::client &source, int parc, const char *parv[])
|
int spamexpr_info(client::client &client, client::client &source, int parc, const char *parv[])
|
||||||
{
|
{
|
||||||
if(parc > 0 && !IsOper(&source))
|
if(parc > 0 && !is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "SPAMEXPR INFO");
|
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "SPAMEXPR INFO");
|
||||||
sendto_one_notice(&source, ":Only operators can give arguments to this command.");
|
sendto_one_notice(&source, ":Only operators can give arguments to this command.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(parc < 1 && IsOper(&source))
|
if(parc < 1 && is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
dump_pcre_config(client, source, parc, parv);
|
dump_pcre_config(client, source, parc, parv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -754,7 +754,7 @@ int spamexpr_info(client::client &client, client::client &source, int parc, cons
|
||||||
static
|
static
|
||||||
int spamexpr_list(client::client &client, client::client &source, int parc, const char *parv[])
|
int spamexpr_list(client::client &client, client::client &source, int parc, const char *parv[])
|
||||||
{
|
{
|
||||||
if(parc > 0 && !IsOper(&source))
|
if(parc > 0 && !is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "SPAMEXPR LIST");
|
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "SPAMEXPR LIST");
|
||||||
sendto_one_notice(&source, ":Only operators can give arguments to this command.");
|
sendto_one_notice(&source, ":Only operators can give arguments to this command.");
|
||||||
|
@ -790,7 +790,7 @@ int spamexpr_list(client::client &client, client::client &source, int parc, cons
|
||||||
static
|
static
|
||||||
int spamexpr_add(client::client &client, client::client &source, int parc, const char *parv[])
|
int spamexpr_add(client::client &client, client::client &source, int parc, const char *parv[])
|
||||||
{
|
{
|
||||||
if(!IsOper(&source) && !is_server(source))
|
if(!is(source, umode::OPER) && !is_server(source))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "SPAMEXPR ADD");
|
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "SPAMEXPR ADD");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -846,7 +846,7 @@ int spamexpr_add(client::client &client, client::client &source, int parc, const
|
||||||
static
|
static
|
||||||
int spamexpr_del(client::client &client, client::client &source, int parc, const char *parv[])
|
int spamexpr_del(client::client &client, client::client &source, int parc, const char *parv[])
|
||||||
{
|
{
|
||||||
if(!IsOper(&source) && !is_server(source))
|
if(!is(source, umode::OPER) && !is_server(source))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "SPAMEXPR DEL");
|
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "SPAMEXPR DEL");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -886,7 +886,7 @@ int spamexpr_del(client::client &client, client::client &source, int parc, const
|
||||||
static
|
static
|
||||||
int spamexpr_test(client::client &client, client::client &source, int parc, const char *parv[])
|
int spamexpr_test(client::client &client, client::client &source, int parc, const char *parv[])
|
||||||
{
|
{
|
||||||
if(!IsOper(&source))
|
if(!is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "SPAMEXPR TEST");
|
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "SPAMEXPR TEST");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -937,7 +937,7 @@ int spamexpr_test(client::client &client, client::client &source, int parc, cons
|
||||||
static
|
static
|
||||||
int spamexpr_sync(client::client &client, client::client &source, int parc, const char *parv[])
|
int spamexpr_sync(client::client &client, client::client &source, int parc, const char *parv[])
|
||||||
{
|
{
|
||||||
if(!IsOper(&source) && !is_server(source))
|
if(!is(source, umode::OPER) && !is_server(source))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "SPAMEXPR SYNC");
|
sendto_one(&source, form_str(ERR_NOPRIVS), me.name, source.name, "SPAMEXPR SYNC");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -38,7 +38,7 @@ umode_noctcp_process(hook_data_privmsg_user *data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->target_p->umodes & user_modes['C'] && *data->text == '\001' && rb_strncasecmp(data->text + 1, "ACTION", 6)) {
|
if (data->target_p->mode & user_modes['C'] && *data->text == '\001' && rb_strncasecmp(data->text + 1, "ACTION", 6)) {
|
||||||
sendto_one_numeric(data->source_p, ERR_CANNOTSENDTOUSER, form_str(ERR_CANNOTSENDTOUSER), data->target_p->name, "+C set");
|
sendto_one_numeric(data->source_p, ERR_CANNOTSENDTOUSER, form_str(ERR_CANNOTSENDTOUSER), data->target_p->name, "+C set");
|
||||||
data->approved = ERR_CANNOTSENDTOUSER;
|
data->approved = ERR_CANNOTSENDTOUSER;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -71,6 +71,61 @@ namespace serv
|
||||||
} // namespace ircd
|
} // namespace ircd
|
||||||
|
|
||||||
|
|
||||||
|
namespace ircd {
|
||||||
|
namespace client {
|
||||||
|
namespace mode {
|
||||||
|
|
||||||
|
enum mode : uint
|
||||||
|
{
|
||||||
|
SERVNOTICE = 0x0001, // server notices
|
||||||
|
WALLOP = 0x0002, // send wallops to them
|
||||||
|
OPERWALL = 0x0004, // operwalls
|
||||||
|
INVISIBLE = 0x0008, // makes user invisible
|
||||||
|
CALLERID = 0x0010, // block unless caller id's
|
||||||
|
LOCOPS = 0x0020, // show locops
|
||||||
|
SERVICE = 0x0040,
|
||||||
|
DEAF = 0x0080,
|
||||||
|
NOFORWARD = 0x0100, // don't forward
|
||||||
|
REGONLYMSG = 0x0200, // only allow logged in users to msg
|
||||||
|
OPER = 0x1000, // operator
|
||||||
|
ADMIN = 0x2000, // admin on server
|
||||||
|
SSLCLIENT = 0x4000, // using SSL
|
||||||
|
};
|
||||||
|
|
||||||
|
const mode DEFAULT_OPER_UMODES
|
||||||
|
{
|
||||||
|
SERVNOTICE |
|
||||||
|
OPERWALL |
|
||||||
|
WALLOP |
|
||||||
|
LOCOPS
|
||||||
|
};
|
||||||
|
|
||||||
|
inline bool
|
||||||
|
is(const mode &mask, const mode &bits)
|
||||||
|
{
|
||||||
|
return (mask & bits) == bits;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void
|
||||||
|
set(mode &mask, const mode &bits)
|
||||||
|
{
|
||||||
|
mask |= bits;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void
|
||||||
|
clear(mode &mask, const mode &bits)
|
||||||
|
{
|
||||||
|
mask &= ~bits;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace mode
|
||||||
|
} // namespace client
|
||||||
|
|
||||||
|
using umode = client::mode::mode;
|
||||||
|
|
||||||
|
} // namespace ircd
|
||||||
|
|
||||||
|
|
||||||
namespace ircd {
|
namespace ircd {
|
||||||
namespace client {
|
namespace client {
|
||||||
|
|
||||||
|
@ -85,23 +140,6 @@ enum class status : uint8_t
|
||||||
CLIENT = 0x40,
|
CLIENT = 0x40,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define UMODE_SERVNOTICE 0x0001 /* server notices */
|
|
||||||
#define UMODE_WALLOP 0x0002 /* send wallops to them */
|
|
||||||
#define UMODE_OPERWALL 0x0004 /* Operwalls */
|
|
||||||
#define UMODE_INVISIBLE 0x0008 /* makes user invisible */
|
|
||||||
#define UMODE_CALLERID 0x0010 /* block unless caller id's */
|
|
||||||
#define UMODE_LOCOPS 0x0020 /* show locops */
|
|
||||||
#define UMODE_SERVICE 0x0040
|
|
||||||
#define UMODE_DEAF 0x0080
|
|
||||||
#define UMODE_NOFORWARD 0x0100 /* don't forward */
|
|
||||||
#define UMODE_REGONLYMSG 0x0200 /* only allow logged in users to msg */
|
|
||||||
|
|
||||||
/* user information flags, only settable by remote mode or local oper */
|
|
||||||
#define UMODE_OPER 0x1000 /* Operator */
|
|
||||||
#define UMODE_ADMIN 0x2000 /* Admin on server */
|
|
||||||
#define UMODE_SSLCLIENT 0x4000 /* using SSL */
|
|
||||||
|
|
||||||
enum flags
|
enum flags
|
||||||
{
|
{
|
||||||
PINGSENT = 0x00000001, // Unreplied ping sent
|
PINGSENT = 0x00000001, // Unreplied ping sent
|
||||||
|
@ -170,7 +208,7 @@ struct client
|
||||||
rb_dlink_list whowas_clist;
|
rb_dlink_list whowas_clist;
|
||||||
|
|
||||||
time_t tsinfo; /* TS on the nick, SVINFO on server */
|
time_t tsinfo; /* TS on the nick, SVINFO on server */
|
||||||
unsigned int umodes; /* opers, normal users subset */
|
mode::mode mode;
|
||||||
uint64_t flags; /* client flags */
|
uint64_t flags; /* client flags */
|
||||||
|
|
||||||
unsigned int snomask; /* server notice mask */
|
unsigned int snomask; /* server notice mask */
|
||||||
|
@ -388,44 +426,24 @@ struct ListClient
|
||||||
int operspy;
|
int operspy;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* oper flags */
|
|
||||||
#define MyOper(x) (my_connect(*x) && IsOper(x))
|
|
||||||
|
|
||||||
#define SetOper(x) {(x)->umodes |= UMODE_OPER; \
|
|
||||||
if (my(*(x))) (x)->handler = OPER_HANDLER;}
|
|
||||||
|
|
||||||
#define ClearOper(x) {(x)->umodes &= ~(UMODE_OPER|UMODE_ADMIN); \
|
|
||||||
if (my(*(x)) && !IsOper((x)) && !is_server(*(x))) \
|
|
||||||
(x)->handler = CLIENT_HANDLER; }
|
|
||||||
|
|
||||||
|
|
||||||
#define DEFAULT_OPER_UMODES (UMODE_SERVNOTICE | UMODE_OPERWALL | \
|
|
||||||
UMODE_WALLOP | UMODE_LOCOPS)
|
|
||||||
#define DEFAULT_OPER_SNOMASK SNO_GENERAL
|
|
||||||
|
|
||||||
#define IsOper(x) ((x)->umodes & UMODE_OPER)
|
|
||||||
#define IsAdmin(x) ((x)->umodes & UMODE_ADMIN)
|
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
is_invisible(const client &client)
|
is(const client &client, const mode::mode &mode)
|
||||||
{
|
{
|
||||||
return client.umodes & UMODE_INVISIBLE;
|
return is(client.mode, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SetInvisible(x) ((x)->umodes |= UMODE_INVISIBLE)
|
inline void
|
||||||
#define ClearInvisible(x) ((x)->umodes &= ~UMODE_INVISIBLE)
|
set(client &client, const mode::mode &mode)
|
||||||
#define IsSSLClient(x) ((x)->umodes & UMODE_SSLCLIENT)
|
{
|
||||||
#define SetSSLClient(x) ((x)->umodes |= UMODE_SSLCLIENT)
|
return set(client.mode, mode);
|
||||||
#define ClearSSLClient(x) ((x)->umodes &= ~UMODE_SSLCLIENT)
|
}
|
||||||
#define SendWallops(x) ((x)->umodes & UMODE_WALLOP)
|
|
||||||
#define SendLocops(x) ((x)->umodes & UMODE_LOCOPS)
|
inline void
|
||||||
#define SendServNotice(x) ((x)->umodes & UMODE_SERVNOTICE)
|
clear(client &client, const mode::mode &mode)
|
||||||
#define SendOperwall(x) ((x)->umodes & UMODE_OPERWALL)
|
{
|
||||||
#define IsSetCallerId(x) ((x)->umodes & UMODE_CALLERID)
|
return clear(client.mode, mode);
|
||||||
#define IsService(x) ((x)->umodes & UMODE_SERVICE)
|
}
|
||||||
#define IsDeaf(x) ((x)->umodes & UMODE_DEAF)
|
|
||||||
#define IsNoForward(x) ((x)->umodes & UMODE_NOFORWARD)
|
|
||||||
#define IsSetRegOnlyMsg(x) ((x)->umodes & UMODE_REGONLYMSG)
|
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
set_got_id(client &client)
|
set_got_id(client &client)
|
||||||
|
@ -638,11 +656,7 @@ set_server(client &client)
|
||||||
client.handler = SERVER_HANDLER;
|
client.handler = SERVER_HANDLER;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool
|
bool is_oper(const client &);
|
||||||
is_oper(const client &client)
|
|
||||||
{
|
|
||||||
return client.umodes & UMODE_OPER;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
set_client(client &client)
|
set_client(client &client)
|
||||||
|
@ -731,6 +745,35 @@ my(const client &client)
|
||||||
return my_connect(client) && is_client(client);
|
return my_connect(client) && is_client(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool
|
||||||
|
my_oper(const client &client)
|
||||||
|
{
|
||||||
|
return my_connect(client) && is_oper(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool
|
||||||
|
is_oper(const client &client)
|
||||||
|
{
|
||||||
|
return is(client, mode::OPER);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void
|
||||||
|
set_oper(client &client)
|
||||||
|
{
|
||||||
|
set(client, mode::OPER);
|
||||||
|
if (my(client))
|
||||||
|
client.handler = OPER_HANDLER;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void
|
||||||
|
clear_oper(client &client)
|
||||||
|
{
|
||||||
|
clear(client, mode::OPER);
|
||||||
|
clear(client, mode::ADMIN);
|
||||||
|
if (my(client) && !is_server(client))
|
||||||
|
client.handler = CLIENT_HANDLER;
|
||||||
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
set_mark(client &client)
|
set_mark(client &client)
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,6 +54,8 @@ namespace ircd {
|
||||||
#define SNO_SPY 0x00000800
|
#define SNO_SPY 0x00000800
|
||||||
#define SNO_OPERSPY 0x00001000
|
#define SNO_OPERSPY 0x00001000
|
||||||
|
|
||||||
|
#define DEFAULT_OPER_SNOMASK SNO_GENERAL
|
||||||
|
|
||||||
char *construct_snobuf(unsigned int val);
|
char *construct_snobuf(unsigned int val);
|
||||||
unsigned int parse_snobuf_to_mask(unsigned int val, const char *sno);
|
unsigned int parse_snobuf_to_mask(unsigned int val, const char *sno);
|
||||||
unsigned int find_snomask_slot(void);
|
unsigned int find_snomask_slot(void);
|
||||||
|
|
|
@ -467,7 +467,7 @@ chan::channel_member_names(chan *chptr, client::client *client_p, int show_eon)
|
||||||
auto *const target_p(pair.first);
|
auto *const target_p(pair.first);
|
||||||
const auto &member(pair.second);
|
const auto &member(pair.second);
|
||||||
|
|
||||||
if(is_invisible(*target_p) && !is_member(chptr, client_p))
|
if(is(*target_p, umode::INVISIBLE) && !is_member(chptr, client_p))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (IsCapable(client_p, CLICAP_USERHOST_IN_NAMES))
|
if (IsCapable(client_p, CLICAP_USERHOST_IN_NAMES))
|
||||||
|
@ -859,11 +859,11 @@ chan::can_send(chan *chptr, client::client *source_p, membership *msptr)
|
||||||
moduledata.approved = CAN_SEND_NONOP;
|
moduledata.approved = CAN_SEND_NONOP;
|
||||||
moduledata.dir = MODE_QUERY;
|
moduledata.dir = MODE_QUERY;
|
||||||
|
|
||||||
if(is_server(*source_p) || IsService(source_p))
|
if(is_server(*source_p) || is(*source_p, umode::SERVICE))
|
||||||
return CAN_SEND_OPV;
|
return CAN_SEND_OPV;
|
||||||
|
|
||||||
if(my(*source_p) && hash_find_resv(chptr->name.c_str()) &&
|
if(my(*source_p) && hash_find_resv(chptr->name.c_str()) &&
|
||||||
!IsOper(source_p) && !is_exempt_resv(*source_p))
|
!is(*source_p, umode::OPER) && !is_exempt_resv(*source_p))
|
||||||
moduledata.approved = CAN_SEND_NO;
|
moduledata.approved = CAN_SEND_NO;
|
||||||
|
|
||||||
if(msptr == NULL)
|
if(msptr == NULL)
|
||||||
|
@ -1181,7 +1181,7 @@ chan::channel_modes(chan *chptr, client::client *client_p)
|
||||||
|
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
{
|
{
|
||||||
if(mode::table[i].set_func == mode::functor::hidden && (!IsOper(client_p) || !is_client(*client_p)))
|
if(mode::table[i].set_func == mode::functor::hidden && (!is(*client_p, umode::OPER) || !is_client(*client_p)))
|
||||||
continue;
|
continue;
|
||||||
if(chptr->mode.mode & mode::table[i].type)
|
if(chptr->mode.mode & mode::table[i].type)
|
||||||
*mbuf++ = i;
|
*mbuf++ = i;
|
||||||
|
|
|
@ -583,7 +583,7 @@ mode::functor::hidden(client::client *source_p, chan *chptr,
|
||||||
int alevel, int parc, int *parn,
|
int alevel, int parc, int *parn,
|
||||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||||
{
|
{
|
||||||
if(!IsOper(source_p) && !is_server(*source_p))
|
if(!is(*source_p, umode::OPER) && !is_server(*source_p))
|
||||||
{
|
{
|
||||||
if(!(*errors & SM_ERR_NOPRIVS))
|
if(!(*errors & SM_ERR_NOPRIVS))
|
||||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
|
sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
|
||||||
|
@ -630,7 +630,7 @@ mode::functor::staff(client::client *source_p, chan *chptr,
|
||||||
int alevel, int parc, int *parn,
|
int alevel, int parc, int *parn,
|
||||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||||
{
|
{
|
||||||
if(!IsOper(source_p) && !is_server(*source_p))
|
if(!is(*source_p, umode::OPER) && !is_server(*source_p))
|
||||||
{
|
{
|
||||||
if(!(*errors & SM_ERR_NOPRIVS))
|
if(!(*errors & SM_ERR_NOPRIVS))
|
||||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
|
sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
|
||||||
|
@ -984,7 +984,7 @@ mode::functor::op(client::client *source_p, chan *chptr,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(my(*source_p) && IsService(targ_p))
|
if(my(*source_p) && is(*targ_p, umode::SERVICE))
|
||||||
{
|
{
|
||||||
sendto_one(source_p, form_str(ERR_ISCHANSERVICE),
|
sendto_one(source_p, form_str(ERR_ISCHANSERVICE),
|
||||||
me.name, source_p->name, targ_p->name, chptr->name.c_str());
|
me.name, source_p->name, targ_p->name, chptr->name.c_str());
|
||||||
|
@ -1200,7 +1200,7 @@ mode::functor::forward(client::client *source_p, chan *chptr,
|
||||||
if(!allow_mode_change(source_p, chptr, alevel, errors, c))
|
if(!allow_mode_change(source_p, chptr, alevel, errors, c))
|
||||||
return;
|
return;
|
||||||
#else
|
#else
|
||||||
if(!IsOper(source_p) && !is_server(*source_p))
|
if(!is(*source_p, umode::OPER) && !is_server(*source_p))
|
||||||
{
|
{
|
||||||
if(!(*errors & SM_ERR_NOPRIVS))
|
if(!(*errors & SM_ERR_NOPRIVS))
|
||||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
|
sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
|
||||||
|
|
|
@ -916,9 +916,9 @@ client::update_client_exit_stats(client *client_p)
|
||||||
else if(is_client(*client_p))
|
else if(is_client(*client_p))
|
||||||
{
|
{
|
||||||
--Count.total;
|
--Count.total;
|
||||||
if(IsOper(client_p))
|
if(is(*client_p, umode::OPER))
|
||||||
--Count.oper;
|
--Count.oper;
|
||||||
if(is_invisible(*client_p))
|
if(is(*client_p, umode::INVISIBLE))
|
||||||
--Count.invisi;
|
--Count.invisi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1168,7 +1168,7 @@ client::is_remote_connect(client *client_p)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
oper = find_named_person(client_p->serv->by);
|
oper = find_named_person(client_p->serv->by);
|
||||||
return oper != NULL && IsOper(oper) && !my_connect(*oper);
|
return oper != NULL && my_oper(*oper);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1396,7 +1396,7 @@ client::exit_generic_client(client *client_p, client *source_p, client *from,
|
||||||
|
|
||||||
rb_dlink_node *ptr, *next_ptr;
|
rb_dlink_node *ptr, *next_ptr;
|
||||||
|
|
||||||
if(IsOper(source_p))
|
if(is(*source_p, umode::OPER))
|
||||||
rb_dlinkFindDestroy(source_p, &oper_list);
|
rb_dlinkFindDestroy(source_p, &oper_list);
|
||||||
|
|
||||||
sendto_common_channels_local(source_p, NOCAPS, NOCAPS, ":%s!%s@%s QUIT :%s",
|
sendto_common_channels_local(source_p, NOCAPS, NOCAPS, ":%s!%s@%s QUIT :%s",
|
||||||
|
@ -1659,7 +1659,7 @@ client::exit_local_client(client *client_p, client *source_p, client *from,
|
||||||
rb_dlinkDelete(&source_p->localClient->tnode, &lclient_list);
|
rb_dlinkDelete(&source_p->localClient->tnode, &lclient_list);
|
||||||
me.serv->users.erase(source_p->lnode);
|
me.serv->users.erase(source_p->lnode);
|
||||||
|
|
||||||
if(IsOper(source_p))
|
if(is(*source_p, umode::OPER))
|
||||||
rb_dlinkFindDestroy(source_p, &local_oper_list);
|
rb_dlinkFindDestroy(source_p, &local_oper_list);
|
||||||
|
|
||||||
sendto_realops_snomask(SNO_CCONN, L_ALL,
|
sendto_realops_snomask(SNO_CCONN, L_ALL,
|
||||||
|
@ -1873,11 +1873,11 @@ client::show_ip(client *source_p, client *target_p)
|
||||||
* to local opers.
|
* to local opers.
|
||||||
*/
|
*/
|
||||||
if(!ConfigFileEntry.hide_spoof_ips &&
|
if(!ConfigFileEntry.hide_spoof_ips &&
|
||||||
(source_p == NULL || MyOper(source_p)))
|
(source_p == NULL || my_oper(*source_p)))
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if(is_dyn_spoof(*target_p) && (source_p != NULL && !IsOper(source_p)))
|
else if(is_dyn_spoof(*target_p) && (source_p != NULL && !is(*source_p, umode::OPER)))
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1888,7 +1888,7 @@ client::show_ip_conf(struct ConfItem *aconf, client *source_p)
|
||||||
{
|
{
|
||||||
if(IsConfDoSpoofIp(aconf))
|
if(IsConfDoSpoofIp(aconf))
|
||||||
{
|
{
|
||||||
if(!ConfigFileEntry.hide_spoof_ips && MyOper(source_p))
|
if(!ConfigFileEntry.hide_spoof_ips && my_oper(*source_p))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1901,10 +1901,10 @@ int
|
||||||
client::show_ip_whowas(struct Whowas *whowas, client *source_p)
|
client::show_ip_whowas(struct Whowas *whowas, client *source_p)
|
||||||
{
|
{
|
||||||
if(whowas->flags & WHOWAS_IP_SPOOFING)
|
if(whowas->flags & WHOWAS_IP_SPOOFING)
|
||||||
if(ConfigFileEntry.hide_spoof_ips || !MyOper(source_p))
|
if(ConfigFileEntry.hide_spoof_ips || !my_oper(*source_p))
|
||||||
return 0;
|
return 0;
|
||||||
if(whowas->flags & WHOWAS_DYNSPOOF)
|
if(whowas->flags & WHOWAS_DYNSPOOF)
|
||||||
if(!IsOper(source_p))
|
if(!is(*source_p, umode::OPER))
|
||||||
return 0;
|
return 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -710,13 +710,13 @@ show_iline_prefix(client::client *sptr, struct ConfItem *aconf, char *name)
|
||||||
*prefix_ptr++ = '+';
|
*prefix_ptr++ = '+';
|
||||||
if(IsConfDoSpoofIp(aconf))
|
if(IsConfDoSpoofIp(aconf))
|
||||||
*prefix_ptr++ = '=';
|
*prefix_ptr++ = '=';
|
||||||
if(IsOper(sptr) && IsConfExemptFlood(aconf))
|
if(is(*sptr, umode::OPER) && IsConfExemptFlood(aconf))
|
||||||
*prefix_ptr++ = '|';
|
*prefix_ptr++ = '|';
|
||||||
if(IsOper(sptr) && IsConfExemptDNSBL(aconf) && !IsConfExemptKline(aconf))
|
if(is(*sptr, umode::OPER) && IsConfExemptDNSBL(aconf) && !IsConfExemptKline(aconf))
|
||||||
*prefix_ptr++ = '$';
|
*prefix_ptr++ = '$';
|
||||||
if(IsOper(sptr) && IsConfExemptKline(aconf))
|
if(is(*sptr, umode::OPER) && IsConfExemptKline(aconf))
|
||||||
*prefix_ptr++ = '^';
|
*prefix_ptr++ = '^';
|
||||||
if(IsOper(sptr) && IsConfExemptLimits(aconf))
|
if(is(*sptr, umode::OPER) && IsConfExemptLimits(aconf))
|
||||||
*prefix_ptr++ = '>';
|
*prefix_ptr++ = '>';
|
||||||
*prefix_ptr = '\0';
|
*prefix_ptr = '\0';
|
||||||
strncpy(prefix_ptr, name, USERLEN);
|
strncpy(prefix_ptr, name, USERLEN);
|
||||||
|
@ -744,7 +744,7 @@ report_auth(client::client *client_p)
|
||||||
{
|
{
|
||||||
aconf = arec->aconf;
|
aconf = arec->aconf;
|
||||||
|
|
||||||
if(!IsOper(client_p) && IsConfDoSpoofIp(aconf))
|
if(!is(*client_p, umode::OPER) && IsConfDoSpoofIp(aconf))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
get_printable_conf(aconf, &name, &host, &pass, &user, &port,
|
get_printable_conf(aconf, &name, &host, &pass, &user, &port,
|
||||||
|
|
|
@ -300,15 +300,15 @@ struct mode_table
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
static struct mode_table umode_table[] = {
|
static struct mode_table umode_table[] = {
|
||||||
{"callerid", UMODE_CALLERID },
|
{"callerid", umode::CALLERID },
|
||||||
{"deaf", UMODE_DEAF },
|
{"deaf", umode::DEAF },
|
||||||
{"invisible", UMODE_INVISIBLE },
|
{"invisible", umode::INVISIBLE },
|
||||||
{"locops", UMODE_LOCOPS },
|
{"locops", umode::LOCOPS },
|
||||||
{"noforward", UMODE_NOFORWARD },
|
{"noforward", umode::NOFORWARD },
|
||||||
{"regonlymsg", UMODE_REGONLYMSG},
|
{"regonlymsg", umode::REGONLYMSG},
|
||||||
{"servnotice", UMODE_SERVNOTICE},
|
{"servnotice", umode::SERVNOTICE},
|
||||||
{"wallop", UMODE_WALLOP },
|
{"wallop", umode::WALLOP },
|
||||||
{"operwall", UMODE_OPERWALL },
|
{"operwall", umode::OPERWALL },
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ parse_client_queued(client::client *client_p)
|
||||||
/* allow opers 4 times the amount of messages as users. why 4?
|
/* allow opers 4 times the amount of messages as users. why 4?
|
||||||
* why not. :) --fl_
|
* why not. :) --fl_
|
||||||
*/
|
*/
|
||||||
if(IsOper(client_p) && ConfigFileEntry.no_oper_flood)
|
if(is(*client_p, umode::OPER) && ConfigFileEntry.no_oper_flood)
|
||||||
allow_read *= 4;
|
allow_read *= 4;
|
||||||
/*
|
/*
|
||||||
* Handle flood protection here - if we exceed our flood limit on
|
* Handle flood protection here - if we exceed our flood limit on
|
||||||
|
@ -279,7 +279,7 @@ read_packet(rb_fde_t * F, void *data)
|
||||||
if(!is_any_server(*client_p) &&
|
if(!is_any_server(*client_p) &&
|
||||||
(rb_linebuf_alloclen(&client_p->localClient->buf_recvq) > ConfigFileEntry.client_flood_max_lines))
|
(rb_linebuf_alloclen(&client_p->localClient->buf_recvq) > ConfigFileEntry.client_flood_max_lines))
|
||||||
{
|
{
|
||||||
if(!(ConfigFileEntry.no_oper_flood && IsOper(client_p)))
|
if(!(ConfigFileEntry.no_oper_flood && is(*client_p, umode::OPER)))
|
||||||
{
|
{
|
||||||
exit_client(client_p, client_p, client_p, "Excess Flood");
|
exit_client(client_p, client_p, client_p, "Excess Flood");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -663,7 +663,7 @@ set_default_conf(void)
|
||||||
ConfigFileEntry.servicestring = NULL;
|
ConfigFileEntry.servicestring = NULL;
|
||||||
ConfigFileEntry.sasl_service = NULL;
|
ConfigFileEntry.sasl_service = NULL;
|
||||||
|
|
||||||
ConfigFileEntry.default_umodes = UMODE_INVISIBLE;
|
ConfigFileEntry.default_umodes = umode::INVISIBLE;
|
||||||
ConfigFileEntry.failed_oper_notice = true;
|
ConfigFileEntry.failed_oper_notice = true;
|
||||||
ConfigFileEntry.anti_nick_flood = false;
|
ConfigFileEntry.anti_nick_flood = false;
|
||||||
ConfigFileEntry.disable_fake_channels = false;
|
ConfigFileEntry.disable_fake_channels = false;
|
||||||
|
@ -724,9 +724,9 @@ set_default_conf(void)
|
||||||
ConfigFileEntry.compression_level = 4;
|
ConfigFileEntry.compression_level = 4;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ConfigFileEntry.oper_umodes = UMODE_LOCOPS | UMODE_SERVNOTICE |
|
ConfigFileEntry.oper_umodes = umode::LOCOPS | umode::SERVNOTICE |
|
||||||
UMODE_OPERWALL | UMODE_WALLOP;
|
umode::OPERWALL | umode::WALLOP;
|
||||||
ConfigFileEntry.oper_only_umodes = UMODE_SERVNOTICE;
|
ConfigFileEntry.oper_only_umodes = umode::SERVNOTICE;
|
||||||
ConfigFileEntry.oper_snomask = SNO_GENERAL;
|
ConfigFileEntry.oper_snomask = SNO_GENERAL;
|
||||||
|
|
||||||
ConfigChannel.use_except = true;
|
ConfigChannel.use_except = true;
|
||||||
|
@ -1221,7 +1221,7 @@ get_oper_name(client::client *client_p)
|
||||||
/* +5 for !,@,{,} and null */
|
/* +5 for !,@,{,} and null */
|
||||||
static char buffer[NICKLEN + USERLEN + HOSTLEN + HOSTLEN + 5];
|
static char buffer[NICKLEN + USERLEN + HOSTLEN + HOSTLEN + 5];
|
||||||
|
|
||||||
if(MyOper(client_p))
|
if(my_oper(*client_p))
|
||||||
{
|
{
|
||||||
snprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}",
|
snprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}",
|
||||||
client_p->name, client_p->username,
|
client_p->name, client_p->username,
|
||||||
|
@ -1305,7 +1305,7 @@ get_printable_kline(client::client *source_p, struct ConfItem *aconf,
|
||||||
*user = EmptyString(aconf->user) ? null : aconf->user;
|
*user = EmptyString(aconf->user) ? null : aconf->user;
|
||||||
*reason = get_user_ban_reason(aconf);
|
*reason = get_user_ban_reason(aconf);
|
||||||
|
|
||||||
if(!IsOper(source_p))
|
if(!is(*source_p, umode::OPER))
|
||||||
*oper_reason = NULL;
|
*oper_reason = NULL;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
111
ircd/s_user.cc
111
ircd/s_user.cc
|
@ -30,6 +30,7 @@ void user_welcome(client::client *source_p);
|
||||||
char umodebuf[128];
|
char umodebuf[128];
|
||||||
|
|
||||||
static int orphaned_umodes = 0;
|
static int orphaned_umodes = 0;
|
||||||
|
|
||||||
int user_modes[256] = {
|
int user_modes[256] = {
|
||||||
/* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x0F */
|
/* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x0F */
|
||||||
/* 0x10 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x1F */
|
/* 0x10 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x1F */
|
||||||
|
@ -39,7 +40,7 @@ int user_modes[256] = {
|
||||||
0, /* A */
|
0, /* A */
|
||||||
0, /* B */
|
0, /* B */
|
||||||
0, /* C */
|
0, /* C */
|
||||||
UMODE_DEAF, /* D */
|
umode::DEAF, /* D */
|
||||||
0, /* E */
|
0, /* E */
|
||||||
0, /* F */
|
0, /* F */
|
||||||
0, /* G */
|
0, /* G */
|
||||||
|
@ -52,43 +53,43 @@ int user_modes[256] = {
|
||||||
0, /* N */
|
0, /* N */
|
||||||
0, /* O */
|
0, /* O */
|
||||||
0, /* P */
|
0, /* P */
|
||||||
UMODE_NOFORWARD, /* Q */
|
umode::NOFORWARD, /* Q */
|
||||||
UMODE_REGONLYMSG, /* R */
|
umode::REGONLYMSG, /* R */
|
||||||
UMODE_SERVICE, /* S */
|
umode::SERVICE, /* S */
|
||||||
0, /* T */
|
0, /* T */
|
||||||
0, /* U */
|
0, /* U */
|
||||||
0, /* V */
|
0, /* V */
|
||||||
0, /* W */
|
0, /* W */
|
||||||
0, /* X */
|
0, /* X */
|
||||||
0, /* Y */
|
0, /* Y */
|
||||||
UMODE_SSLCLIENT, /* Z */
|
umode::SSLCLIENT, /* Z */
|
||||||
/* 0x5B */ 0, 0, 0, 0, 0, 0, /* 0x60 */
|
/* 0x5B */ 0, 0, 0, 0, 0, 0, /* 0x60 */
|
||||||
UMODE_ADMIN, /* a */
|
umode::ADMIN, /* a */
|
||||||
0, /* b */
|
0, /* b */
|
||||||
0, /* c */
|
0, /* c */
|
||||||
0, /* d */
|
0, /* d */
|
||||||
0, /* e */
|
0, /* e */
|
||||||
0, /* f */
|
0, /* f */
|
||||||
UMODE_CALLERID, /* g */
|
umode::CALLERID, /* g */
|
||||||
0, /* h */
|
0, /* h */
|
||||||
UMODE_INVISIBLE, /* i */
|
umode::INVISIBLE, /* i */
|
||||||
0, /* j */
|
0, /* j */
|
||||||
0, /* k */
|
0, /* k */
|
||||||
UMODE_LOCOPS, /* l */
|
umode::LOCOPS, /* l */
|
||||||
0, /* m */
|
0, /* m */
|
||||||
0, /* n */
|
0, /* n */
|
||||||
UMODE_OPER, /* o */
|
umode::OPER, /* o */
|
||||||
0, /* p */
|
0, /* p */
|
||||||
0, /* q */
|
0, /* q */
|
||||||
0, /* r */
|
0, /* r */
|
||||||
UMODE_SERVNOTICE, /* s */
|
umode::SERVNOTICE, /* s */
|
||||||
0, /* t */
|
0, /* t */
|
||||||
0, /* u */
|
0, /* u */
|
||||||
0, /* v */
|
0, /* v */
|
||||||
UMODE_WALLOP, /* w */
|
umode::WALLOP, /* w */
|
||||||
0, /* x */
|
0, /* x */
|
||||||
0, /* y */
|
0, /* y */
|
||||||
UMODE_OPERWALL, /* z */
|
umode::OPERWALL, /* z */
|
||||||
/* 0x7B */ 0, 0, 0, 0, 0, /* 0x7F */
|
/* 0x7B */ 0, 0, 0, 0, 0, /* 0x7F */
|
||||||
/* 0x80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x9F */
|
/* 0x80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x9F */
|
||||||
/* 0x90 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x9F */
|
/* 0x90 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x9F */
|
||||||
|
@ -556,7 +557,7 @@ register_local_user(client::client *client_p, client::client *source_p)
|
||||||
set_dyn_spoof(*source_p);
|
set_dyn_spoof(*source_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
source_p->umodes |= ConfigFileEntry.default_umodes & ~ConfigFileEntry.oper_only_umodes & ~orphaned_umodes;
|
source_p->mode |= umode(ConfigFileEntry.default_umodes & ~ConfigFileEntry.oper_only_umodes & ~orphaned_umodes);
|
||||||
|
|
||||||
call_hook(h_new_local_user, source_p);
|
call_hook(h_new_local_user, source_p);
|
||||||
|
|
||||||
|
@ -597,9 +598,9 @@ register_local_user(client::client *client_p, client::client *source_p)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsSSL(source_p))
|
if (IsSSL(source_p))
|
||||||
source_p->umodes |= UMODE_SSLCLIENT;
|
source_p->mode |= umode::SSLCLIENT;
|
||||||
|
|
||||||
if (source_p->umodes & UMODE_INVISIBLE)
|
if (source_p->mode & umode::INVISIBLE)
|
||||||
Count.invisi++;
|
Count.invisi++;
|
||||||
|
|
||||||
s_assert(!is_client(*source_p));
|
s_assert(!is_client(*source_p));
|
||||||
|
@ -945,7 +946,7 @@ show_other_user_mode(client::client *source_p, client::client *target_p)
|
||||||
*m++ = '+';
|
*m++ = '+';
|
||||||
|
|
||||||
for (i = 0; i < 128; i++) /* >= 127 is extended ascii */
|
for (i = 0; i < 128; i++) /* >= 127 is extended ascii */
|
||||||
if (target_p->umodes & user_modes[i])
|
if (target_p->mode & user_modes[i])
|
||||||
*m++ = (char) i;
|
*m++ = (char) i;
|
||||||
*m = '\0';
|
*m = '\0';
|
||||||
|
|
||||||
|
@ -1009,7 +1010,7 @@ user_mode(client::client *client_p, client::client *source_p, int parc, const ch
|
||||||
|
|
||||||
if(source_p != target_p)
|
if(source_p != target_p)
|
||||||
{
|
{
|
||||||
if (MyOper(source_p) && parc < 3)
|
if (my_oper(*source_p) && parc < 3)
|
||||||
show_other_user_mode(source_p, target_p);
|
show_other_user_mode(source_p, target_p);
|
||||||
else
|
else
|
||||||
sendto_one(source_p, form_str(ERR_USERSDONTMATCH), me.name, source_p->name);
|
sendto_one(source_p, form_str(ERR_USERSDONTMATCH), me.name, source_p->name);
|
||||||
|
@ -1022,7 +1023,7 @@ user_mode(client::client *client_p, client::client *source_p, int parc, const ch
|
||||||
*m++ = '+';
|
*m++ = '+';
|
||||||
|
|
||||||
for (i = 0; i < 128; i++) /* >= 127 is extended ascii */
|
for (i = 0; i < 128; i++) /* >= 127 is extended ascii */
|
||||||
if (source_p->umodes & user_modes[i])
|
if (source_p->mode & user_modes[i])
|
||||||
*m++ = (char) i;
|
*m++ = (char) i;
|
||||||
|
|
||||||
*m = '\0';
|
*m = '\0';
|
||||||
|
@ -1036,7 +1037,7 @@ user_mode(client::client *client_p, client::client *source_p, int parc, const ch
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find flags already set for user */
|
/* find flags already set for user */
|
||||||
setflags = source_p->umodes;
|
setflags = source_p->mode;
|
||||||
setsnomask = source_p->snomask;
|
setsnomask = source_p->snomask;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1055,10 +1056,10 @@ user_mode(client::client *client_p, client::client *source_p, int parc, const ch
|
||||||
case 'o':
|
case 'o':
|
||||||
if(what == MODE_ADD)
|
if(what == MODE_ADD)
|
||||||
{
|
{
|
||||||
if(is_server(*client_p) && !IsOper(source_p))
|
if(is_server(*client_p) && !is_oper(*source_p))
|
||||||
{
|
{
|
||||||
++Count.oper;
|
++Count.oper;
|
||||||
SetOper(source_p);
|
set_oper(*source_p);
|
||||||
rb_dlinkAddAlloc(source_p, &oper_list);
|
rb_dlinkAddAlloc(source_p, &oper_list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1068,17 +1069,17 @@ user_mode(client::client *client_p, client::client *source_p, int parc, const ch
|
||||||
* found by Pat Szuta, Perly , perly@xnet.com
|
* found by Pat Szuta, Perly , perly@xnet.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!IsOper(source_p))
|
if(!is_oper(*source_p))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ClearOper(source_p);
|
clear_oper(*source_p);
|
||||||
|
|
||||||
Count.oper--;
|
Count.oper--;
|
||||||
|
|
||||||
if(my_connect(*source_p))
|
if(my_connect(*source_p))
|
||||||
{
|
{
|
||||||
source_p->umodes &= ~ConfigFileEntry.oper_only_umodes;
|
clear(*source_p, umode(ConfigFileEntry.oper_only_umodes));
|
||||||
if (!(source_p->umodes & UMODE_SERVNOTICE) && source_p->snomask != 0)
|
if (!is(*source_p, umode::SERVNOTICE) && source_p->snomask != 0)
|
||||||
{
|
{
|
||||||
source_p->snomask = 0;
|
source_p->snomask = 0;
|
||||||
showsnomask = true;
|
showsnomask = true;
|
||||||
|
@ -1113,10 +1114,10 @@ user_mode(client::client *client_p, client::client *source_p, int parc, const ch
|
||||||
case 's':
|
case 's':
|
||||||
if (my_connect(*source_p))
|
if (my_connect(*source_p))
|
||||||
{
|
{
|
||||||
if(!IsOper(source_p)
|
if(!is_oper(*source_p)
|
||||||
&& (ConfigFileEntry.oper_only_umodes & UMODE_SERVNOTICE))
|
&& (ConfigFileEntry.oper_only_umodes & umode::SERVNOTICE))
|
||||||
{
|
{
|
||||||
if (what == MODE_ADD || source_p->umodes & UMODE_SERVNOTICE)
|
if (what == MODE_ADD || is(*source_p, umode::SERVNOTICE))
|
||||||
badflag = true;
|
badflag = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1131,9 +1132,9 @@ user_mode(client::client *client_p, client::client *source_p, int parc, const ch
|
||||||
else
|
else
|
||||||
source_p->snomask = 0;
|
source_p->snomask = 0;
|
||||||
if (source_p->snomask != 0)
|
if (source_p->snomask != 0)
|
||||||
source_p->umodes |= UMODE_SERVNOTICE;
|
set(*source_p, umode::SERVNOTICE);
|
||||||
else
|
else
|
||||||
source_p->umodes &= ~UMODE_SERVNOTICE;
|
clear(*source_p, umode::SERVNOTICE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
|
@ -1147,19 +1148,19 @@ user_mode(client::client *client_p, client::client *source_p, int parc, const ch
|
||||||
if((flag = user_modes[(unsigned char) *pm]))
|
if((flag = user_modes[(unsigned char) *pm]))
|
||||||
{
|
{
|
||||||
if(my_connect(*source_p)
|
if(my_connect(*source_p)
|
||||||
&& ((!IsOper(source_p)
|
&& ((!is_oper(*source_p)
|
||||||
&& (ConfigFileEntry.oper_only_umodes & flag))
|
&& (ConfigFileEntry.oper_only_umodes & flag))
|
||||||
|| (orphaned_umodes & flag)))
|
|| (orphaned_umodes & flag)))
|
||||||
{
|
{
|
||||||
if (what == MODE_ADD || source_p->umodes & flag)
|
if (what == MODE_ADD || source_p->mode & flag)
|
||||||
badflag = true;
|
badflag = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(what == MODE_ADD)
|
if(what == MODE_ADD)
|
||||||
source_p->umodes |= flag;
|
set(*source_p, umode(flag));
|
||||||
else
|
else
|
||||||
source_p->umodes &= ~flag;
|
clear(*source_p, umode(flag));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1179,17 +1180,17 @@ user_mode(client::client *client_p, client::client *source_p, int parc, const ch
|
||||||
source_p->snomask &= ~SNO_NCHANGE; /* only tcm's really need this */
|
source_p->snomask &= ~SNO_NCHANGE; /* only tcm's really need this */
|
||||||
}
|
}
|
||||||
|
|
||||||
if(my(*source_p) && (source_p->umodes & UMODE_OPERWALL) && !IsOperOperwall(source_p))
|
if(my(*source_p) && is(*source_p, umode::OPERWALL) && !IsOperOperwall(source_p))
|
||||||
{
|
{
|
||||||
sendto_one_notice(source_p, ":*** You need oper and operwall flag for +z");
|
sendto_one_notice(source_p, ":*** You need oper and operwall flag for +z");
|
||||||
source_p->umodes &= ~UMODE_OPERWALL;
|
source_p->mode &= ~umode::OPERWALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(my_connect(*source_p) && (source_p->umodes & UMODE_ADMIN) &&
|
if(my_connect(*source_p) && (source_p->mode & umode::ADMIN) &&
|
||||||
(!IsOperAdmin(source_p) || IsOperHiddenAdmin(source_p)))
|
(!IsOperAdmin(source_p) || IsOperHiddenAdmin(source_p)))
|
||||||
{
|
{
|
||||||
sendto_one_notice(source_p, ":*** You need oper and admin flag for +a");
|
sendto_one_notice(source_p, ":*** You need oper and admin flag for +a");
|
||||||
source_p->umodes &= ~UMODE_ADMIN;
|
clear(*source_p, umode::ADMIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* let modules providing usermodes know that we've changed our usermode --nenolod */
|
/* let modules providing usermodes know that we've changed our usermode --nenolod */
|
||||||
|
@ -1198,9 +1199,9 @@ user_mode(client::client *client_p, client::client *source_p, int parc, const ch
|
||||||
hdata.oldsnomask = setsnomask;
|
hdata.oldsnomask = setsnomask;
|
||||||
call_hook(h_umode_changed, &hdata);
|
call_hook(h_umode_changed, &hdata);
|
||||||
|
|
||||||
if(!(setflags & UMODE_INVISIBLE) && is_invisible(*source_p))
|
if(!(setflags & umode::INVISIBLE) && is(*source_p, umode::INVISIBLE))
|
||||||
++Count.invisi;
|
++Count.invisi;
|
||||||
if((setflags & UMODE_INVISIBLE) && !is_invisible(*source_p))
|
if((setflags & umode::INVISIBLE) && !is(*source_p, umode::INVISIBLE))
|
||||||
--Count.invisi;
|
--Count.invisi;
|
||||||
/*
|
/*
|
||||||
* compare new flags with old flags and send string which
|
* compare new flags with old flags and send string which
|
||||||
|
@ -1237,7 +1238,7 @@ send_umode(client::client *client_p, client::client *source_p, int old, char *um
|
||||||
{
|
{
|
||||||
flag = user_modes[i];
|
flag = user_modes[i];
|
||||||
|
|
||||||
if((flag & old) && !(source_p->umodes & flag))
|
if((flag & old) && !(source_p->mode & flag))
|
||||||
{
|
{
|
||||||
if(what == MODE_DEL)
|
if(what == MODE_DEL)
|
||||||
*m++ = (char) i;
|
*m++ = (char) i;
|
||||||
|
@ -1248,7 +1249,7 @@ send_umode(client::client *client_p, client::client *source_p, int old, char *um
|
||||||
*m++ = (char) i;
|
*m++ = (char) i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(!(flag & old) && (source_p->umodes & flag))
|
else if(!(flag & old) && (source_p->mode & flag))
|
||||||
{
|
{
|
||||||
if(what == MODE_ADD)
|
if(what == MODE_ADD)
|
||||||
*m++ = (char) i;
|
*m++ = (char) i;
|
||||||
|
@ -1345,24 +1346,26 @@ user_welcome(client::client *source_p)
|
||||||
void
|
void
|
||||||
oper_up(client::client *source_p, struct oper_conf *oper_p)
|
oper_up(client::client *source_p, struct oper_conf *oper_p)
|
||||||
{
|
{
|
||||||
unsigned int old = source_p->umodes, oldsnomask = source_p->snomask;
|
using umode = client::mode::mode;
|
||||||
|
|
||||||
|
unsigned int old = source_p->mode, oldsnomask = source_p->snomask;
|
||||||
hook_data_umode_changed hdata;
|
hook_data_umode_changed hdata;
|
||||||
|
|
||||||
SetOper(source_p);
|
set_oper(*source_p);
|
||||||
|
|
||||||
if(oper_p->umodes)
|
if(oper_p->umodes)
|
||||||
source_p->umodes |= oper_p->umodes;
|
source_p->mode |= umode(oper_p->umodes);
|
||||||
else if(ConfigFileEntry.oper_umodes)
|
else if(ConfigFileEntry.oper_umodes)
|
||||||
source_p->umodes |= ConfigFileEntry.oper_umodes;
|
source_p->mode |= umode(ConfigFileEntry.oper_umodes);
|
||||||
else
|
else
|
||||||
source_p->umodes |= DEFAULT_OPER_UMODES;
|
source_p->mode |= client::mode::DEFAULT_OPER_UMODES;
|
||||||
|
|
||||||
if (oper_p->snomask)
|
if (oper_p->snomask)
|
||||||
{
|
{
|
||||||
source_p->snomask |= oper_p->snomask;
|
source_p->snomask |= oper_p->snomask;
|
||||||
source_p->umodes |= UMODE_SERVNOTICE;
|
source_p->mode |= umode::SERVNOTICE;
|
||||||
}
|
}
|
||||||
else if (source_p->umodes & UMODE_SERVNOTICE)
|
else if (source_p->mode & umode::SERVNOTICE)
|
||||||
{
|
{
|
||||||
/* Only apply these if +s is already set -- jilles */
|
/* Only apply these if +s is already set -- jilles */
|
||||||
if (ConfigFileEntry.oper_snomask)
|
if (ConfigFileEntry.oper_snomask)
|
||||||
|
@ -1384,11 +1387,11 @@ oper_up(client::client *source_p, struct oper_conf *oper_p)
|
||||||
rb_dlinkAddAlloc(source_p, &oper_list);
|
rb_dlinkAddAlloc(source_p, &oper_list);
|
||||||
|
|
||||||
if(IsOperAdmin(source_p) && !IsOperHiddenAdmin(source_p))
|
if(IsOperAdmin(source_p) && !IsOperHiddenAdmin(source_p))
|
||||||
source_p->umodes |= UMODE_ADMIN;
|
source_p->mode |= umode::ADMIN;
|
||||||
if(!IsOperN(source_p))
|
if(!IsOperN(source_p))
|
||||||
source_p->snomask &= ~SNO_NCHANGE;
|
source_p->snomask &= ~SNO_NCHANGE;
|
||||||
if(!IsOperOperwall(source_p))
|
if(!IsOperOperwall(source_p))
|
||||||
source_p->umodes &= ~UMODE_OPERWALL;
|
source_p->mode &= ~umode::OPERWALL;
|
||||||
hdata.client = source_p;
|
hdata.client = source_p;
|
||||||
hdata.oldumodes = old;
|
hdata.oldumodes = old;
|
||||||
hdata.oldsnomask = oldsnomask;
|
hdata.oldsnomask = oldsnomask;
|
||||||
|
@ -1397,9 +1400,9 @@ oper_up(client::client *source_p, struct oper_conf *oper_p)
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"%s (%s!%s@%s) is now an operator", oper_p->name, source_p->name,
|
"%s (%s!%s@%s) is now an operator", oper_p->name, source_p->name,
|
||||||
source_p->username, source_p->host);
|
source_p->username, source_p->host);
|
||||||
if(!(old & UMODE_INVISIBLE) && is_invisible(*source_p))
|
if(!(old & umode::INVISIBLE) && is(*source_p, umode::INVISIBLE))
|
||||||
++Count.invisi;
|
++Count.invisi;
|
||||||
if((old & UMODE_INVISIBLE) && !is_invisible(*source_p))
|
if((old & umode::INVISIBLE) && !is(*source_p, umode::INVISIBLE))
|
||||||
--Count.invisi;
|
--Count.invisi;
|
||||||
send_umode_out(source_p, source_p, old);
|
send_umode_out(source_p, source_p, old);
|
||||||
sendto_one_numeric(source_p, RPL_SNOMASK, form_str(RPL_SNOMASK),
|
sendto_one_numeric(source_p, RPL_SNOMASK, form_str(RPL_SNOMASK),
|
||||||
|
|
10
ircd/send.cc
10
ircd/send.cc
|
@ -518,7 +518,7 @@ sendto_channel_flags(client::client *one, int type, client::client *source_p,
|
||||||
if(type && ((member.flags & type) == 0))
|
if(type && ((member.flags & type) == 0))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(IsDeaf(target_p))
|
if(is(*target_p, umode::DEAF))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(!my(*target_p))
|
if(!my(*target_p))
|
||||||
|
@ -616,7 +616,7 @@ sendto_channel_opmod(client::client *one, client::client *source_p,
|
||||||
if((member.flags & chan::CHANOP) == 0)
|
if((member.flags & chan::CHANOP) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(IsDeaf(target_p))
|
if(is(*target_p, umode::DEAF))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(!my(*target_p))
|
if(!my(*target_p))
|
||||||
|
@ -673,7 +673,7 @@ sendto_channel_local(int type, chan::chan *chptr, const char *pattern, ...)
|
||||||
|
|
||||||
if(type == chan::ONLY_OPERS)
|
if(type == chan::ONLY_OPERS)
|
||||||
{
|
{
|
||||||
if (!IsOper(target_p))
|
if (!is(*target_p, umode::OPER))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if(type && ((member.flags & type) == 0))
|
else if(type && ((member.flags & type) == 0))
|
||||||
|
@ -1309,11 +1309,11 @@ sendto_wallops_flags(int flags, client::client *source_p, const char *pattern, .
|
||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
RB_DLINK_FOREACH_SAFE(ptr, next_ptr, is_person(*source_p) && flags == UMODE_WALLOP ? lclient_list.head : local_oper_list.head)
|
RB_DLINK_FOREACH_SAFE(ptr, next_ptr, is_person(*source_p) && flags == umode::WALLOP ? lclient_list.head : local_oper_list.head)
|
||||||
{
|
{
|
||||||
client_p = (client::client *)ptr->data;
|
client_p = (client::client *)ptr->data;
|
||||||
|
|
||||||
if(client_p->umodes & flags)
|
if (is(*client_p, umode(flags)))
|
||||||
_send_linebuf(client_p, &linebuf);
|
_send_linebuf(client_p, &linebuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ add_target(client::client *source_p, client::client *target_p)
|
||||||
uint32_t hashv;
|
uint32_t hashv;
|
||||||
|
|
||||||
/* can msg themselves or services without using any target slots */
|
/* can msg themselves or services without using any target slots */
|
||||||
if(source_p == target_p || IsService(target_p))
|
if(source_p == target_p || is(*target_p, umode::SERVICE))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* special condition for those who have had PRIVMSG crippled to allow them
|
/* special condition for those who have had PRIVMSG crippled to allow them
|
||||||
|
@ -55,7 +55,7 @@ add_target(client::client *source_p, client::client *target_p)
|
||||||
*
|
*
|
||||||
* XXX: is this controversial?
|
* XXX: is this controversial?
|
||||||
*/
|
*/
|
||||||
if(source_p->localClient->target_last > rb_current_time() && IsOper(target_p))
|
if(source_p->localClient->target_last > rb_current_time() && is(*target_p, umode::OPER))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
hashv = fnv_hash_upper((const unsigned char *)use_id(target_p), 32);
|
hashv = fnv_hash_upper((const unsigned char *)use_id(target_p), 32);
|
||||||
|
@ -162,7 +162,7 @@ add_reply_target(client::client *source_p, client::client *target_p)
|
||||||
uint32_t *targets;
|
uint32_t *targets;
|
||||||
|
|
||||||
/* can msg themselves or services without using any target slots */
|
/* can msg themselves or services without using any target slots */
|
||||||
if(source_p == target_p || IsService(target_p))
|
if(source_p == target_p || is(*target_p, umode::SERVICE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
hashv = fnv_hash_upper((const unsigned char *)use_id(target_p), 32);
|
hashv = fnv_hash_upper((const unsigned char *)use_id(target_p), 32);
|
||||||
|
|
|
@ -48,7 +48,7 @@ m_ban(struct MsgBuf *msgbuf_p, client::client &client, client::client &source, i
|
||||||
{
|
{
|
||||||
sendto_one_notice(&source, ":The BAN command is not user-accessible.");
|
sendto_one_notice(&source, ":The BAN command is not user-accessible.");
|
||||||
sendto_one_notice(&source, ":To ban a user from a channel, see /QUOTE HELP CMODE");
|
sendto_one_notice(&source, ":To ban a user from a channel, see /QUOTE HELP CMODE");
|
||||||
if (IsOper(&source))
|
if (is(source, umode::OPER))
|
||||||
sendto_one_notice(&source, ":To ban a user from a server or from the network, see /QUOTE HELP KLINE");
|
sendto_one_notice(&source, ":To ban a user from a server or from the network, see /QUOTE HELP KLINE");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ check_forward(client::client &source, chan::chan *chptr,
|
||||||
return chptr;
|
return chptr;
|
||||||
|
|
||||||
/* User is +Q, or forwarding disabled */
|
/* User is +Q, or forwarding disabled */
|
||||||
if (IsNoForward(&source) || !ConfigChannel.use_forward)
|
if (is(source, umode::NOFORWARD) || !ConfigChannel.use_forward)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
while (depth < 16)
|
while (depth < 16)
|
||||||
|
@ -180,7 +180,7 @@ m_join(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
form_str(ERR_BADCHANNAME), name);
|
form_str(ERR_BADCHANNAME), name);
|
||||||
|
|
||||||
/* dont warn for opers */
|
/* dont warn for opers */
|
||||||
if(!is_exempt_jupe(source) && !IsOper(&source))
|
if(!is_exempt_jupe(source) && !is(source, umode::OPER))
|
||||||
sendto_realops_snomask(SNO_SPY, L_NETWIDE,
|
sendto_realops_snomask(SNO_SPY, L_NETWIDE,
|
||||||
"User %s (%s@%s) is attempting to join locally juped channel %s (%s)",
|
"User %s (%s@%s) is attempting to join locally juped channel %s (%s)",
|
||||||
source.name, source.username,
|
source.name, source.username,
|
||||||
|
@ -194,7 +194,7 @@ m_join(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(splitmode && !IsOper(&source) && (*name != '&') &&
|
if(splitmode && !is(source, umode::OPER) && (*name != '&') &&
|
||||||
ConfigChannel.no_join_on_split)
|
ConfigChannel.no_join_on_split)
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_UNAVAILRESOURCE),
|
sendto_one(&source, form_str(ERR_UNAVAILRESOURCE),
|
||||||
|
@ -254,7 +254,7 @@ m_join(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(splitmode && !IsOper(&source) && (*name != '&') &&
|
if(splitmode && !is(source, umode::OPER) && (*name != '&') &&
|
||||||
ConfigChannel.no_create_on_split)
|
ConfigChannel.no_create_on_split)
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_UNAVAILRESOURCE),
|
sendto_one(&source, form_str(ERR_UNAVAILRESOURCE),
|
||||||
|
@ -306,7 +306,7 @@ m_join(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
chptr = chptr2;
|
chptr = chptr2;
|
||||||
|
|
||||||
if(flags == 0 &&
|
if(flags == 0 &&
|
||||||
!IsOper(&source) && !is_exempt_spambot(source))
|
!is(source, umode::OPER) && !is_exempt_spambot(source))
|
||||||
chan::check_spambot_warning(&source, name);
|
chan::check_spambot_warning(&source, name);
|
||||||
|
|
||||||
/* add the user to the channel */
|
/* add the user to the channel */
|
||||||
|
@ -976,7 +976,7 @@ do_join_0(client::client &client, client::client &source)
|
||||||
for(const auto &pit : chans(user(source)))
|
for(const auto &pit : chans(user(source)))
|
||||||
{
|
{
|
||||||
if(my_connect(source) &&
|
if(my_connect(source) &&
|
||||||
!IsOper(&source) && !is_exempt_spambot(source))
|
!is(source, umode::OPER) && !is_exempt_spambot(source))
|
||||||
chan::check_spambot_warning(&source, NULL);
|
chan::check_spambot_warning(&source, NULL);
|
||||||
|
|
||||||
auto &msptr(pit.second);
|
auto &msptr(pit.second);
|
||||||
|
@ -998,7 +998,7 @@ check_channel_name_loc(client::client &source, const char *name)
|
||||||
if(EmptyString(name))
|
if(EmptyString(name))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(ConfigFileEntry.disable_fake_channels && !IsOper(&source))
|
if(ConfigFileEntry.disable_fake_channels && !is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
for(p = name; *p; ++p)
|
for(p = name; *p; ++p)
|
||||||
if(!rfc1459::is_chan(*p) || rfc1459::is_fake_chan(*p))
|
if(!rfc1459::is_chan(*p) || rfc1459::is_fake_chan(*p))
|
||||||
|
|
|
@ -118,7 +118,7 @@ m_kick(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
|
|
||||||
if(msptr != NULL)
|
if(msptr != NULL)
|
||||||
{
|
{
|
||||||
if(my(source) && IsService(who))
|
if(my(source) && is(*who, umode::SERVICE))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_ISCHANSERVICE),
|
sendto_one(&source, form_str(ERR_ISCHANSERVICE),
|
||||||
me.name,
|
me.name,
|
||||||
|
|
|
@ -238,9 +238,9 @@ ms_kill(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
/* path must contain at least 2 !'s, or bitchx falsely declares it
|
/* path must contain at least 2 !'s, or bitchx falsely declares it
|
||||||
* local --fl
|
* local --fl
|
||||||
*/
|
*/
|
||||||
if(IsOper(&source)) /* send it normally */
|
if(is(source, umode::OPER)) /* send it normally */
|
||||||
{
|
{
|
||||||
sendto_realops_snomask(IsService(&source) ? SNO_SKILL : SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(is(source, umode::SERVICE) ? SNO_SKILL : SNO_GENERAL, L_ALL,
|
||||||
"Received KILL message for %s!%s@%s. From %s Path: %s!%s!%s!%s %s",
|
"Received KILL message for %s!%s@%s. From %s Path: %s!%s!%s!%s %s",
|
||||||
target_p->name, target_p->username, target_p->orighost, source.name,
|
target_p->name, target_p->username, target_p->orighost, source.name,
|
||||||
source.servptr->name, source.host, source.username,
|
source.servptr->name, source.host, source.username,
|
||||||
|
|
|
@ -338,7 +338,7 @@ build_target_list(enum message_type msgtype, client::client &client,
|
||||||
|
|
||||||
msptr = get(chptr->members, source, std::nothrow);
|
msptr = get(chptr->members, source, std::nothrow);
|
||||||
|
|
||||||
if(!is_server(source) && !IsService(&source) && !is_chanop(msptr) && !is_voiced(msptr))
|
if(!is_server(source) && !is(source, umode::SERVICE) && !is_chanop(msptr) && !is_voiced(msptr))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_CHANOPRIVSNEEDED),
|
sendto_one(&source, form_str(ERR_CHANOPRIVSNEEDED),
|
||||||
get_id(&me, &source),
|
get_id(&me, &source),
|
||||||
|
@ -395,7 +395,7 @@ build_target_list(enum message_type msgtype, client::client &client,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strchr(nick, '@') || (IsOper(&source) && (*nick == '$')))
|
if(strchr(nick, '@') || (is(source, umode::OPER) && (*nick == '$')))
|
||||||
{
|
{
|
||||||
handle_special(msgtype, client, source, nick, text);
|
handle_special(msgtype, client, source, nick, text);
|
||||||
continue;
|
continue;
|
||||||
|
@ -512,7 +512,7 @@ msg_channel(enum message_type msgtype,
|
||||||
if((result = can_send(chptr, &source, NULL)))
|
if((result = can_send(chptr, &source, NULL)))
|
||||||
{
|
{
|
||||||
if(result != chan::CAN_SEND_OPV && my(source) &&
|
if(result != chan::CAN_SEND_OPV && my(source) &&
|
||||||
!IsOper(&source) &&
|
!is(source, umode::OPER) &&
|
||||||
!add_channel_target(&source, chptr))
|
!add_channel_target(&source, chptr))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_TARGCHANGE),
|
sendto_one(&source, form_str(ERR_TARGCHANGE),
|
||||||
|
@ -534,7 +534,7 @@ msg_channel(enum message_type msgtype,
|
||||||
else if(chptr->mode.mode & chan::mode::OPMODERATE &&
|
else if(chptr->mode.mode & chan::mode::OPMODERATE &&
|
||||||
(!(chptr->mode.mode & chan::mode::NOPRIVMSGS) || is_member(chptr, &source)))
|
(!(chptr->mode.mode & chan::mode::NOPRIVMSGS) || is_member(chptr, &source)))
|
||||||
{
|
{
|
||||||
if(my(source) && !IsOper(&source) && !add_channel_target(&source, chptr))
|
if(my(source) && !is(source, umode::OPER) && !add_channel_target(&source, chptr))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_TARGCHANGE),
|
sendto_one(&source, form_str(ERR_TARGCHANGE),
|
||||||
me.name,
|
me.name,
|
||||||
|
@ -727,10 +727,10 @@ msg_client(enum message_type msgtype,
|
||||||
* as a way of griefing. --nenolod
|
* as a way of griefing. --nenolod
|
||||||
*/
|
*/
|
||||||
if(msgtype != MESSAGE_TYPE_NOTICE &&
|
if(msgtype != MESSAGE_TYPE_NOTICE &&
|
||||||
(IsSetCallerId(&source) ||
|
(is(source, umode::CALLERID) ||
|
||||||
(IsSetRegOnlyMsg(&source) && suser(user(*target_p)).empty())) &&
|
(is(source, umode::REGONLYMSG) && suser(user(*target_p)).empty())) &&
|
||||||
!accept_message(target_p, &source) &&
|
!accept_message(target_p, &source) &&
|
||||||
!IsOper(target_p))
|
!is(*target_p, umode::OPER))
|
||||||
{
|
{
|
||||||
if(rb_dlink_list_length(&source.localClient->allow_list) <
|
if(rb_dlink_list_length(&source.localClient->allow_list) <
|
||||||
(unsigned long)ConfigFileEntry.max_accept)
|
(unsigned long)ConfigFileEntry.max_accept)
|
||||||
|
@ -753,7 +753,7 @@ msg_client(enum message_type msgtype,
|
||||||
source.localClient->last = rb_current_time();
|
source.localClient->last = rb_current_time();
|
||||||
|
|
||||||
/* auto cprivmsg/cnotice */
|
/* auto cprivmsg/cnotice */
|
||||||
do_floodcount = !IsOper(&source) &&
|
do_floodcount = !is(source, umode::OPER) &&
|
||||||
!find_allowing_channel(&source, target_p);
|
!find_allowing_channel(&source, target_p);
|
||||||
|
|
||||||
/* target change stuff, dont limit ctcp replies as that
|
/* target change stuff, dont limit ctcp replies as that
|
||||||
|
@ -817,11 +817,11 @@ msg_client(enum message_type msgtype,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX Controversial? allow opers always to send through a +g */
|
/* XXX Controversial? allow opers always to send through a +g */
|
||||||
if(!is_server(source) && (IsSetCallerId(target_p) ||
|
if(!is_server(source) && (is(*target_p, umode::CALLERID) ||
|
||||||
(IsSetRegOnlyMsg(target_p) && suser(user(source)).empty())))
|
(is(*target_p, umode::REGONLYMSG) && suser(user(source)).empty())))
|
||||||
{
|
{
|
||||||
/* Here is the anti-flood bot/spambot code -db */
|
/* Here is the anti-flood bot/spambot code -db */
|
||||||
if(accept_message(&source, target_p) || IsOper(&source))
|
if(accept_message(&source, target_p) || is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
add_reply_target(target_p, &source);
|
add_reply_target(target_p, &source);
|
||||||
sendto_one(target_p, ":%s!%s@%s %s %s :%s",
|
sendto_one(target_p, ":%s!%s@%s %s %s :%s",
|
||||||
|
@ -829,7 +829,7 @@ msg_client(enum message_type msgtype,
|
||||||
source.username,
|
source.username,
|
||||||
source.host, cmdname[msgtype], target_p->name, text);
|
source.host, cmdname[msgtype], target_p->name, text);
|
||||||
}
|
}
|
||||||
else if (IsSetRegOnlyMsg(target_p) && suser(user(source)).empty())
|
else if (is(*target_p, umode::REGONLYMSG) && suser(user(source)).empty())
|
||||||
{
|
{
|
||||||
if (msgtype != MESSAGE_TYPE_NOTICE)
|
if (msgtype != MESSAGE_TYPE_NOTICE)
|
||||||
sendto_one_numeric(&source, ERR_NONONREG,
|
sendto_one_numeric(&source, ERR_NONONREG,
|
||||||
|
@ -894,7 +894,7 @@ flood_attack_client(enum message_type msgtype, client::client &source, client::c
|
||||||
* and msg user@server.
|
* and msg user@server.
|
||||||
* -- jilles
|
* -- jilles
|
||||||
*/
|
*/
|
||||||
if(GlobalSetOptions.floodcount && is_client(source) && &source != target_p && !IsService(target_p))
|
if(GlobalSetOptions.floodcount && is_client(source) && &source != target_p && !is(*target_p, umode::SERVICE))
|
||||||
{
|
{
|
||||||
if((target_p->first_received_message_time + 1) < rb_current_time())
|
if((target_p->first_received_message_time + 1) < rb_current_time())
|
||||||
{
|
{
|
||||||
|
@ -972,7 +972,7 @@ handle_special(enum message_type msgtype, client::client &client,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!IsOper(&source))
|
if(!is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
if(strchr(nick, '%') || (strncmp(nick, "opers", 5) == 0))
|
if(strchr(nick, '%') || (strncmp(nick, "opers", 5) == 0))
|
||||||
{
|
{
|
||||||
|
@ -1015,11 +1015,11 @@ handle_special(enum message_type msgtype, client::client &client,
|
||||||
*
|
*
|
||||||
* Armin, 8Jun90 (gruner@informatik.tu-muenchen.de)
|
* Armin, 8Jun90 (gruner@informatik.tu-muenchen.de)
|
||||||
*/
|
*/
|
||||||
if(IsOper(&source) && *nick == '$')
|
if(is(source, umode::OPER) && *nick == '$')
|
||||||
{
|
{
|
||||||
if((*(nick + 1) == '$' || *(nick + 1) == '#'))
|
if((*(nick + 1) == '$' || *(nick + 1) == '#'))
|
||||||
nick++;
|
nick++;
|
||||||
else if(MyOper(&source))
|
else if(my_oper(source))
|
||||||
{
|
{
|
||||||
sendto_one(&source,
|
sendto_one(&source,
|
||||||
":%s NOTICE %s :The command %s %s is no longer supported, please use $%s",
|
":%s NOTICE %s :The command %s %s is no longer supported, please use $%s",
|
||||||
|
|
|
@ -368,11 +368,11 @@ do_modlist(client::client &source, const char *pattern)
|
||||||
break;
|
break;
|
||||||
case MAPI_ORIGIN_CORE:
|
case MAPI_ORIGIN_CORE:
|
||||||
origin = "builtin";
|
origin = "builtin";
|
||||||
display = IsOper(&source);
|
display = is(source, umode::OPER);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
origin = "unknown";
|
origin = "unknown";
|
||||||
display = IsOper(&source);
|
display = is(source, umode::OPER);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -260,7 +260,7 @@ ms_nick(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
nick = parc > 1 ? parv[1] : "?";
|
nick = parc > 1 ? parv[1] : "?";
|
||||||
server = parc > 7 ? parv[7] : "?";
|
server = parc > 7 ? parv[7] : "?";
|
||||||
|
|
||||||
sendto_wallops_flags(UMODE_WALLOP, &me,
|
sendto_wallops_flags(umode::WALLOP, &me,
|
||||||
"Link %s cancelled, TS5 nickname %s on %s introduced (old server?)",
|
"Link %s cancelled, TS5 nickname %s on %s introduced (old server?)",
|
||||||
client.name, nick, server);
|
client.name, nick, server);
|
||||||
sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
|
sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
|
||||||
|
@ -611,7 +611,7 @@ change_local_nick(client::client &client, client::client &source,
|
||||||
source.localClient->last_nick_change = rb_current_time();
|
source.localClient->last_nick_change = rb_current_time();
|
||||||
source.localClient->number_of_nick_changes++;
|
source.localClient->number_of_nick_changes++;
|
||||||
|
|
||||||
if(ConfigFileEntry.anti_nick_flood && !IsOper(&source) &&
|
if(ConfigFileEntry.anti_nick_flood && !is(source, umode::OPER) &&
|
||||||
source.localClient->number_of_nick_changes > ConfigFileEntry.max_nick_changes)
|
source.localClient->number_of_nick_changes > ConfigFileEntry.max_nick_changes)
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_NICKTOOFAST),
|
sendto_one(&source, form_str(ERR_NICKTOOFAST),
|
||||||
|
@ -1046,7 +1046,7 @@ register_client(client::client &client, client::client *server,
|
||||||
{
|
{
|
||||||
flag = user_modes[(unsigned char) *m];
|
flag = user_modes[(unsigned char) *m];
|
||||||
|
|
||||||
if(flag & UMODE_SERVICE)
|
if(flag & umode::SERVICE)
|
||||||
{
|
{
|
||||||
int hit = 0;
|
int hit = 0;
|
||||||
rb_dlink_node *ptr;
|
rb_dlink_node *ptr;
|
||||||
|
@ -1068,18 +1068,18 @@ register_client(client::client &client, client::client *server,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* increment +i count if theyre invis */
|
/* increment +i count if theyre invis */
|
||||||
if(!(source->umodes & UMODE_INVISIBLE) && (flag & UMODE_INVISIBLE))
|
if(!(source->mode & umode::INVISIBLE) && (flag & umode::INVISIBLE))
|
||||||
Count.invisi++;
|
Count.invisi++;
|
||||||
|
|
||||||
/* increment opered count if theyre opered */
|
/* increment opered count if theyre opered */
|
||||||
if(!(source->umodes & UMODE_OPER) && (flag & UMODE_OPER))
|
if(!(source->mode & umode::OPER) && (flag & umode::OPER))
|
||||||
Count.oper++;
|
Count.oper++;
|
||||||
|
|
||||||
source->umodes |= flag;
|
source->mode |= umode(flag);
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsOper(source) && !IsService(source))
|
if(is(*source, umode::OPER) && !is(*source, umode::SERVICE))
|
||||||
rb_dlinkAddAlloc(source, &oper_list);
|
rb_dlinkAddAlloc(source, &oper_list);
|
||||||
|
|
||||||
set_remote_client(*source);
|
set_remote_client(*source);
|
||||||
|
@ -1158,7 +1158,7 @@ static void bad_nickname(client::client &client, const char *nick)
|
||||||
{
|
{
|
||||||
char squitreason[100];
|
char squitreason[100];
|
||||||
|
|
||||||
sendto_wallops_flags(UMODE_WALLOP, &me,
|
sendto_wallops_flags(umode::WALLOP, &me,
|
||||||
"Squitting %s because of bad nickname %s (NICKLEN mismatch?)",
|
"Squitting %s because of bad nickname %s (NICKLEN mismatch?)",
|
||||||
client.name, nick);
|
client.name, nick);
|
||||||
sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
|
sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
|
||||||
|
|
|
@ -102,7 +102,7 @@ part_one_client(client::client &client, client::client &source, char *name, cons
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(my_connect(source) && !IsOper(&source) && !is_exempt_spambot(source))
|
if(my_connect(source) && !is(source, umode::OPER) && !is_exempt_spambot(source))
|
||||||
chan::check_spambot_warning(&source, NULL);
|
chan::check_spambot_warning(&source, NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -61,7 +61,7 @@ m_quit(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
comment = reason;
|
comment = reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!IsOper(&source) &&
|
if(!is(source, umode::OPER) &&
|
||||||
(source.localClient->firsttime + ConfigFileEntry.anti_spam_exit_message_time) >
|
(source.localClient->firsttime + ConfigFileEntry.anti_spam_exit_message_time) >
|
||||||
rb_current_time())
|
rb_current_time())
|
||||||
{
|
{
|
||||||
|
|
|
@ -521,7 +521,7 @@ ms_sid(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
/* collision on the SID? */
|
/* collision on the SID? */
|
||||||
if((target_p = find_id(parv[3])) != NULL)
|
if((target_p = find_id(parv[3])) != NULL)
|
||||||
{
|
{
|
||||||
sendto_wallops_flags(UMODE_WALLOP, &me,
|
sendto_wallops_flags(umode::WALLOP, &me,
|
||||||
"Link %s cancelled, SID %s for server %s already in use by %s",
|
"Link %s cancelled, SID %s for server %s already in use by %s",
|
||||||
client.name, parv[3], parv[1], target_p->name);
|
client.name, parv[3], parv[1], target_p->name);
|
||||||
sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
|
sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
|
||||||
|
|
|
@ -122,7 +122,7 @@ ms_squit(struct MsgBuf *msgbuf_p, client::client &client, client::client &source
|
||||||
*/
|
*/
|
||||||
else if(my_connect(*target_p))
|
else if(my_connect(*target_p))
|
||||||
{
|
{
|
||||||
sendto_wallops_flags(UMODE_WALLOP, &me,
|
sendto_wallops_flags(umode::WALLOP, &me,
|
||||||
"Remote SQUIT %s from %s (%s)",
|
"Remote SQUIT %s from %s (%s)",
|
||||||
target_p->name, source.name, comment);
|
target_p->name, source.name, comment);
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ m_alias(struct MsgBuf *msgbuf, client::client &client, client::client &source, i
|
||||||
{
|
{
|
||||||
/* nick, must be +S */
|
/* nick, must be +S */
|
||||||
target_p = client::find_named_person(aptr->target.c_str());
|
target_p = client::find_named_person(aptr->target.c_str());
|
||||||
if(target_p != NULL && !IsService(target_p))
|
if(target_p != NULL && !is(*target_p, umode::SERVICE))
|
||||||
target_p = NULL;
|
target_p = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ m_away(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
/* Rate limit this because it is sent to common channels. */
|
/* Rate limit this because it is sent to common channels. */
|
||||||
if (my(source))
|
if (my(source))
|
||||||
{
|
{
|
||||||
if(!IsOper(&source) &&
|
if(!is(source, umode::OPER) &&
|
||||||
source.localClient->next_away > rb_current_time())
|
source.localClient->next_away > rb_current_time())
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(RPL_LOAD2HI),
|
sendto_one(&source, form_str(RPL_LOAD2HI),
|
||||||
|
|
|
@ -100,7 +100,7 @@ m_challenge(struct MsgBuf *msgbuf_p, client::client &client, client::client &sou
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
/* if theyre an oper, reprint oper motd and ignore */
|
/* if theyre an oper, reprint oper motd and ignore */
|
||||||
if(IsOper(&source))
|
if(is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(RPL_YOUREOPER), me.name, source.name);
|
sendto_one(&source, form_str(RPL_YOUREOPER), me.name, source.name);
|
||||||
send_oper_motd(&source);
|
send_oper_motd(&source);
|
||||||
|
|
|
@ -122,7 +122,7 @@ do_chghost(client::client &source, client::client *target_p,
|
||||||
}
|
}
|
||||||
if (my(source))
|
if (my(source))
|
||||||
sendto_one_notice(&source, ":Changed hostname for %s to %s", target_p->name, target_p->host);
|
sendto_one_notice(&source, ":Changed hostname for %s to %s", target_p->name, target_p->host);
|
||||||
if (!is_server(source) && !IsService(&source))
|
if (!is_server(source) && !is(source, umode::SERVICE))
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s changed hostname for %s to %s", get_oper_name(&source), target_p->name, target_p->host);
|
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s changed hostname for %s to %s", get_oper_name(&source), target_p->name, target_p->host);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,7 +207,7 @@ ms_connect(struct MsgBuf *msgbuf_p, client::client &client, client::client &sour
|
||||||
/*
|
/*
|
||||||
* Notify all operators about remote connect requests
|
* Notify all operators about remote connect requests
|
||||||
*/
|
*/
|
||||||
sendto_wallops_flags(UMODE_WALLOP, &me,
|
sendto_wallops_flags(umode::WALLOP, &me,
|
||||||
"Remote CONNECT %s %d from %s",
|
"Remote CONNECT %s %d from %s",
|
||||||
parv[1], port, source.name);
|
parv[1], port, source.name);
|
||||||
sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
|
sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
|
||||||
|
|
|
@ -124,7 +124,7 @@ me_etrace(struct MsgBuf *msgbuf_p, client::client &client, client::client &sourc
|
||||||
{
|
{
|
||||||
client::client *target_p;
|
client::client *target_p;
|
||||||
|
|
||||||
if(!IsOper(&source) || parc < 2 || EmptyString(parv[1]))
|
if(!is(source, umode::OPER) || parc < 2 || EmptyString(parv[1]))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* we cant etrace remote clients.. we shouldnt even get sent them */
|
/* we cant etrace remote clients.. we shouldnt even get sent them */
|
||||||
|
@ -154,7 +154,7 @@ do_etrace(client::client &source, int ipv4, int ipv6)
|
||||||
|
|
||||||
sendto_one(&source, form_str(RPL_ETRACE),
|
sendto_one(&source, form_str(RPL_ETRACE),
|
||||||
me.name, source.name,
|
me.name, source.name,
|
||||||
IsOper(target_p) ? "Oper" : "User",
|
is(*target_p, umode::OPER) ? "Oper" : "User",
|
||||||
get_client_class(target_p),
|
get_client_class(target_p),
|
||||||
target_p->name, target_p->username, target_p->host,
|
target_p->name, target_p->username, target_p->host,
|
||||||
show_ip(&source, target_p) ? target_p->sockhost : "255.255.255.255",
|
show_ip(&source, target_p) ? target_p->sockhost : "255.255.255.255",
|
||||||
|
@ -191,14 +191,14 @@ do_single_etrace(client::client &source, client::client *target_p)
|
||||||
if(!show_ip(&source, target_p))
|
if(!show_ip(&source, target_p))
|
||||||
sendto_one(&source, form_str(RPL_ETRACEFULL),
|
sendto_one(&source, form_str(RPL_ETRACEFULL),
|
||||||
me.name, source.name,
|
me.name, source.name,
|
||||||
IsOper(target_p) ? "Oper" : "User",
|
is(*target_p, umode::OPER) ? "Oper" : "User",
|
||||||
get_client_class(target_p),
|
get_client_class(target_p),
|
||||||
target_p->name, target_p->username, target_p->host,
|
target_p->name, target_p->username, target_p->host,
|
||||||
"255.255.255.255", "<hidden> <hidden>", target_p->info);
|
"255.255.255.255", "<hidden> <hidden>", target_p->info);
|
||||||
else
|
else
|
||||||
sendto_one(&source, form_str(RPL_ETRACEFULL),
|
sendto_one(&source, form_str(RPL_ETRACEFULL),
|
||||||
me.name, source.name,
|
me.name, source.name,
|
||||||
IsOper(target_p) ? "Oper" : "User",
|
is(*target_p, umode::OPER) ? "Oper" : "User",
|
||||||
get_client_class(target_p),
|
get_client_class(target_p),
|
||||||
target_p->name, target_p->username,
|
target_p->name, target_p->username,
|
||||||
target_p->host, target_p->sockhost,
|
target_p->host, target_p->sockhost,
|
||||||
|
@ -262,7 +262,7 @@ m_chantrace(struct MsgBuf *msgbuf_p, client::client &client, client::client &sou
|
||||||
|
|
||||||
sendto_one(&source, form_str(RPL_ETRACE),
|
sendto_one(&source, form_str(RPL_ETRACE),
|
||||||
me.name, source.name,
|
me.name, source.name,
|
||||||
IsOper(target_p) ? "Oper" : "User",
|
is(*target_p, umode::OPER) ? "Oper" : "User",
|
||||||
/* class field -- pretend its server.. */
|
/* class field -- pretend its server.. */
|
||||||
target_p->servptr->name,
|
target_p->servptr->name,
|
||||||
target_p->name, target_p->username, target_p->host,
|
target_p->name, target_p->username, target_p->host,
|
||||||
|
@ -307,7 +307,7 @@ match_masktrace(client::client &source, rb_dlink_list *list,
|
||||||
|
|
||||||
sendto_one(&source, form_str(RPL_ETRACE),
|
sendto_one(&source, form_str(RPL_ETRACE),
|
||||||
me.name, source.name,
|
me.name, source.name,
|
||||||
IsOper(target_p) ? "Oper" : "User",
|
is(*target_p, umode::OPER) ? "Oper" : "User",
|
||||||
/* class field -- pretend its server.. */
|
/* class field -- pretend its server.. */
|
||||||
target_p->servptr->name,
|
target_p->servptr->name,
|
||||||
target_p->name, target_p->username, target_p->host,
|
target_p->name, target_p->username, target_p->host,
|
||||||
|
|
|
@ -87,7 +87,7 @@ do_grant(client::client &source, client::client *target_p, const char *new_privs
|
||||||
|
|
||||||
if (!strcmp(new_privset, "deoper"))
|
if (!strcmp(new_privset, "deoper"))
|
||||||
{
|
{
|
||||||
if (!IsOper(target_p))
|
if (!is(*target_p, umode::OPER))
|
||||||
{
|
{
|
||||||
sendto_one_notice(&source, ":You can't deoper someone who isn't an oper.");
|
sendto_one_notice(&source, ":You can't deoper someone who isn't an oper.");
|
||||||
return;
|
return;
|
||||||
|
@ -115,7 +115,7 @@ do_grant(client::client &source, client::client *target_p, const char *new_privs
|
||||||
|
|
||||||
if (!dodeoper)
|
if (!dodeoper)
|
||||||
{
|
{
|
||||||
if (!IsOper(target_p))
|
if (!is(*target_p, umode::OPER))
|
||||||
{
|
{
|
||||||
sendto_one_notice(target_p, ":%s is opering you with privilege set %s", source.name, privset->name);
|
sendto_one_notice(target_p, ":%s is opering you with privilege set %s", source.name, privset->name);
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s is opering %s with privilege set %s", get_oper_name(&source), target_p->name, privset->name);
|
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s is opering %s with privilege set %s", get_oper_name(&source), target_p->name, privset->name);
|
||||||
|
|
|
@ -690,7 +690,7 @@ mo_info(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
info_spy(source);
|
info_spy(source);
|
||||||
send_info_text(source);
|
send_info_text(source);
|
||||||
|
|
||||||
if(IsOper(&source))
|
if(is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
send_conf_options(source);
|
send_conf_options(source);
|
||||||
sendto_one_numeric(&source, RPL_INFO, ":%s",
|
sendto_one_numeric(&source, RPL_INFO, ":%s",
|
||||||
|
|
|
@ -148,7 +148,7 @@ m_invite(struct MsgBuf *msgbuf_p, client::client &client, client::client &source
|
||||||
|
|
||||||
if(my_connect(source))
|
if(my_connect(source))
|
||||||
{
|
{
|
||||||
if (ConfigFileEntry.target_change && !IsOper(&source) &&
|
if (ConfigFileEntry.target_change && !is(source, umode::OPER) &&
|
||||||
!find_allowing_channel(&source, target_p) &&
|
!find_allowing_channel(&source, target_p) &&
|
||||||
!add_target(&source, target_p))
|
!add_target(&source, target_p))
|
||||||
{
|
{
|
||||||
|
@ -173,11 +173,11 @@ m_invite(struct MsgBuf *msgbuf_p, client::client &client, client::client &source
|
||||||
|
|
||||||
if(my_connect(*target_p))
|
if(my_connect(*target_p))
|
||||||
{
|
{
|
||||||
if(!IsOper(&source) && (IsSetCallerId(target_p) ||
|
if(!is(source, umode::OPER) && (is(*target_p, umode::CALLERID) ||
|
||||||
(IsSetRegOnlyMsg(target_p) && !suser(user(source))[0])) &&
|
(is(*target_p, umode::REGONLYMSG) && !suser(user(source))[0])) &&
|
||||||
!accept_message(&source, target_p))
|
!accept_message(&source, target_p))
|
||||||
{
|
{
|
||||||
if (IsSetRegOnlyMsg(target_p) && !suser(user(source))[0])
|
if (is(*target_p, umode::REGONLYMSG) && !suser(user(source))[0])
|
||||||
{
|
{
|
||||||
sendto_one_numeric(&source, ERR_NONONREG,
|
sendto_one_numeric(&source, ERR_NONONREG,
|
||||||
form_str(ERR_NONONREG),
|
form_str(ERR_NONONREG),
|
||||||
|
|
|
@ -128,7 +128,7 @@ m_knock(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
* allow one knock per user per knock_delay
|
* allow one knock per user per knock_delay
|
||||||
* allow one knock per channel per knock_delay_channel
|
* allow one knock per channel per knock_delay_channel
|
||||||
*/
|
*/
|
||||||
if(!IsOper(&source) &&
|
if(!is(source, umode::OPER) &&
|
||||||
(source.localClient->last_knock + ConfigChannel.knock_delay) > rb_current_time())
|
(source.localClient->last_knock + ConfigChannel.knock_delay) > rb_current_time())
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_TOOMANYKNOCK),
|
sendto_one(&source, form_str(ERR_TOOMANYKNOCK),
|
||||||
|
|
|
@ -76,7 +76,7 @@ m_names(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!IsOper(&source))
|
if(!is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
|
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
|
||||||
{
|
{
|
||||||
|
@ -132,7 +132,7 @@ names_global(client::client &source)
|
||||||
target_p = (client::client *)ptr->data;
|
target_p = (client::client *)ptr->data;
|
||||||
dont_show = false;
|
dont_show = false;
|
||||||
|
|
||||||
if(!is_person(*target_p) || is_invisible(*target_p))
|
if(!is_person(*target_p) || is(*target_p, umode::INVISIBLE))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* we want to show -i clients that are either:
|
/* we want to show -i clients that are either:
|
||||||
|
|
|
@ -54,7 +54,7 @@ m_oper(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
name = parv[1];
|
name = parv[1];
|
||||||
password = parv[2];
|
password = parv[2];
|
||||||
|
|
||||||
if(IsOper(&source))
|
if(is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(RPL_YOUREOPER), me.name, source.name);
|
sendto_one(&source, form_str(RPL_YOUREOPER), me.name, source.name);
|
||||||
cache::motd::send_oper(&source);
|
cache::motd::send_oper(&source);
|
||||||
|
@ -85,7 +85,7 @@ m_oper(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsOperConfNeedSSL(oper_p) && !IsSSLClient(&source))
|
if(IsOperConfNeedSSL(oper_p) && !is(source, umode::SSLCLIENT))
|
||||||
{
|
{
|
||||||
sendto_one_numeric(&source, ERR_NOOPERHOST, form_str(ERR_NOOPERHOST));
|
sendto_one_numeric(&source, ERR_NOOPERHOST, form_str(ERR_NOOPERHOST));
|
||||||
ilog(L_FOPER, "FAILED OPER (%s) by (%s!%s@%s) (%s) -- requires SSL/TLS",
|
ilog(L_FOPER, "FAILED OPER (%s) by (%s!%s@%s) (%s) -- requires SSL/TLS",
|
||||||
|
|
|
@ -80,7 +80,7 @@ static void show_privs(client::client &source, client::client *target_p)
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
if (target_p->localClient->privset)
|
if (target_p->localClient->privset)
|
||||||
rb_strlcat(buf, target_p->localClient->privset->privs, sizeof buf);
|
rb_strlcat(buf, target_p->localClient->privset->privs, sizeof buf);
|
||||||
if (IsOper(target_p))
|
if (is(*target_p, umode::OPER))
|
||||||
{
|
{
|
||||||
if (buf[0] != '\0')
|
if (buf[0] != '\0')
|
||||||
rb_strlcat(buf, " ", sizeof buf);
|
rb_strlcat(buf, " ", sizeof buf);
|
||||||
|
@ -115,7 +115,7 @@ me_privs(struct MsgBuf *msgbuf_p, client::client &client, client::client &source
|
||||||
{
|
{
|
||||||
client::client *target_p;
|
client::client *target_p;
|
||||||
|
|
||||||
if (!IsOper(&source) || parc < 2 || EmptyString(parv[1]))
|
if (!is(source, umode::OPER) || parc < 2 || EmptyString(parv[1]))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* we cannot show privs for remote clients */
|
/* we cannot show privs for remote clients */
|
||||||
|
|
|
@ -76,7 +76,7 @@ sasl_visible(client::client *client)
|
||||||
if (ConfigFileEntry.sasl_service)
|
if (ConfigFileEntry.sasl_service)
|
||||||
agent_p = find_named_client(ConfigFileEntry.sasl_service);
|
agent_p = find_named_client(ConfigFileEntry.sasl_service);
|
||||||
|
|
||||||
return agent_p != NULL && IsService(agent_p);
|
return agent_p != NULL && is(*agent_p, umode::SERVICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
|
@ -131,7 +131,7 @@ m_authenticate(struct MsgBuf *msgbuf_p, client::client &client, client::client &
|
||||||
}
|
}
|
||||||
|
|
||||||
saslserv_p = find_named_client(ConfigFileEntry.sasl_service);
|
saslserv_p = find_named_client(ConfigFileEntry.sasl_service);
|
||||||
if(saslserv_p == NULL || !IsService(saslserv_p))
|
if(saslserv_p == NULL || !is(*saslserv_p, umode::SERVICE))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_SASLABORTED), me.name, EmptyString(source.name) ? "*" : source.name);
|
sendto_one(&source, form_str(ERR_SASLABORTED), me.name, EmptyString(source.name) ? "*" : source.name);
|
||||||
return;
|
return;
|
||||||
|
@ -207,7 +207,7 @@ me_sasl(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
/* We only accept messages from SASL agents; these must have umode +S
|
/* We only accept messages from SASL agents; these must have umode +S
|
||||||
* (so the server must be listed in a service{} block).
|
* (so the server must be listed in a service{} block).
|
||||||
*/
|
*/
|
||||||
if(!IsService(agent_p))
|
if(!is(*agent_p, umode::SERVICE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Reject if someone has already answered. */
|
/* Reject if someone has already answered. */
|
||||||
|
|
|
@ -208,7 +208,7 @@ scan_umodes(struct MsgBuf *msgbuf_p, client::client &client, client::client &sou
|
||||||
else
|
else
|
||||||
sockhost = target_p->sockhost;
|
sockhost = target_p->sockhost;
|
||||||
|
|
||||||
working_umodes = target_p->umodes;
|
working_umodes = target_p->mode;
|
||||||
|
|
||||||
/* require that we have the allowed umodes... */
|
/* require that we have the allowed umodes... */
|
||||||
if ((working_umodes & allowed_umodes) != allowed_umodes)
|
if ((working_umodes & allowed_umodes) != allowed_umodes)
|
||||||
|
@ -236,7 +236,7 @@ scan_umodes(struct MsgBuf *msgbuf_p, client::client &client, client::client &sou
|
||||||
|
|
||||||
for (i = 0; i < 128; i++)
|
for (i = 0; i < 128; i++)
|
||||||
{
|
{
|
||||||
if (target_p->umodes & user_modes[i])
|
if (is(*target_p, umode(user_modes[i])))
|
||||||
*m++ = (char) i;
|
*m++ = (char) i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -321,7 +321,7 @@ h_svc_stats(hook_data_int *data)
|
||||||
char statchar = (char) data->arg2;
|
char statchar = (char) data->arg2;
|
||||||
rb_dlink_node *ptr;
|
rb_dlink_node *ptr;
|
||||||
|
|
||||||
if (statchar == 'U' && IsOper(data->client))
|
if (statchar == 'U' && is(*data->client, umode::OPER))
|
||||||
{
|
{
|
||||||
RB_DLINK_FOREACH(ptr, service_list.head)
|
RB_DLINK_FOREACH(ptr, service_list.head)
|
||||||
{
|
{
|
||||||
|
|
|
@ -213,7 +213,7 @@ m_stats(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
|
|
||||||
statchar = parv[1][0];
|
statchar = parv[1][0];
|
||||||
|
|
||||||
if(my(source) && !IsOper(&source))
|
if(my(source) && !is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
/* Check the user is actually allowed to do /stats, and isnt flooding */
|
/* Check the user is actually allowed to do /stats, and isnt flooding */
|
||||||
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
|
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
|
||||||
|
@ -254,7 +254,7 @@ m_stats(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
me.name, source.name, "admin");
|
me.name, source.name, "admin");
|
||||||
goto stats_out;
|
goto stats_out;
|
||||||
}
|
}
|
||||||
if(cmd->need_oper && !IsOper(&source))
|
if(cmd->need_oper && !is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
||||||
form_str (ERR_NOPRIVILEGES));
|
form_str (ERR_NOPRIVILEGES));
|
||||||
|
@ -325,7 +325,7 @@ stats_connect(client::client &source)
|
||||||
|
|
||||||
if((ConfigFileEntry.stats_c_oper_only ||
|
if((ConfigFileEntry.stats_c_oper_only ||
|
||||||
(ConfigServerHide.flatten_links && !is_exempt_shide(source))) &&
|
(ConfigServerHide.flatten_links && !is_exempt_shide(source))) &&
|
||||||
!IsOper(&source))
|
!is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
||||||
form_str(ERR_NOPRIVILEGES));
|
form_str(ERR_NOPRIVILEGES));
|
||||||
|
@ -341,7 +341,7 @@ stats_connect(client::client &source)
|
||||||
|
|
||||||
s = buf;
|
s = buf;
|
||||||
|
|
||||||
if(IsOper(&source))
|
if(is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
if(ServerConfAutoconn(server_p))
|
if(ServerConfAutoconn(server_p))
|
||||||
*s++ = 'A';
|
*s++ = 'A';
|
||||||
|
@ -528,7 +528,7 @@ stats_hubleaf(client::client &source)
|
||||||
|
|
||||||
if((ConfigFileEntry.stats_h_oper_only ||
|
if((ConfigFileEntry.stats_h_oper_only ||
|
||||||
(ConfigServerHide.flatten_links && !is_exempt_shide(source))) &&
|
(ConfigServerHide.flatten_links && !is_exempt_shide(source))) &&
|
||||||
!IsOper(&source))
|
!is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
||||||
form_str (ERR_NOPRIVILEGES));
|
form_str (ERR_NOPRIVILEGES));
|
||||||
|
@ -555,12 +555,12 @@ static void
|
||||||
stats_auth (client::client &source)
|
stats_auth (client::client &source)
|
||||||
{
|
{
|
||||||
/* Oper only, if unopered, return ERR_NOPRIVS */
|
/* Oper only, if unopered, return ERR_NOPRIVS */
|
||||||
if((ConfigFileEntry.stats_i_oper_only == 2) && !IsOper (&source))
|
if((ConfigFileEntry.stats_i_oper_only == 2) && !is(source, umode::OPER))
|
||||||
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
||||||
form_str (ERR_NOPRIVILEGES));
|
form_str (ERR_NOPRIVILEGES));
|
||||||
|
|
||||||
/* If unopered, Only return matching auth blocks */
|
/* If unopered, Only return matching auth blocks */
|
||||||
else if((ConfigFileEntry.stats_i_oper_only == 1) && !IsOper (&source))
|
else if((ConfigFileEntry.stats_i_oper_only == 1) && !is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
struct ConfItem *aconf;
|
struct ConfItem *aconf;
|
||||||
char *name, *host, *user, *classname;
|
char *name, *host, *user, *classname;
|
||||||
|
@ -599,12 +599,12 @@ static void
|
||||||
stats_tklines(client::client &source)
|
stats_tklines(client::client &source)
|
||||||
{
|
{
|
||||||
/* Oper only, if unopered, return ERR_NOPRIVS */
|
/* Oper only, if unopered, return ERR_NOPRIVS */
|
||||||
if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOper (&source))
|
if((ConfigFileEntry.stats_k_oper_only == 2) && !is(source, umode::OPER))
|
||||||
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
||||||
form_str (ERR_NOPRIVILEGES));
|
form_str (ERR_NOPRIVILEGES));
|
||||||
|
|
||||||
/* If unopered, Only return matching klines */
|
/* If unopered, Only return matching klines */
|
||||||
else if((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper (&source))
|
else if((ConfigFileEntry.stats_k_oper_only == 1) && !is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
struct ConfItem *aconf;
|
struct ConfItem *aconf;
|
||||||
char *host, *pass, *user, *oper_reason;
|
char *host, *pass, *user, *oper_reason;
|
||||||
|
@ -701,12 +701,12 @@ static void
|
||||||
stats_klines(client::client &source)
|
stats_klines(client::client &source)
|
||||||
{
|
{
|
||||||
/* Oper only, if unopered, return ERR_NOPRIVS */
|
/* Oper only, if unopered, return ERR_NOPRIVS */
|
||||||
if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOper (&source))
|
if((ConfigFileEntry.stats_k_oper_only == 2) && !is(source, umode::OPER))
|
||||||
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
||||||
form_str (ERR_NOPRIVILEGES));
|
form_str (ERR_NOPRIVILEGES));
|
||||||
|
|
||||||
/* If unopered, Only return matching klines */
|
/* If unopered, Only return matching klines */
|
||||||
else if((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper (&source))
|
else if((ConfigFileEntry.stats_k_oper_only == 1) && !is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
struct ConfItem *aconf;
|
struct ConfItem *aconf;
|
||||||
char *host, *pass, *user, *oper_reason;
|
char *host, *pass, *user, *oper_reason;
|
||||||
|
@ -778,7 +778,7 @@ stats_oper(client::client &source)
|
||||||
struct oper_conf *oper_p;
|
struct oper_conf *oper_p;
|
||||||
rb_dlink_node *ptr;
|
rb_dlink_node *ptr;
|
||||||
|
|
||||||
if(!IsOper(&source) && ConfigFileEntry.stats_o_oper_only)
|
if(!is(source, umode::OPER) && ConfigFileEntry.stats_o_oper_only)
|
||||||
{
|
{
|
||||||
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
||||||
form_str (ERR_NOPRIVILEGES));
|
form_str (ERR_NOPRIVILEGES));
|
||||||
|
@ -792,7 +792,7 @@ stats_oper(client::client &source)
|
||||||
sendto_one_numeric(&source, RPL_STATSOLINE,
|
sendto_one_numeric(&source, RPL_STATSOLINE,
|
||||||
form_str(RPL_STATSOLINE),
|
form_str(RPL_STATSOLINE),
|
||||||
oper_p->username, oper_p->host, oper_p->name,
|
oper_p->username, oper_p->host, oper_p->name,
|
||||||
IsOper(&source) ? oper_p->privset->name : "0", "-1");
|
is(source, umode::OPER) ? oper_p->privset->name : "0", "-1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -833,7 +833,7 @@ stats_operedup (client::client &source)
|
||||||
{
|
{
|
||||||
target_p = (client::client *)oper_ptr->data;
|
target_p = (client::client *)oper_ptr->data;
|
||||||
|
|
||||||
if(IsOperInvis(target_p) && !IsOper(&source))
|
if(IsOperInvis(target_p) && !is(source, umode::OPER))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(away(user(*target_p)).size())
|
if(away(user(*target_p)).size())
|
||||||
|
@ -856,7 +856,7 @@ stats_operedup (client::client &source)
|
||||||
static void
|
static void
|
||||||
stats_ports (client::client &source)
|
stats_ports (client::client &source)
|
||||||
{
|
{
|
||||||
if(!IsOper (&source) && ConfigFileEntry.stats_P_oper_only)
|
if(!is(source, umode::OPER) && ConfigFileEntry.stats_P_oper_only)
|
||||||
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
||||||
form_str (ERR_NOPRIVILEGES));
|
form_str (ERR_NOPRIVILEGES));
|
||||||
else
|
else
|
||||||
|
@ -1188,7 +1188,7 @@ stats_servers (client::client &source)
|
||||||
int days, hours, minutes;
|
int days, hours, minutes;
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
if(ConfigServerHide.flatten_links && !IsOper(&source) &&
|
if(ConfigServerHide.flatten_links && !is(source, umode::OPER) &&
|
||||||
!is_exempt_shide(source))
|
!is_exempt_shide(source))
|
||||||
{
|
{
|
||||||
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
||||||
|
@ -1264,7 +1264,7 @@ stats_gecos(client::client &source)
|
||||||
static void
|
static void
|
||||||
stats_class(client::client &source)
|
stats_class(client::client &source)
|
||||||
{
|
{
|
||||||
if(ConfigFileEntry.stats_y_oper_only && !IsOper(&source))
|
if(ConfigFileEntry.stats_y_oper_only && !is(source, umode::OPER))
|
||||||
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
||||||
form_str (ERR_NOPRIVILEGES));
|
form_str (ERR_NOPRIVILEGES));
|
||||||
else
|
else
|
||||||
|
@ -1515,7 +1515,7 @@ stats_servlinks (client::client &source)
|
||||||
int j = 0;
|
int j = 0;
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
||||||
if(ConfigServerHide.flatten_links && !IsOper (&source) &&
|
if(ConfigServerHide.flatten_links && !is(source, umode::OPER) &&
|
||||||
!is_exempt_shide(source))
|
!is_exempt_shide(source))
|
||||||
{
|
{
|
||||||
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
sendto_one_numeric(&source, ERR_NOPRIVILEGES,
|
||||||
|
@ -1544,7 +1544,7 @@ stats_servlinks (client::client &source)
|
||||||
rb_current_time() - target_p->localClient->firsttime,
|
rb_current_time() - target_p->localClient->firsttime,
|
||||||
(rb_current_time() > target_p->localClient->lasttime) ?
|
(rb_current_time() > target_p->localClient->lasttime) ?
|
||||||
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
||||||
IsOper (&source) ? show_capabilities (target_p) : "TS");
|
is(source, umode::OPER) ? show_capabilities (target_p) : "TS");
|
||||||
}
|
}
|
||||||
|
|
||||||
sendto_one_numeric(&source, RPL_STATSDEBUG,
|
sendto_one_numeric(&source, RPL_STATSDEBUG,
|
||||||
|
@ -1636,7 +1636,7 @@ stats_ltrace(client::client &source, int parc, const char *parv[])
|
||||||
if(doall)
|
if(doall)
|
||||||
{
|
{
|
||||||
/* local opers get everyone */
|
/* local opers get everyone */
|
||||||
if(MyOper(&source))
|
if(my_oper(source))
|
||||||
{
|
{
|
||||||
stats_l_list(source, name, doall, wilds, &unknown_list, statchar, NULL);
|
stats_l_list(source, name, doall, wilds, &unknown_list, statchar, NULL);
|
||||||
stats_l_list(source, name, doall, wilds, &lclient_list, statchar, NULL);
|
stats_l_list(source, name, doall, wilds, &lclient_list, statchar, NULL);
|
||||||
|
@ -1650,7 +1650,7 @@ stats_ltrace(client::client &source, int parc, const char *parv[])
|
||||||
stats_l_list(source, name, doall, wilds, &local_oper_list, statchar, stats_l_should_show_oper);
|
stats_l_list(source, name, doall, wilds, &local_oper_list, statchar, stats_l_should_show_oper);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ConfigServerHide.flatten_links || IsOper(&source) ||
|
if (!ConfigServerHide.flatten_links || is(source, umode::OPER) ||
|
||||||
is_exempt_shide(source))
|
is_exempt_shide(source))
|
||||||
stats_l_list(source, name, doall, wilds, &serv_list, statchar, NULL);
|
stats_l_list(source, name, doall, wilds, &serv_list, statchar, NULL);
|
||||||
|
|
||||||
|
@ -1704,7 +1704,7 @@ stats_l_client(client::client &source, client::client *target_p,
|
||||||
rb_current_time() - target_p->localClient->firsttime,
|
rb_current_time() - target_p->localClient->firsttime,
|
||||||
(rb_current_time() > target_p->localClient->lasttime) ?
|
(rb_current_time() > target_p->localClient->lasttime) ?
|
||||||
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
||||||
IsOper(&source) ? show_capabilities(target_p) : "-");
|
is(source, umode::OPER) ? show_capabilities(target_p) : "-");
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
@ -97,7 +97,7 @@ m_topic(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
if (my(source) &&
|
if (my(source) &&
|
||||||
!is_chanop(msptr) &&
|
!is_chanop(msptr) &&
|
||||||
!is_voiced(msptr) &&
|
!is_voiced(msptr) &&
|
||||||
!IsOper(&source) &&
|
!is(source, umode::OPER) &&
|
||||||
!add_channel_target(&source, chptr))
|
!add_channel_target(&source, chptr))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(ERR_TARGCHANGE),
|
sendto_one(&source, form_str(ERR_TARGCHANGE),
|
||||||
|
|
|
@ -110,7 +110,7 @@ m_trace(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
/* giving this out with flattened links defeats the
|
/* giving this out with flattened links defeats the
|
||||||
* object --fl
|
* object --fl
|
||||||
*/
|
*/
|
||||||
if(IsOper(&source) || is_exempt_shide(source) ||
|
if(is(source, umode::OPER) || is_exempt_shide(source) ||
|
||||||
!ConfigServerHide.flatten_links)
|
!ConfigServerHide.flatten_links)
|
||||||
sendto_one_numeric(&source, RPL_TRACELINK,
|
sendto_one_numeric(&source, RPL_TRACELINK,
|
||||||
form_str(RPL_TRACELINK),
|
form_str(RPL_TRACELINK),
|
||||||
|
@ -174,7 +174,7 @@ m_trace(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
/* give non-opers a limited trace output of themselves (if local),
|
/* give non-opers a limited trace output of themselves (if local),
|
||||||
* opers and servers (if no shide) --fl
|
* opers and servers (if no shide) --fl
|
||||||
*/
|
*/
|
||||||
if(!IsOper(&source))
|
if(!is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
if(my(source))
|
if(my(source))
|
||||||
{
|
{
|
||||||
|
@ -218,15 +218,15 @@ m_trace(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
target_p = (client::client *)ptr->data;
|
target_p = (client::client *)ptr->data;
|
||||||
|
|
||||||
/* dont show invisible users to remote opers */
|
/* dont show invisible users to remote opers */
|
||||||
if(is_invisible(*target_p) && dow && !my_connect(source) && !IsOper(target_p))
|
if(is(*target_p, umode::INVISIBLE) && dow && !my_connect(source) && !is(*target_p, umode::OPER))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(!doall && wilds && !match(tname, target_p->name))
|
if(!doall && wilds && !match(tname, target_p->name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* remote opers may not see invisible normal users */
|
/* remote opers may not see invisible normal users */
|
||||||
if(dow && !my_connect(source) && !IsOper(target_p) &&
|
if(dow && !my_connect(source) && !is(*target_p, umode::OPER) &&
|
||||||
is_invisible(*target_p))
|
is(*target_p, umode::INVISIBLE))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
cnt = report_this_status(source, target_p);
|
cnt = report_this_status(source, target_p);
|
||||||
|
@ -362,8 +362,8 @@ report_this_status(client::client &source, client::client *target_p)
|
||||||
case client::status::CLIENT:
|
case client::status::CLIENT:
|
||||||
{
|
{
|
||||||
sendto_one_numeric(&source,
|
sendto_one_numeric(&source,
|
||||||
IsOper(target_p) ? RPL_TRACEOPERATOR : RPL_TRACEUSER,
|
is(*target_p, umode::OPER) ? RPL_TRACEOPERATOR : RPL_TRACEUSER,
|
||||||
IsOper(target_p) ? form_str(RPL_TRACEOPERATOR) : form_str(RPL_TRACEUSER),
|
is(*target_p, umode::OPER) ? form_str(RPL_TRACEOPERATOR) : form_str(RPL_TRACEUSER),
|
||||||
class_name, name,
|
class_name, name,
|
||||||
show_ip(&source, target_p) ? ip : empty_sockhost,
|
show_ip(&source, target_p) ? ip : empty_sockhost,
|
||||||
(unsigned long)(rb_current_time() - target_p->localClient->lasttime),
|
(unsigned long)(rb_current_time() - target_p->localClient->lasttime),
|
||||||
|
|
|
@ -75,7 +75,7 @@ m_userhost(struct MsgBuf *msgbuf_p, client::client &client, client::client &sour
|
||||||
{
|
{
|
||||||
rl = sprintf(response, "%s%s=%c%s@%s ",
|
rl = sprintf(response, "%s%s=%c%s@%s ",
|
||||||
target_p->name,
|
target_p->name,
|
||||||
IsOper(target_p) ? "*" : "",
|
is(*target_p, umode::OPER) ? "*" : "",
|
||||||
(away(user(*target_p)).size())? '-' : '+',
|
(away(user(*target_p)).size())? '-' : '+',
|
||||||
target_p->username,
|
target_p->username,
|
||||||
target_p->sockhost);
|
target_p->sockhost);
|
||||||
|
@ -84,7 +84,7 @@ m_userhost(struct MsgBuf *msgbuf_p, client::client &client, client::client &sour
|
||||||
{
|
{
|
||||||
rl = sprintf(response, "%s%s=%c%s@%s ",
|
rl = sprintf(response, "%s%s=%c%s@%s ",
|
||||||
target_p->name,
|
target_p->name,
|
||||||
IsOper(target_p) ? "*" : "",
|
is(*target_p, umode::OPER) ? "*" : "",
|
||||||
(away(user(*target_p)).size())? '-' : '+',
|
(away(user(*target_p)).size())? '-' : '+',
|
||||||
target_p->username, target_p->host);
|
target_p->username, target_p->host);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ mo_operwall(struct MsgBuf *msgbuf_p, client::client &client, client::client &sou
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendto_wallops_flags(UMODE_OPERWALL, &source, "OPERWALL - %s", parv[1]);
|
sendto_wallops_flags(umode::OPERWALL, &source, "OPERWALL - %s", parv[1]);
|
||||||
sendto_server(&client, NULL, CAP_TS6, NOCAPS, ":%s OPERWALL :%s",
|
sendto_server(&client, NULL, CAP_TS6, NOCAPS, ":%s OPERWALL :%s",
|
||||||
use_id(&source), parv[1]);
|
use_id(&source), parv[1]);
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ ms_operwall(struct MsgBuf *msgbuf_p, client::client &client, client::client &sou
|
||||||
{
|
{
|
||||||
sendto_server(&client, NULL, CAP_TS6, NOCAPS, ":%s OPERWALL :%s",
|
sendto_server(&client, NULL, CAP_TS6, NOCAPS, ":%s OPERWALL :%s",
|
||||||
use_id(&source), parv[1]);
|
use_id(&source), parv[1]);
|
||||||
sendto_wallops_flags(UMODE_OPERWALL, &source, "OPERWALL - %s", parv[1]);
|
sendto_wallops_flags(umode::OPERWALL, &source, "OPERWALL - %s", parv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -101,7 +101,7 @@ ms_wallops(struct MsgBuf *msgbuf_p, client::client &client, client::client &sour
|
||||||
prefix = "WALLOPS - ";
|
prefix = "WALLOPS - ";
|
||||||
}
|
}
|
||||||
|
|
||||||
sendto_wallops_flags(UMODE_WALLOP, &source, "%s%s", prefix, parv[1]);
|
sendto_wallops_flags(umode::WALLOP, &source, "%s%s", prefix, parv[1]);
|
||||||
|
|
||||||
sendto_server(&client, NULL, CAP_TS6, NOCAPS, ":%s WALLOPS :%s",
|
sendto_server(&client, NULL, CAP_TS6, NOCAPS, ":%s WALLOPS :%s",
|
||||||
use_id(&source), parv[1]);
|
use_id(&source), parv[1]);
|
||||||
|
|
|
@ -176,7 +176,7 @@ m_who(struct MsgBuf *msgbuf_p, client::client &client, client::client &source, i
|
||||||
|
|
||||||
if(chptr != NULL)
|
if(chptr != NULL)
|
||||||
{
|
{
|
||||||
if (!IsOper(&source) && !ratelimit_client_who(&source, size(chptr->members)/50))
|
if (!is(source, umode::OPER) && !ratelimit_client_who(&source, size(chptr->members)/50))
|
||||||
{
|
{
|
||||||
sendto_one(&source, form_str(RPL_LOAD2HI),
|
sendto_one(&source, form_str(RPL_LOAD2HI),
|
||||||
me.name, source.name, "WHO");
|
me.name, source.name, "WHO");
|
||||||
|
@ -202,11 +202,11 @@ m_who(struct MsgBuf *msgbuf_p, client::client &client, client::client &source, i
|
||||||
/* '/who nick' */
|
/* '/who nick' */
|
||||||
|
|
||||||
if(((target_p = client::find_named_person(mask)) != NULL) &&
|
if(((target_p = client::find_named_person(mask)) != NULL) &&
|
||||||
(!server_oper || IsOper(target_p)))
|
(!server_oper || is(*target_p, umode::OPER)))
|
||||||
{
|
{
|
||||||
int isinvis = 0;
|
int isinvis = 0;
|
||||||
|
|
||||||
isinvis = is_invisible(*target_p);
|
isinvis = is(*target_p, umode::INVISIBLE);
|
||||||
for(const auto &pit : chans(user(*target_p)))
|
for(const auto &pit : chans(user(*target_p)))
|
||||||
{
|
{
|
||||||
chptr = pit.first;
|
chptr = pit.first;
|
||||||
|
@ -238,7 +238,7 @@ m_who(struct MsgBuf *msgbuf_p, client::client &client, client::client &source, i
|
||||||
flood_endgrace(&source);
|
flood_endgrace(&source);
|
||||||
|
|
||||||
/* it has to be a global who at this point, limit it */
|
/* it has to be a global who at this point, limit it */
|
||||||
if(!IsOper(&source))
|
if(!is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time() || !ratelimit_client(&source, 1))
|
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time() || !ratelimit_client(&source, 1))
|
||||||
{
|
{
|
||||||
|
@ -291,10 +291,10 @@ who_common_channel(client::client &source, chan::chan *chptr,
|
||||||
const auto &target(pit.first);
|
const auto &target(pit.first);
|
||||||
const auto &member(pit.second);
|
const auto &member(pit.second);
|
||||||
|
|
||||||
if(!is_invisible(*target) || is_marked(*target))
|
if(!is(*target, umode::INVISIBLE) || is_marked(*target))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(server_oper && !IsOper(target))
|
if(server_oper && !is(*target, umode::OPER))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
set_mark(*target);
|
set_mark(*target);
|
||||||
|
@ -304,7 +304,7 @@ who_common_channel(client::client &source, chan::chan *chptr,
|
||||||
if((mask == NULL) ||
|
if((mask == NULL) ||
|
||||||
match(mask, target->name) || match(mask, target->username) ||
|
match(mask, target->name) || match(mask, target->username) ||
|
||||||
match(mask, target->host) || match(mask, target->servptr->name) ||
|
match(mask, target->host) || match(mask, target->servptr->name) ||
|
||||||
(IsOper(&source) && match(mask, target->orighost)) ||
|
(is(source, umode::OPER) && match(mask, target->orighost)) ||
|
||||||
match(mask, target->info))
|
match(mask, target->info))
|
||||||
{
|
{
|
||||||
do_who(source, target, chptr, nullptr, fmt);
|
do_who(source, target, chptr, nullptr, fmt);
|
||||||
|
@ -361,13 +361,13 @@ who_global(client::client &source, const char *mask, int server_oper, int opersp
|
||||||
if(!is_person(*target_p))
|
if(!is_person(*target_p))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(is_invisible(*target_p) && !operspy)
|
if(is(*target_p, umode::INVISIBLE) && !operspy)
|
||||||
{
|
{
|
||||||
clear_mark(*target_p);
|
clear_mark(*target_p);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(server_oper && !IsOper(target_p))
|
if(server_oper && !is(*target_p, umode::OPER))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(maxmatches > 0)
|
if(maxmatches > 0)
|
||||||
|
@ -375,7 +375,7 @@ who_global(client::client &source, const char *mask, int server_oper, int opersp
|
||||||
if(!mask ||
|
if(!mask ||
|
||||||
match(mask, target_p->name) || match(mask, target_p->username) ||
|
match(mask, target_p->name) || match(mask, target_p->username) ||
|
||||||
match(mask, target_p->host) || match(mask, target_p->servptr->name) ||
|
match(mask, target_p->host) || match(mask, target_p->servptr->name) ||
|
||||||
(IsOper(&source) && match(mask, target_p->orighost)) ||
|
(is(source, umode::OPER) && match(mask, target_p->orighost)) ||
|
||||||
match(mask, target_p->info))
|
match(mask, target_p->info))
|
||||||
{
|
{
|
||||||
do_who(source, target_p, nullptr, nullptr, fmt);
|
do_who(source, target_p, nullptr, nullptr, fmt);
|
||||||
|
@ -411,10 +411,10 @@ do_who_on_channel(client::client &source, chan::chan *chptr,
|
||||||
const auto &target(pit.first);
|
const auto &target(pit.first);
|
||||||
auto &member(pit.second);
|
auto &member(pit.second);
|
||||||
|
|
||||||
if(server_oper && !IsOper(target))
|
if(server_oper && !is(*target, umode::OPER))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(source_member || !is_invisible(*target))
|
if(source_member || !is(*target, umode::INVISIBLE))
|
||||||
do_who(source, target, chptr, &member, fmt);
|
do_who(source, target, chptr, &member, fmt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -464,14 +464,14 @@ do_who(client::client &source, client::client *target_p, chan::chan *chan, chan:
|
||||||
const char *q;
|
const char *q;
|
||||||
|
|
||||||
sprintf(status, "%c%s%s",
|
sprintf(status, "%c%s%s",
|
||||||
away(user(*target_p)).size()? 'G' : 'H', IsOper(target_p) ? "*" : "", msptr ? find_status(msptr, fmt->fields || IsCapable(&source, CLICAP_MULTI_PREFIX)) : "");
|
away(user(*target_p)).size()? 'G' : 'H', is(*target_p, umode::OPER) ? "*" : "", msptr ? find_status(msptr, fmt->fields || IsCapable(&source, CLICAP_MULTI_PREFIX)) : "");
|
||||||
|
|
||||||
if (fmt->fields == 0)
|
if (fmt->fields == 0)
|
||||||
sendto_one(&source, form_str(RPL_WHOREPLY), me.name,
|
sendto_one(&source, form_str(RPL_WHOREPLY), me.name,
|
||||||
source.name, msptr ? chan->name.c_str() : "*",
|
source.name, msptr ? chan->name.c_str() : "*",
|
||||||
target_p->username, target_p->host,
|
target_p->username, target_p->host,
|
||||||
target_p->servptr->name, target_p->name, status,
|
target_p->servptr->name, target_p->name, status,
|
||||||
ConfigServerHide.flatten_links && !IsOper(&source) && !is_exempt_shide(source) ? 0 : target_p->hopcount,
|
ConfigServerHide.flatten_links && !is(source, umode::OPER) && !is_exempt_shide(source) ? 0 : target_p->hopcount,
|
||||||
target_p->info);
|
target_p->info);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -501,7 +501,7 @@ do_who(client::client &source, client::client *target_p, chan::chan *chan, chan:
|
||||||
if (fmt->fields & FIELD_FLAGS)
|
if (fmt->fields & FIELD_FLAGS)
|
||||||
append_format(str, sizeof str, &pos, " %s", status);
|
append_format(str, sizeof str, &pos, " %s", status);
|
||||||
if (fmt->fields & FIELD_HOP)
|
if (fmt->fields & FIELD_HOP)
|
||||||
append_format(str, sizeof str, &pos, " %d", ConfigServerHide.flatten_links && !IsOper(&source) && !is_exempt_shide(source) ? 0 : target_p->hopcount);
|
append_format(str, sizeof str, &pos, " %d", ConfigServerHide.flatten_links && !is(source, umode::OPER) && !is_exempt_shide(source) ? 0 : target_p->hopcount);
|
||||||
if (fmt->fields & FIELD_IDLE)
|
if (fmt->fields & FIELD_IDLE)
|
||||||
append_format(str, sizeof str, &pos, " %d", (int)(my(*target_p) ? rb_current_time() - target_p->localClient->last : 0));
|
append_format(str, sizeof str, &pos, " %d", (int)(my(*target_p) ? rb_current_time() - target_p->localClient->last : 0));
|
||||||
if (fmt->fields & FIELD_ACCOUNT)
|
if (fmt->fields & FIELD_ACCOUNT)
|
||||||
|
|
|
@ -70,7 +70,7 @@ m_whois(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!IsOper(&source))
|
if(!is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
/* seeing as this is going across servers, we should limit it */
|
/* seeing as this is going across servers, we should limit it */
|
||||||
if((last_used + ConfigFileEntry.pace_wait_simple) > rb_current_time() || !ratelimit_client(&source, 2))
|
if((last_used + ConfigFileEntry.pace_wait_simple) > rb_current_time() || !ratelimit_client(&source, 2))
|
||||||
|
@ -250,7 +250,7 @@ single_whois(client::client &source, client::client *target_p, int operspy)
|
||||||
hdata.client = &source;
|
hdata.client = &source;
|
||||||
hdata.target = target_p;
|
hdata.target = target_p;
|
||||||
|
|
||||||
if (!IsService(target_p))
|
if (!is(*target_p, umode::SERVICE))
|
||||||
{
|
{
|
||||||
for(const auto &pit : chans(user(*target_p)))
|
for(const auto &pit : chans(user(*target_p)))
|
||||||
{
|
{
|
||||||
|
@ -292,16 +292,16 @@ single_whois(client::client &source, client::client *target_p, int operspy)
|
||||||
sendto_one_numeric(&source, RPL_AWAY, form_str(RPL_AWAY),
|
sendto_one_numeric(&source, RPL_AWAY, form_str(RPL_AWAY),
|
||||||
target_p->name, away(user(*target_p)).c_str());
|
target_p->name, away(user(*target_p)).c_str());
|
||||||
|
|
||||||
if(IsOper(target_p) && (!ConfigFileEntry.hide_opers_in_whois || IsOper(&source)))
|
if(is(*target_p, umode::OPER) && (!ConfigFileEntry.hide_opers_in_whois || is(source, umode::OPER)))
|
||||||
{
|
{
|
||||||
sendto_one_numeric(&source, RPL_WHOISOPERATOR, form_str(RPL_WHOISOPERATOR),
|
sendto_one_numeric(&source, RPL_WHOISOPERATOR, form_str(RPL_WHOISOPERATOR),
|
||||||
target_p->name,
|
target_p->name,
|
||||||
IsService(target_p) ? ConfigFileEntry.servicestring :
|
is(*target_p, umode::SERVICE) ? ConfigFileEntry.servicestring :
|
||||||
(IsAdmin(target_p) ? GlobalSetOptions.adminstring :
|
(is(*target_p, umode::ADMIN) ? GlobalSetOptions.adminstring :
|
||||||
GlobalSetOptions.operstring));
|
GlobalSetOptions.operstring));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(my(*target_p) && !EmptyString(target_p->localClient->opername) && IsOper(&source))
|
if(my(*target_p) && !EmptyString(target_p->localClient->opername) && is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
char buf[512];
|
char buf[512];
|
||||||
snprintf(buf, sizeof(buf), "is opered as %s, privset %s",
|
snprintf(buf, sizeof(buf), "is opered as %s, privset %s",
|
||||||
|
@ -310,7 +310,7 @@ single_whois(client::client &source, client::client *target_p, int operspy)
|
||||||
target_p->name, buf);
|
target_p->name, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsSSLClient(target_p))
|
if(is(*target_p, umode::SSLCLIENT))
|
||||||
{
|
{
|
||||||
char cbuf[256] = "is using a secure connection";
|
char cbuf[256] = "is using a secure connection";
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ single_whois(client::client &source, client::client *target_p, int operspy)
|
||||||
|
|
||||||
sendto_one_numeric(&source, RPL_WHOISSECURE, form_str(RPL_WHOISSECURE),
|
sendto_one_numeric(&source, RPL_WHOISSECURE, form_str(RPL_WHOISSECURE),
|
||||||
target_p->name, cbuf);
|
target_p->name, cbuf);
|
||||||
if((&source == target_p || IsOper(&source)) &&
|
if((&source == target_p || is(source, umode::OPER)) &&
|
||||||
target_p->certfp != NULL)
|
target_p->certfp != NULL)
|
||||||
sendto_one_numeric(&source, RPL_WHOISCERTFP,
|
sendto_one_numeric(&source, RPL_WHOISCERTFP,
|
||||||
form_str(RPL_WHOISCERTFP),
|
form_str(RPL_WHOISCERTFP),
|
||||||
|
@ -328,7 +328,7 @@ single_whois(client::client &source, client::client *target_p, int operspy)
|
||||||
|
|
||||||
if(my(*target_p))
|
if(my(*target_p))
|
||||||
{
|
{
|
||||||
if (is_dyn_spoof(*target_p) && (IsOper(&source) || &source == target_p))
|
if (is_dyn_spoof(*target_p) && (is(source, umode::OPER) || &source == target_p))
|
||||||
{
|
{
|
||||||
/* trick here: show a nonoper their own IP if
|
/* trick here: show a nonoper their own IP if
|
||||||
* dynamic spoofed but not if auth{} spoofed
|
* dynamic spoofed but not if auth{} spoofed
|
||||||
|
@ -366,7 +366,7 @@ single_whois(client::client &source, client::client *target_p, int operspy)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (is_dyn_spoof(*target_p) && (IsOper(&source) || &source == target_p))
|
if (is_dyn_spoof(*target_p) && (is(source, umode::OPER) || &source == target_p))
|
||||||
{
|
{
|
||||||
clear_dyn_spoof(*target_p);
|
clear_dyn_spoof(*target_p);
|
||||||
sendto_one_numeric(&source, RPL_WHOISHOST,
|
sendto_one_numeric(&source, RPL_WHOISHOST,
|
||||||
|
|
|
@ -56,7 +56,7 @@ m_whowas(struct MsgBuf *msgbuf_p, client::client &client, client::client &source
|
||||||
|
|
||||||
static time_t last_used = 0L;
|
static time_t last_used = 0L;
|
||||||
|
|
||||||
if(my(source) && !IsOper(&source))
|
if(my(source) && !is(source, umode::OPER))
|
||||||
{
|
{
|
||||||
if(last_used + (parc > 3 ? ConfigFileEntry.pace_wait :
|
if(last_used + (parc > 3 ? ConfigFileEntry.pace_wait :
|
||||||
ConfigFileEntry.pace_wait_simple
|
ConfigFileEntry.pace_wait_simple
|
||||||
|
|
Loading…
Reference in a new issue