user->chans.push_back(a);
return c;
}
- else if (strchr(user->modes,'o'))
+ else if (*user->oper)
{
/* Oper allows extension up to the OPERMAXCHANS value */
if (user->chans.size() < OPERMAXCHANS)
if (!flagstate[0])
strcpy(flagstate," <no flags>");
strlcpy(modulename,Config->module_names[i].c_str(),256);
- if (strchr(user->modes,'o'))
+ if (*user->oper)
{
if ((pcnt >= 2) && (!strcasecmp(parameters[0],"debug")))
{
/* correct oper credentials */
WriteOpers("*** %s (%s@%s) is now an IRC operator of type %s",user->nick,user->ident,user->host,OperType);
WriteServ(user->fd,"381 %s :You are now an IRC operator of type %s",user->nick,OperType);
- if (!strchr(user->modes,'o'))
+ if (!*user->oper)
{
strcat(user->modes,"o");
WriteServ(user->fd,"MODE %s :+o",user->nick);
int idx = 0;
for (user_hash::iterator i = clientlist.begin(); i != clientlist.end(); i++)
{
- if (strchr(i->second->modes,'o'))
+ if (*i->second->oper)
{
WriteServ(user->fd,"249 %s :%s (%s@%s) Idle: %d",user->nick,i->second->nick,i->second->ident,i->second->dhost,(TIME - i->second->idle_lastmsg));
idx++;
{
if (isnick(i->second->nick))
{
- if (strchr(i->second->modes,'o'))
+ if (*i->second->oper)
{
WriteServ(user->fd,"205 %s :Oper 0 %s",user->nick,i->second->nick);
}
} else {
strlcat(tmp, "H", 9);
}
- if (strchr(i->second->modes,'o')) { strlcat(tmp, "*", 9); }
+ if (*i->second->oper) { strlcat(tmp, "*", 9); }
WriteServ(user->fd,"352 %s %s %s %s %s %s %s :0 %s",user->nick, Ptr ? Ptr->name : "*", i->second->ident, i->second->dhost, i->second->server, i->second->nick, tmp, i->second->fullname);
if (n_list++ > Config->MaxWhoResults)
{
} else {
strlcat(tmp, "H", 9);
}
- if (strchr(i->second->modes,'o')) { strlcat(tmp, "*", 9); }
+ if (*i->second->oper) { strlcat(tmp, "*", 9); }
strlcat(tmp, cmode(i->second, Ptr),5);
WriteServ(user->fd,"352 %s %s %s %s %s %s %s :0 %s",user->nick, Ptr->name, i->second->ident, i->second->dhost, i->second->server, i->second->nick, tmp, i->second->fullname);
n_list++;
} else {
strlcat(tmp, "H" ,9);
}
- if (strchr(u->modes,'o')) { strlcat(tmp, "*" ,9); }
+ if (*u->oper) { strlcat(tmp, "*" ,9); }
WriteServ(user->fd,"352 %s %s %s %s %s %s %s :0 %s",user->nick, u->chans.size() && u->chans[0].channel ? u->chans[0].channel->name
: "*", u->ident, u->dhost, u->server, u->nick, tmp, u->fullname);
}
return;
}
}
- if ((user->registered == 7) && (!strchr(user->modes,'o')))
+ if ((user->registered == 7) && (!*user->oper))
{
std::stringstream dcmds(Config->DisabledCommands);
while (!dcmds.eof())
if (dest->registered == 7)
{
WriteServ(user->fd,"311 %s %s %s %s * :%s",user->nick, dest->nick, dest->ident, dest->dhost, dest->fullname);
- if ((user == dest) || (strchr(user->modes,'o')))
+ if ((user == dest) || (*user->oper))
{
WriteServ(user->fd,"378 %s %s :is connecting from *@%s %s",user->nick, dest->nick, dest->host, (char*)inet_ntoa(dest->ip4));
}
{
WriteServ(user->fd,"301 %s %s :%s",user->nick, dest->nick, dest->awaymsg);
}
- if (strchr(dest->modes,'o'))
+ if (*dest->oper)
{
- if (*dest->oper)
- {
- WriteServ(user->fd,"313 %s %s :is %s %s on %s",user->nick, dest->nick, (strchr("aeiou",dest->oper[0]) ? "an" : "a"),dest->oper, Config->Network);
- }
- else
- {
- WriteServ(user->fd,"313 %s %s :is an IRC operator",user->nick, dest->nick);
- }
+ WriteServ(user->fd,"313 %s %s :is %s %s on %s",user->nick, dest->nick, (strchr("aeiou",*dest->oper) ? "an" : "a"),dest->oper, Config->Network);
}
if ((!signon) && (!idle))
{
chanrec* curr = user->chans[i].channel;
if (curr->IsCustomModeSet('N'))
{
- if (!strchr(user->modes,'o'))
+ if (!*user->oper)
{
// don't allow the nickchange, theyre on at least one channel with +N set
// and theyre not an oper
{
chanrec* chan = (chanrec*)target;
- if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server)) || (!*user->server) || (strchr(user->modes,'o')))
+ if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server)) || (!*user->server) || (*user->oper))
{
log(DEBUG,"Allowing mode +O");
return 1;
virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
{
- if (!strchr(user->modes,'o'))
+ if (!*user->oper)
{
if (chan)
{
{
long dest_level = 0,source_level = 0;
// oper killing an oper?
- if (strchr(dest->modes,'o'))
+ if (*dest->oper)
{
for (int j =0; j < conf->Enumerate("type"); j++)
{
virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
{
- if (strchr(user->modes,'o'))
+ if (*user->oper)
{
if (chan)
{
{
irc::string x = cname;
// user is not an oper and its not in the allow list
- if ((!strchr(user->modes,'o')) && (allowchans.find(x) == allowchans.end()))
+ if ((!*user->oper) && (allowchans.find(x) == allowchans.end()))
{
// channel does not yet exist (record is null, about to be created IF we were to allow it)
if (!chan)
if (target_type == TYPE_USER)
{
userrec* u = (userrec*)dest;
- if ((strchr(u->modes,'o')) || (strchr(user->modes,'o')))
+ if (*u->oper || *user->oper)
{
// message allowed if:
// (1) the sender is opered
userrec *u = Find(parameters[i]);
if (u)
{
- snprintf(junk,MAXBUF,"%s%s=+%s@%s ",u->nick,strchr(u->modes,'o') ? "*" : "",u->ident,(char*)inet_ntoa(u->ip4));
+ snprintf(junk,MAXBUF,"%s%s=+%s@%s ",u->nick,*u->oper ? "*" : "",u->ident,(char*)inet_ntoa(u->ip4));
strlcat(Return,junk,MAXBUF);
}
}
return true;
// are they even an oper at all?
- if (strchr(this->modes,'o'))
+ if (*this->oper)
{
for (int j =0; j < Config->ConfValueEnum("type",&Config->config_f); j++)
{