This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

kick message with handle n date

Old posts that have not been replied to for several years.
Locked
A
AW

Post by AW »

hi, i will really appreciate if someone can help me plz, when i type in partyline .kickban nick and at main channel's window it should show like this
Z was kicked by eggdrop(Apr 20, AW: behave plz)
instead of Z was kicked by eggdrop(behave plz)

here are the source code:

static void cmd_kickban(struct userrec *u, int idx, char *par)
{
struct chanset_t *chan;
char *chname, *nick, *s1;
memberlist *m;
char s[UHOSTLEN];
char bantype = 0;

if (!par[0]) {
dprintf(idx, "Usage: kickban [channel] [-|@]<nick> [reason]n");
return;
}
if (strchr(CHANMETA, par[0]) != NULL)
chname = newsplit(&par);
else
chname = 0;
if (!(chan = has_op(idx, chname)))
return;
if (!channel_active(chan)) {
dprintf(idx, "I'm not on %s right now!n", chan->dname);
return;
}
if (!me_op(chan)) {
dprintf(idx, "I can't help you now because I'm not a channel op on %s.n",
chan->dname);
return;
}
putlog(LOG_CMDS, "*", "#%s# (%s) kickban %s", dcc[idx].nick,
chan->dname, par);
nick = newsplit(&par);
if ((nick[0] == '@') || (nick[0] == '-')) {
bantype = nick[0];
nick++;
}
if (match_my_nick(nick)) {
dprintf(idx, "I'm not going to kickban myself.n");
return;
} else {
m = ismember(chan, nick);
if (!m)
dprintf(idx, "%s is not on %sn", nick, chan->dname);
else {
egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
u = get_user_by_host(s);
get_user_flagrec(u, &victim, chan->dname);
if ((chan_op(victim) || (glob_op(victim) && !chan_deop(victim))) &&
!(chan_master(user) || glob_master(user))) {
dprintf(idx, "%s is a legal op.n", nick);
return;
}
if ((chan_master(victim) || glob_master(victim)) &&
!(glob_owner(user) || chan_owner(user))) {
dprintf(idx, "%s is a %s master.n", nick, chan->dname);
return;
}
if (glob_bot(victim) && !(glob_owner(victim) || chan_owner(victim))) {
dprintf(idx, "%s is another channel bot!n", nick);
return;
}
if (use_exempts &&
(u_match_mask(global_exempts,s) || u_match_mask(chan->exempts, s))) {
dprintf(idx, "%s is permanently exempted!n", nick);
return;
}
if (m->flags & CHANOP)
add_mode(chan, '-', 'o', m->nick);
check_exemptlist(chan, s);
switch (bantype) {
case '@':
s1 = strchr(s, '@');
s1 -= 3;
s1[0] = '*';
s1[1] = '!';
s1[2] = '*';
break;
case '-':
s1 = strchr(s, '-');
s1[1] = '*';
s1--;
s1[0] = '*';
break;
default:
s1 = quickban(chan, m->userhost);
break;
}
if (bantype == '@' || bantype == '-')
do_mask(chan, chan->channel.ban, s1, 'b');
if (!par[0])
par = "requested";
dprintf(DP_SERVER, "KICK %s %s :%sn", chan->name, m->nick, par);
m->flags |= SENTKICK;
u_addban(chan, s1, dcc[idx].nick, par, now + (60 * ban_time), 0);
dprintf(idx, "Okay, done.n");
}
}
}

P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

why bother messing with the source when its much easier just to rewrite the kickban command in tcl?
A
AW

Post by AW »

true, but i couldn't find any tcl script work for dcc and public, showing handle n date in a kickmsg, like z was kicked by eggy(Apr 20 AW: be nice plzz), i mean if i can use .kickban nick in dcc, same command for public, can u help me plz? i will appreciate it.
Locked