neozeed ircu2.9.32-linux-hacks.diff

This commit is contained in:
2023-12-26 16:42:36 -05:00
parent ab64084f63
commit 51650c0d78
40 changed files with 718 additions and 720 deletions

View File

@@ -204,7 +204,7 @@ char *banid;
!match(banid, ban->value.ban.banstr))
return -1;
}
else if (!mycmp(ban->value.ban.banstr, banid))
else if (!strcasecmp(ban->value.ban.banstr, banid))
return -1;
}
@@ -235,7 +235,7 @@ char *banid;
if (!banid)
return -1;
for (ban = &(chptr->banlist); *ban; ban = &((*ban)->next))
if (mycmp(banid, (*ban)->value.ban.banstr)==0)
if (strcasecmp(banid, (*ban)->value.ban.banstr)==0)
{
tmp = *ban;
*ban = tmp->next;
@@ -428,10 +428,10 @@ aChannel *chptr;
member = IsMember(cptr, chptr);
lp = find_user_link(chptr->members, cptr);
if ((!lp || !(lp->flags & (CHFL_CHANOP|CHFL_VOICE)) ||
(lp->flags & CHFL_ZOMBIE)) && MyClient(cptr) &&
is_banned(cptr, chptr))
return (MODE_BAN);
if ((!lp || !(lp->flags & (CHFL_CHANOP|CHFL_VOICE)) ||
(lp->flags & CHFL_ZOMBIE)) && MyClient(cptr) &&
is_banned(cptr, chptr))
return (MODE_BAN);
if (chptr->mode.mode & MODE_MODERATED &&
(!lp || !(lp->flags & (CHFL_CHANOP|CHFL_VOICE)) ||
@@ -489,6 +489,27 @@ aChannel *chptr;
return;
}
static inline int DoesOp(modebuf)
char *modebuf;
{
modebuf--; /* Is it possible that a mode starts with o and not +o ? */
while (*++modebuf) if (*modebuf=='o' || *modebuf=='v') return(1);
return 0;
}
static void sendmodeto_one(cptr, from, name, mode, param, creationtime)
Reg2 aClient *cptr;
char *from,*name,*mode,*param;
time_t creationtime;
{
if (IsServer(cptr) && DoesOp(mode) && creationtime)
sendto_one(cptr,":%s MODE %s %s %s %lu",
from, name, mode, param, creationtime);
else
sendto_one(cptr,":%s MODE %s %s %s",
from, name, mode, param);
}
static int send_mode_list(cptr, chname, creationtime, top, mask, flag)
aClient *cptr;
Link *top;
@@ -679,27 +700,6 @@ char *parv[];
return 0;
}
int DoesOp(modebuf)
char *modebuf;
{
modebuf--; /* Is it possible that a mode starts with o and not +o ? */
while (*++modebuf) if (*modebuf=='o' || *modebuf=='v') return(1);
return 0;
}
int sendmodeto_one(cptr, from, name, mode, param, creationtime)
Reg2 aClient *cptr;
char *from,*name,*mode,*param;
time_t creationtime;
{
if (IsServer(cptr) && DoesOp(mode) && creationtime)
sendto_one(cptr,":%s MODE %s %s %s %lu",
from, name, mode, param, creationtime);
else
sendto_one(cptr,":%s MODE %s %s %s",
from, name, mode, param);
}
char *pretty_mask(mask)
char *mask;
{ Reg1 char *cp;
@@ -739,7 +739,7 @@ char *parv[], *mbuf, *pbuf;
Link *member, *tmp = NULL;
u_int whatt = MODE_ADD, bwhatt = 0;
int limitset = 0, chasing = 0, bounce;
int nusers, new, len, blen, keychange = 0, opcnt = 0, banlsent = 0;
int nusers = 0, new, len, blen, keychange = 0, opcnt = 0, banlsent = 0;
int doesdeop = 0, doesop = 0, hacknotice = 0, change, gotts = 0;
char fm = '\0';
aClient *who;
@@ -888,7 +888,7 @@ char *parv[], *mbuf, *pbuf;
}
else if (whatt == MODE_DEL)
{
if (mycmp(mode->key, *parv) == 0 ||
if (strcasecmp(mode->key, *parv) == 0 ||
IsServer(cptr))
{
lp = &chops[opcnt++];
@@ -968,7 +968,7 @@ char *parv[], *mbuf, *pbuf;
break;
case 'i' : /* falls through for default case */
if (whatt == MODE_DEL)
while (lp = chptr->invites)
while ((lp = chptr->invites))
del_invite(lp->value.cptr, chptr);
default:
for (ip = flags; *ip; ip += 2)
@@ -1128,7 +1128,7 @@ char *parv[], *mbuf, *pbuf;
Reg1 int i = 0;
Reg2 char c;
char *user, *host;
u_int prev_whatt;
u_int prev_whatt = 0;
for (; i < opcnt; i++)
{
@@ -1136,7 +1136,7 @@ char *parv[], *mbuf, *pbuf;
/*
* make sure we have correct mode change sign
*/
if (whatt != (lp->flags & (MODE_ADD|MODE_DEL)))
if (whatt != (lp->flags & (MODE_ADD|MODE_DEL))) {
if (lp->flags & MODE_ADD)
{
*mbuf++ = '+';
@@ -1149,6 +1149,7 @@ char *parv[], *mbuf, *pbuf;
prev_whatt = whatt;
whatt = MODE_DEL;
}
}
len = strlen(pbuf);
/*
* get c as the mode char and tmp as a pointer to
@@ -1185,6 +1186,8 @@ char *parv[], *mbuf, *pbuf;
*cp = '\0';
cp = numeric;
break;
default:
return -1;
}
if (len + strlen(cp) + 12 > (size_t) MODEBUFLEN)
@@ -1195,7 +1198,7 @@ char *parv[], *mbuf, *pbuf;
if (strlen(cp) > (size_t) KEYLEN)
*(cp+KEYLEN) = '\0';
if ((whatt == MODE_ADD && (*mode->key=='\0' ||
mycmp(mode->key,cp)!=0)) ||
strcasecmp(mode->key,cp)!=0)) ||
(whatt == MODE_DEL && (*mode->key!='\0')))
{ if (bounce)
{ if (*mode->key=='\0')
@@ -1326,10 +1329,10 @@ char *parv[], *mbuf, *pbuf;
* effect.
*/
if (*badop!=2 &&
((whatt & MODE_ADD) &&
!add_banid(sptr, chptr, cp) ||
(whatt & MODE_DEL) &&
!del_banid(chptr, cp)))
(((whatt & MODE_ADD) &&
!add_banid(sptr, chptr, cp)) ||
((whatt & MODE_DEL) &&
!del_banid(chptr, cp))))
{
*mbuf++ = c;
(void)strcat(pbuf, cp);
@@ -1734,8 +1737,9 @@ char *parv[];
if (!zombie)
{ if (!MyConnect(sptr)) flags = CHFL_DEOPPED;
if (sptr->flags & FLAGS_TS8) flags|=CHFL_SERVOPOK; }
if (!chptr ||
(MyConnect(sptr) && (i = can_join(sptr, chptr, keys))))
if (!chptr)
continue;
if ((MyConnect(sptr) && (i = can_join(sptr, chptr, keys))))
/* only a variable change key->keys, just because it's better */
{
/* we have the error str in s_err.c, so USE it! -Kev */
@@ -1963,8 +1967,8 @@ char *parv[];
parv[0], user, chptr->chname);
continue;
}
if ((lp=find_user_link(chptr->members, who)) &&
!(lp->flags & CHFL_ZOMBIE) || IsServer(sptr))
if (((lp=find_user_link(chptr->members, who)) &&
!(lp->flags & CHFL_ZOMBIE)) || IsServer(sptr))
{
if (who->from!=cptr &&
((lp2 && (lp2->flags & CHFL_DEOPPED)) ||
@@ -2263,7 +2267,7 @@ char *parv[];
defparc = 1;
defparv[defparc++] = t = strtok(s, " ");
while (t && defparc < MAXPARA) {
if (t = strtok(NULL, " "))
if ((t = strtok(NULL, " ")))
defparv[defparc++] = t;
}
}
@@ -2409,6 +2413,7 @@ char *parv[];
{
if (max_users > min_users + 1 && max_time > min_time &&
max_topic_time > min_topic_time) /* Sanity check */
{
for (chptr = channel; chptr; chptr = chptr->nextch)
{
if (!sptr->user ||
@@ -2426,6 +2431,7 @@ char *parv[];
chptr->users,
ShowChannel(sptr, chptr)?chptr->topic:"");
}
}
sendto_one(sptr, rpl_str(RPL_LISTEND), me.name, parv[0]);
return 0;
}
@@ -2581,7 +2587,7 @@ char *parv[];
aChannel *ch3ptr;
int showflag = 0, secret = 0;
if (!IsPerson(c2ptr) || sptr!=c2ptr && IsInvisible(c2ptr))
if (!IsPerson(c2ptr) || (sptr!=c2ptr && IsInvisible(c2ptr)))
continue;
lp = c2ptr->user->channel;
/*