summaryrefslogtreecommitdiff
path: root/src/channels.c
diff options
context:
space:
mode:
authorcertus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-01-24 07:54:48 +0000
committercertus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-01-24 07:54:48 +0000
commit4a54fdec5e6becedc49a90f2bee7e391e3bfe64c (patch)
tree9c68cf3e766f81d51f2ba43d2444df9ef6d7b2e0 /src/channels.c
parent0dc104f20dcfa3dbdf301949a4c01d2f38c02687 (diff)
git-svn-id: svn://svn.anope.org/anope/trunk@957 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@684 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/channels.c')
-rw-r--r--src/channels.c78
1 files changed, 13 insertions, 65 deletions
diff --git a/src/channels.c b/src/channels.c
index 34ad2cfd1..f1add79e3 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -523,13 +523,9 @@ void do_join(const char *source, int ac, char **av)
Channel *chan;
char *s, *t;
struct u_chanlist *c, *nextc;
- char *channame;
if (UseTS6 && ircd->ts6) {
user = find_byuid(source);
- if (!user) {
- user = finduser(source);
- }
} else {
user = finduser(source);
}
@@ -555,12 +551,8 @@ void do_join(const char *source, int ac, char **av)
c = user->chans;
while (c) {
nextc = c->next;
- channame = sstrdup(c->chan->name);
- send_event(EVENT_PART_CHANNEL, 3, EVENT_START, user->nick, channame);
chan_deluser(user, c->chan);
- send_event(EVENT_PART_CHANNEL, 3, EVENT_STOP, user->nick, channame);
free(c);
- free(channame);
c = nextc;
}
user->chans = NULL;
@@ -595,7 +587,6 @@ void do_kick(const char *source, int ac, char **av)
User *user;
char *s, *t;
struct u_chanlist *c;
- char *channame;
t = av[1];
while (*(s = t)) {
@@ -628,14 +619,15 @@ void do_kick(const char *source, int ac, char **av)
continue;
}
if (debug) {
- alog("debug: kicking %s from %s", user->nick, av[0]);
+ if (UseTS6 && ircd->ts6) {
+ alog("debug: kicking %s from %s", user->nick, av[0]);
+ } else {
+ alog("debug: kicking %s from %s", s, av[0]);
+ }
}
for (c = user->chans; c && stricmp(av[0], c->chan->name) != 0;
c = c->next);
if (c) {
- channame = sstrdup(c->chan->name);
- send_event(EVENT_CHAN_KICK, 3, EVENT_START, user->nick,
- channame);
chan_deluser(user, c->chan);
if (c->next)
c->next->prev = c->prev;
@@ -644,9 +636,6 @@ void do_kick(const char *source, int ac, char **av)
else
user->chans = c->next;
free(c);
- send_event(EVENT_CHAN_KICK, 3, EVENT_STOP, user->nick,
- channame);
- free(channame);
}
}
}
@@ -665,14 +654,7 @@ void do_part(const char *source, int ac, char **av)
struct u_chanlist *c;
char *channame;
- if (UseTS6 && ircd->ts6) {
- user = find_byuid(source);
- if (!user) {
- user = finduser(source);
- }
- } else {
- user = finduser(source);
- }
+ user = finduser(source);
if (!user) {
if (debug) {
alog("debug: PART from nonexistent user %s: %s", source,
@@ -828,14 +810,10 @@ void do_sjoin(const char *source, int ac, char **av)
if (UseTS6 && ircd->ts6) {
- user = find_byuid(s);
- if (!user) {
- user = finduser(s);
- }
+ user = find_byuid(s);
} else {
- user = finduser(s);
+ user = finduser(s);
}
-
if (!user) {
if (debug) {
alog("debug: SJOIN for nonexistent user %s on %s", s,
@@ -916,14 +894,7 @@ void do_sjoin(const char *source, int ac, char **av)
*end2++ = csmodes[(int) *s++];
*end2 = 0;
- if (UseTS6 && ircd->ts6) {
- user = find_byuid(s);
- if (!user) {
- user = finduser(s);
- }
- } else {
- user = finduser(s);
- }
+ user = finduser(s);
if (!user) {
if (debug) {
@@ -998,12 +969,9 @@ void do_sjoin(const char *source, int ac, char **av)
*end2 = 0;
if (UseTS6 && ircd->ts6) {
- user = find_byuid(s);
- if (!user) {
- user = finduser(s);
- }
+ user = find_byuid(s);
} else {
- user = finduser(s);
+ user = finduser(s);
}
if (!user) {
if (debug) {
@@ -1056,12 +1024,9 @@ void do_sjoin(const char *source, int ac, char **av)
free(s);
} else if (ac == 2) {
if (UseTS6 && ircd->ts6) {
- user = find_byuid(source);
- if (!user) {
- user = finduser(source);
- }
+ user = find_byuid(source);
} else {
- user = finduser(source);
+ user = finduser(source);
}
if (!user) {
if (debug) {
@@ -1288,14 +1253,6 @@ void add_ban(Channel * chan, char *mask)
void add_exception(Channel * chan, char *mask)
{
- /* check for NULL values otherwise we will segfault */
- if (!chan || !mask) {
- if (debug) {
- alog("debug: add_ban called with NULL values");
- }
- return;
- }
-
if (chan->exceptcount >= chan->exceptsize) {
chan->exceptsize += 8;
chan->excepts =
@@ -1311,14 +1268,6 @@ void add_exception(Channel * chan, char *mask)
void add_invite(Channel * chan, char *mask)
{
- /* check for NULL values otherwise we will segfault */
- if (!chan || !mask) {
- if (debug) {
- alog("debug: add_ban called with NULL values");
- }
- return;
- }
-
if (chan->invitecount >= chan->invitesize) {
chan->invitesize += 8;
chan->invite =
@@ -1895,7 +1844,6 @@ void do_mass_mode(char *modes)
}
}
}
- free(myModes);
}
/*************************************************************************/