summaryrefslogtreecommitdiff
path: root/src/ratbox.c
diff options
context:
space:
mode:
authortrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-01-27 06:10:08 +0000
committertrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-01-27 06:10:08 +0000
commitf91057c662063d215296b92f3fcf59536fb85e4c (patch)
tree0065c0f85f3b16a7e0bfcba5f3c280964d23f3f9 /src/ratbox.c
parent01f32cf2881f781fa934623361a146e55fcca8b6 (diff)
BUILD : 1.7.7 (556) BUGS : N/A NOTES : synced headers so our copyright is 2005, Solid IRCD compiles again, fixed sstrdup() error, updated the documentation a bit, cleaned up ratbox a bit.
git-svn-id: svn://svn.anope.org/anope/trunk@556 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@409 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/ratbox.c')
-rw-r--r--src/ratbox.c65
1 files changed, 20 insertions, 45 deletions
diff --git a/src/ratbox.c b/src/ratbox.c
index 746ed8adb..2c0891395 100644
--- a/src/ratbox.c
+++ b/src/ratbox.c
@@ -1,6 +1,6 @@
/* Ratbox IRCD functions
*
- * (C) 2003 Anope Team
+ * (C) 2003-2005 Anope Team
* Contact us at info@anope.org
*
* Please read COPYING and README for furhter details.
@@ -107,6 +107,7 @@ IRCDVar ircd[] = {
NULL, /* vhost char */
1, /* ts6 */
0, /* support helper umode */
+ 0, /* p10 */
}
,
{NULL}
@@ -849,19 +850,9 @@ void anope_cmd_join(char *user, char *channel, time_t chantime)
{
Uid *ud;
- if (UseTS6) {
- ud = find_uid(user);
- if (ud) {
- send_cmd(NULL, "SJOIN %ld %s + :%s", (long int) time(NULL),
- channel, ud->uid);
- } else {
- send_cmd(NULL, "SJOIN %ld %s + :%s", (long int) time(NULL),
- channel, user);
- }
- } else {
- send_cmd(NULL, "SJOIN %ld %s + :%s", (long int) time(NULL),
- channel, user);
- }
+ ud = find_uid(user);
+ send_cmd(NULL, "SJOIN %ld %s + :%s", (long int) time(NULL),
+ channel, (UseTS6 ? (ud ? ud->uid : user) : user));
}
/*
@@ -876,7 +867,12 @@ reason: the reason for the kline.
void anope_cmd_akill(char *user, char *host, char *who, time_t when,
time_t expires, char *reason)
{
- send_cmd(s_OperServ, "KLINE * %ld %s %s :%s",
+ Uid *ud;
+
+ ud = find_uid(s_OperServ);
+
+ send_cmd((UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ),
+ "KLINE * %ld %s %s :%s",
(long int) (expires - (long) time(NULL)), user, host, reason);
}
@@ -901,17 +897,10 @@ void anope_cmd_svskill(char *source, char *user, const char *fmt, ...)
return;
}
- if (UseTS6) {
- ud = find_uid(source);
- ud2 = find_uid(user);
- if (ud && ud2) {
- send_cmd(ud->uid, "KILL %s :%s", ud2->uid, buf);
- } else {
- send_cmd(source, "KILL %s :%s", user, buf);
- }
- } else {
- send_cmd(source, "KILL %s :%s", user, buf);
- }
+ ud = find_uid(source);
+ ud2 = find_uid(user);
+ send_cmd((UseTS6 ? (ud ? ud->uid : source) : source), "KILL %s :%s",
+ (UseTS6 ? (ud2 ? ud2->uid : user) : user), buf);
}
void anope_cmd_svsmode(User * u, int ac, char **av)
@@ -1113,17 +1102,10 @@ int anope_event_privmsg(char *source, int ac, char **av)
return MOD_CONT;
}
- if (UseTS6) {
- u = find_byuid(source);
- ud = find_nickuid(av[0]);
- if (u) {
- m_privmsg(u->nick, (ud ? ud->nick : av[0]), av[1]);
- } else {
- m_privmsg(source, av[0], av[1]);
- }
- } else {
- m_privmsg(source, av[0], av[1]);
- }
+ u = find_byuid(source);
+ ud = find_nickuid(av[0]);
+ m_privmsg((UseTS6 ? (u ? u->nick : source) : source),
+ (UseTS6 ? (ud ? ud->nick : av[0]) : av[0]), av[1]);
return MOD_CONT;
}
@@ -1174,9 +1156,6 @@ int anope_event_sid(char *source, int ac, char **av)
/* :42X SID trystan.nomadirc.net 2 43X :ircd-ratbox test server */
- /* do_server(const char *source, char *servername, char *hops,
- char *descript, char *numeric) */
-
s = findserver_uid(servlist, source);
do_server(s->name, av[0], av[1], av[3], av[2]);
@@ -1201,11 +1180,7 @@ int anope_event_quit(char *source, int ac, char **av)
u = find_byuid(source);
- if (UseTS6 && u) {
- do_quit(u->nick, ac, av);
- } else {
- do_quit(source, ac, av);
- }
+ do_quit((UseTS6 ? (u ? u->nick : source) : source), ac, av);
return MOD_CONT;
}