return;
FOREACH_MOD(I_OnChangeName,OnChangeName(user,gecos));
}
- strlcpy(user->fullname,gecos,MAXBUF);
+ strlcpy(user->fullname,gecos,MAXGECOS+1);
}
void ChangeDisplayedHost(userrec* user, const char* host)
return "";
}
+int cflags(userrec *user, chanrec *chan)
+{
+ if ((!chan) || (!user))
+ return 0;
+
+ for (unsigned int i = 0; i < user->chans.size(); i++)
+ {
+ if (user->chans[i].channel)
+ {
+ if ((!strcasecmp(user->chans[i].channel->name,chan->name)) && (chan != NULL))
+ {
+ return user->chans[i].uc_modes;
+ }
+ }
+ }
+ return 0;
+}
+
/* returns the status value for a given user on a channel, e.g. STATUS_OP for
* op, STATUS_VOICE for voice etc. If the user has several modes set, the
* highest mode the user has must be returned. */
pos_of_pling++;
pos_of_at++;
- strlcpy(NICK,temp,NICKMAX);
+ strlcpy(NICK,temp,NICKMAX-1);
strlcpy(IDENT,pos_of_pling,IDENTMAX+1);
strlcpy(HOST,pos_of_at,160);
{
return lst;
}
+ bool userinvisible = (strchr(user->modes,'i'));
for (unsigned int i = 0; i < user->chans.size(); i++)
{
if (user->chans[i].channel != NULL)
cmp = std::string(user->chans[i].channel->name) + " ";
if (!strstr(lst.c_str(),cmp.c_str()))
{
- // if the channel is NOT private/secret, OR the source user is on the channel
- if (((!(user->chans[i].channel->binarymodes & CM_PRIVATE)) && (!(user->chans[i].channel->binarymodes & CM_SECRET))) || (has_channel(source,user->chans[i].channel)))
+ // if the channel is NOT private/secret, OR the source user is on the channel, AND the user is not invisible.
+ // if the user is the same as the source, shortcircuit the comparison.
+ if ((source == user) || ((((!(user->chans[i].channel->binarymodes & CM_PRIVATE)) && (!(user->chans[i].channel->binarymodes & CM_SECRET)) && (!userinvisible)) || (has_channel(source,user->chans[i].channel)))))
{
lst = lst + std::string(cmode(user,user->chans[i].channel)) + std::string(user->chans[i].channel->name) + " ";
}