1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-25 03:36:37 +02:00

- Remove sendto_channelprefix_butone_tok().

This commit is contained in:
William Pitcock
2013-05-19 20:59:29 +00:00
parent ec440be9a3
commit a9ce94de9b
2 changed files with 0 additions and 83 deletions
-81
View File
@@ -366,87 +366,6 @@ void sendto_channelprefix_butone(aClient *one, aClient *from, aChannel *chptr,
return;
}
void sendto_channelprefix_butone_tok(aClient *one, aClient *from, aChannel *chptr,
int prefix,
char *cmd, char *tok, char *nick, char *text, char do_send_check)
{
Member *lp;
aClient *acptr;
int i;
char is_ctcp = 0;
unsigned int tlen, clen, xlen, wlen = 0;
char *p;
/* For servers with token capability */
p = ircsprintf(tcmd, ":%s %s %s :%s", from->name, tok, nick, text);
tlen = (int)(p - tcmd);
ADD_CRLF(tcmd, tlen);
/* For dumb servers without tokens */
p = ircsprintf(ccmd, ":%s %s %s :%s", from->name, cmd, nick, text);
clen = (int)(p - ccmd);
ADD_CRLF(ccmd, clen);
/* For our users... */
if (IsPerson(from))
p = ircsprintf(xcmd, ":%s!%s@%s %s %s :%s",
from->name, from->user->username, GetHost(from), cmd, nick, text);
else
p = ircsprintf(xcmd, ":%s %s %s :%s", from->name, cmd, nick, text);
xlen = (int)(p - xcmd);
ADD_CRLF(xcmd, xlen);
if (do_send_check && *text == 1 && myncmp(text+1,"ACTION ",7) && myncmp(text+1,"DCC ",4))
is_ctcp = 1;
++current_serial;
for (lp = chptr->members; lp; lp = lp->next)
{
acptr = lp->cptr;
if (acptr->from == one)
continue; /* ...was the one I should skip
or user not not a channel op */
if (prefix == PREFIX_ALL)
goto good;
if ((prefix & PREFIX_HALFOP) && (lp->flags & CHFL_HALFOP))
goto good;
if ((prefix & PREFIX_VOICE) && (lp->flags & CHFL_VOICE))
goto good;
if ((prefix & PREFIX_OP) && (lp->flags & CHFL_CHANOP))
goto good;
#ifdef PREFIX_AQ
if ((prefix & PREFIX_ADMIN) && (lp->flags & CHFL_CHANPROT))
goto good;
if ((prefix & PREFIX_OWNER) && (lp->flags & CHFL_CHANOWNER))
goto good;
#endif
continue;
good:
if (IsDeaf(acptr) && !sendanyways)
continue;
if (MyConnect(acptr) && IsRegisteredUser(acptr))
{
if (IsNoCTCP(acptr) && !IsOper(from) && is_ctcp)
continue;
sendbufto_one(acptr, xcmd, xlen);
}
else
{
/* Now check whether a message has been sent to this
* remote link already */
if (acptr->from->serial != current_serial)
{
sendbufto_one(acptr, ccmd, clen);
acptr->from->serial = current_serial;
}
}
}
return;
}
/* weird channelmode +mu crap:
* - local: deliver msgs to chanops (and higher) like <IRC> SrcNick: hi all
* - remote: deliver msgs to every server once (if needed) with real sourcenick.