summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-15 02:57:50 +0000
committerNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-15 02:57:50 +0000
commiteef1d4d691e8b7c4c80763dcd1e0c97b11350be0 (patch)
treec23b2417b1b7402563abf410f4cbdbedf49d1425
parent29a074878d72f789f9a7eacb6b17e2e97b33fdd0 (diff)
Merge branch 'anopeng-config' of http://git.inspircd.org/git/anope/ into anopeng-config
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1449 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--data/tables.sql1
-rw-r--r--include/services.h56
-rw-r--r--src/chanserv.c3
-rw-r--r--src/core/cs_register.c6
-rw-r--r--src/core/cs_set.c3
-rw-r--r--src/core/ns_register.c3
-rw-r--r--src/mysql.c13
-rw-r--r--src/nickserv.c8
-rw-r--r--src/tools/db-merger.c3
9 files changed, 19 insertions, 77 deletions
diff --git a/data/tables.sql b/data/tables.sql
index 2d4889cb5..f02f1d1c3 100644
--- a/data/tables.sql
+++ b/data/tables.sql
@@ -272,7 +272,6 @@ CREATE TABLE anope_ns_core (
memocount smallint(5) unsigned NOT NULL default '0',
memomax smallint(5) unsigned NOT NULL default '0',
channelcount smallint(5) unsigned NOT NULL default '0',
- channelmax smallint(5) unsigned NOT NULL default '0',
greet text NOT NULL,
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (nc_id),
diff --git a/include/services.h b/include/services.h
index c8d9af8ac..5a6bcc8a2 100644
--- a/include/services.h
+++ b/include/services.h
@@ -227,9 +227,6 @@ typedef struct c_elist EList;
typedef struct c_elist_entry Entry;
typedef struct ModuleData_ ModuleData; /* ModuleData struct */
typedef struct memo_ Memo;
-typedef struct nickrequest_ NickRequest;
-typedef struct nickalias_ NickAlias;
-typedef struct nickcore_ NickCore;
typedef struct chaninfo_ ChannelInfo;
typedef struct badword_ BadWord;
typedef struct bandata_ BanData;
@@ -462,59 +459,12 @@ typedef struct {
Memo *memos;
} MemoInfo;
-/*************************************************************************/
-
-/* NickServ nickname structures. */
-
-
-struct nickrequest_ {
- NickRequest *next, *prev;
- char *nick;
- char *passcode;
- char password[PASSMAX];
- char *email;
- time_t requested;
- time_t lastmail; /* Unsaved */
-};
-struct nickalias_ {
- NickAlias *next, *prev;
- char *nick; /* Nickname */
- char *last_quit; /* Last quit message */
- char *last_realname; /* Last realname */
- char *last_usermask; /* Last usermask */
- time_t time_registered; /* When the nick was registered */
- time_t last_seen; /* When it was seen online for the last time */
- uint16 status; /* See NS_* below */
- NickCore *nc; /* I'm an alias of this */
- /* Not saved */
- ModuleData *moduleData; /* Module saved data attached to the nick alias */
- User *u; /* Current online user that has me */
-};
-struct nickcore_ {
- NickCore *next, *prev;
-
- char *display; /* How the nick is displayed */
- char pass[PASSMAX]; /* Password of the nicks */
- char *email; /* E-mail associated to the nick */
- char *greet; /* Greet associated to the nick */
- uint32 icq; /* ICQ # associated to the nick */
- char *url; /* URL associated to the nick */
- uint32 flags; /* See NI_* below */
- uint16 language; /* Language selected by nickname owner (LANG_*) */
- uint16 accesscount; /* # of entries */
- char **access; /* Array of strings */
- MemoInfo memos;
- uint16 channelcount; /* Number of channels currently registered */
- uint16 channelmax; /* Maximum number of channels allowed */
-
- /* Unsaved data */
- ModuleData *moduleData; /* Module saved data attached to the NickCore */
- time_t lastmail; /* Last time this nick record got a mail */
- SList aliases; /* List of aliases */
-};
+/*************************************************************************/
+// For NickServ
+#include "account.h"
/*************************************************************************/
diff --git a/src/chanserv.c b/src/chanserv.c
index b3812dc1c..598982cd9 100644
--- a/src/chanserv.c
+++ b/src/chanserv.c
@@ -1574,8 +1574,7 @@ void cs_remove_nick(const NickCore * nc)
if (ci->founder == nc) {
if (ci->successor) {
NickCore *nc2 = ci->successor;
- if (!nick_is_services_admin(nc2) && nc2->channelmax > 0
- && nc2->channelcount >= nc2->channelmax) {
+ if (!nick_is_services_admin(nc2) && CSMaxReg && nc2->channelcount >= CSMaxReg) {
alog("%s: Successor (%s) of %s owns too many channels, " "deleting channel", s_ChanServ, nc2->display, ci->name);
delchan(ci);
continue;
diff --git a/src/core/cs_register.c b/src/core/cs_register.c
index c553a63a4..713500e99 100644
--- a/src/core/cs_register.c
+++ b/src/core/cs_register.c
@@ -116,11 +116,9 @@ int do_register(User * u)
} else if (!chan_has_user_status(c, u, CUS_OP)) {
notice_lang(s_ChanServ, u, CHAN_MUST_BE_CHANOP);
- } else if (!is_servadmin && nc->channelmax > 0
- && nc->channelcount >= nc->channelmax) {
+ } else if (!is_servadmin && CSMaxReg && nc->channelcount >= CSMaxReg) {
notice_lang(s_ChanServ, u, nc->channelcount >
- nc->channelmax ? CHAN_EXCEEDED_CHANNEL_LIMIT :
- CHAN_REACHED_CHANNEL_LIMIT, nc->channelmax);
+ CSMaxReg ? CHAN_EXCEEDED_CHANNEL_LIMIT : CHAN_REACHED_CHANNEL_LIMIT, CSMaxReg);
} else if (stricmp(u->nick, pass) == 0
|| (StrictPasswords && strlen(pass) < 5)) {
notice_lang(s_ChanServ, u, MORE_OBSCURE_PASSWORD);
diff --git a/src/core/cs_set.c b/src/core/cs_set.c
index 43bf5d3e4..646e4313b 100644
--- a/src/core/cs_set.c
+++ b/src/core/cs_set.c
@@ -296,8 +296,7 @@ int do_set_founder(User * u, ChannelInfo * ci, char *param)
}
nc = na->nc;
- if (nc->channelmax > 0 && nc->channelcount >= nc->channelmax
- && !is_services_admin(u)) {
+ if (CSMaxReg && nc->channelcount >= CSMaxReg && !is_services_admin(u)) {
notice_lang(s_ChanServ, u, CHAN_SET_FOUNDER_TOO_MANY_CHANS, param);
return MOD_CONT;
}
diff --git a/src/core/ns_register.c b/src/core/ns_register.c
index 1b84a67a7..77e68acd5 100644
--- a/src/core/ns_register.c
+++ b/src/core/ns_register.c
@@ -320,8 +320,9 @@ int do_confirm(User * u)
break;
}
}
+
na->nc->memos.memomax = MSMaxMemos;
- na->nc->channelmax = CSMaxReg;
+
if (forced == 1) {
na->last_usermask = sstrdup("*@*");
na->last_realname = sstrdup("unknown");
diff --git a/src/mysql.c b/src/mysql.c
index 44bab3b04..db67980f4 100644
--- a/src/mysql.c
+++ b/src/mysql.c
@@ -335,22 +335,22 @@ int db_mysql_save_ns_core(NickCore * nc)
/* Update the existing records */
ret = db_mysql_try("UPDATE anope_ns_core "
"SET pass = %s, email = '%s', greet = '%s', icq = %d, url = '%s', flags = %d, language = %d, accesscount = %d, memocount = %d, "
- " memomax = %d, channelcount = %d, channelmax = %d, active = 1 "
+ " memomax = %d, channelcount = %d, active = 1 "
"WHERE display = '%s'",
epass, q_email, q_greet, nc->icq, q_url, nc->flags,
nc->language, nc->accesscount, nc->memos.memocount,
- nc->memos.memomax, nc->channelcount, nc->channelmax,
+ nc->memos.memomax, nc->channelcount,
q_display);
/* Our previous UPDATE affected no rows, therefore this is a new record */
if (ret && (mysql_affected_rows(mysql) == 0)) {
ret = db_mysql_try("INSERT DELAYED INTO anope_ns_core "
- "(display, pass, email, greet, icq, url, flags, language, accesscount, memocount, memomax, channelcount, channelmax, active) "
+ "(display, pass, email, greet, icq, url, flags, language, accesscount, memocount, memomax, channelcount, active) "
"VALUES ('%s', %s, '%s', '%s', %d, '%s', %d, %d, %d, %d, %d, %d, %d, 1)",
q_display, epass, q_email, q_greet, nc->icq, q_url,
nc->flags, nc->language, nc->accesscount,
nc->memos.memocount, nc->memos.memomax,
- nc->channelcount, nc->channelmax);
+ nc->channelcount);
}
/* Now let's do the access */
@@ -1695,7 +1695,7 @@ int db_mysql_load_ns_dbase(void)
if (!do_mysql)
return 0;
- ret = db_mysql_try("SELECT display, pass, email, icq, url, flags, language, accesscount, memocount, memomax, channelcount, channelmax, greet "
+ ret = db_mysql_try("SELECT display, pass, email, icq, url, flags, language, accesscount, memocount, memomax, channelcount, greet "
"FROM anope_ns_core "
"WHERE active = 1");
@@ -1724,9 +1724,8 @@ int db_mysql_load_ns_dbase(void)
nc->memos.memocount = strtol(mysql_row[8], (char **) NULL, 10);
nc->memos.memomax = strtol(mysql_row[9], (char **) NULL, 10);
- /* Channelcount, channelmax, greet */
+ /* Channelcount, greet */
nc->channelcount = strtol(mysql_row[10], (char **) NULL, 10);
- nc->channelmax = strtol(mysql_row[11], (char **) NULL, 10);
if (mysql_row[12] && *(mysql_row[12]))
nc->greet = sstrdup(mysql_row[12]);
diff --git a/src/nickserv.c b/src/nickserv.c
index 8eea4c695..695bd86e8 100644
--- a/src/nickserv.c
+++ b/src/nickserv.c
@@ -350,10 +350,9 @@ void load_old_ns_dbase(void)
/* We read the channel count, but don't take care of it.
load_cs_dbase will regenerate it correctly. */
SAFE(read_int16(&tmp16, f));
- SAFE(read_int16(&nc->channelmax, f));
- if (ver == 5)
- nc->channelmax = CSMaxReg;
+ /* formerly nc->channelmax, RIP */
+ SAFE(read_int16(&tmp16, f));
SAFE(read_int16(&nc->language, f));
if (ver >= 11 && ver < 13) {
@@ -546,7 +545,6 @@ void load_ns_dbase(void)
SAFE(read_int16(&nc->channelcount, f));
SAFE(read_int16(&tmp16, f));
- nc->channelmax = CSMaxReg;
if (ver < 13) {
/* Used to be dead authentication system */
@@ -693,7 +691,7 @@ void save_ns_dbase(void)
}
SAFE(write_int16(nc->channelcount, f));
- SAFE(write_int16(nc->channelmax, f));
+ SAFE(write_int16(nc->channelcount, f)); // write this twice to avoid having to revbump the NickServ DB from anope 1.7, hack alert XXX
} /* for (nc) */
diff --git a/src/tools/db-merger.c b/src/tools/db-merger.c
index dd835cbe4..a80508af5 100644
--- a/src/tools/db-merger.c
+++ b/src/tools/db-merger.c
@@ -209,7 +209,6 @@ struct nickcore_ {
char **access; /* Array of strings */
MemoInfo memos; /* Memo information */
uint16 channelcount; /* Number of channels currently registered */
- uint16 channelmax; /* Maximum number of channels allowed */
int unused; /* Used for nick collisions */
int aliascount; /* How many aliases link to us? Remove the core if 0 */
};
@@ -675,7 +674,7 @@ int main(int argc, char *argv[])
SAFE(write_string(memos->text, f));
}
SAFE(write_int16(nc->channelcount, f));
- SAFE(write_int16(nc->channelmax, f));
+ SAFE(write_int16(nc->channelcount, f)); // BK with anope1.7, hack alert XXX
} /* for (nc) */
SAFE(write_int8(0, f));
} /* for (i) */