summaryrefslogtreecommitdiff
path: root/src/core/ms_set.c
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-15 22:29:18 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-15 22:29:18 +0000
commitd1611b640bcd27e1a91a99ef32127bc722e50a36 (patch)
treeb18c77b07b74b70f5613b106aa2a81baa6227f35 /src/core/ms_set.c
parent0e5b71923b25d908167e7ef9d07c6c217827e901 (diff)
Remove User::na, use User::nc everywhere. Will probably break everything, but opens the door to decoupling NC from NA, and means commands can now be run without bothering about changinc nick :)
More tweaking for na/nc usage. It compiles, but it's still a work in progress. Again, this compiles, but I *bet* there's no chance in hell it'll work. :) Slightly better. Set User::nc correctly. Fix crash with unregistered nicks in core and ns_access. Fix glist to work when you're not on that particular nick. Fix ns_set to not crash and burn horribly. Fix ns_set and ns_logout to not do bad things. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2076 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core/ms_set.c')
-rw-r--r--src/core/ms_set.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/core/ms_set.c b/src/core/ms_set.c
index 9d92c9388..67d792047 100644
--- a/src/core/ms_set.c
+++ b/src/core/ms_set.c
@@ -26,26 +26,26 @@ class CommandMSSet : public Command
if (!stricmp(param, "ON"))
{
- u->na->nc->flags |= NI_MEMO_SIGNON | NI_MEMO_RECEIVE;
+ u->nc->flags |= NI_MEMO_SIGNON | NI_MEMO_RECEIVE;
notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_ON, s_MemoServ);
}
else if (!stricmp(param, "LOGON"))
{
- u->na->nc->flags |= NI_MEMO_SIGNON;
- u->na->nc->flags &= ~NI_MEMO_RECEIVE;
+ u->nc->flags |= NI_MEMO_SIGNON;
+ u->nc->flags &= ~NI_MEMO_RECEIVE;
notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_LOGON, s_MemoServ);
}
else if (!stricmp(param, "NEW"))
{
- u->na->nc->flags &= ~NI_MEMO_SIGNON;
- u->na->nc->flags |= NI_MEMO_RECEIVE;
+ u->nc->flags &= ~NI_MEMO_SIGNON;
+ u->nc->flags |= NI_MEMO_RECEIVE;
notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_NEW, s_MemoServ);
}
else if (!stricmp(param, "MAIL"))
{
- if (u->na->nc->email)
+ if (u->nc->email)
{
- u->na->nc->flags |= NI_MEMO_MAIL;
+ u->nc->flags |= NI_MEMO_MAIL;
notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_MAIL);
}
else
@@ -53,12 +53,12 @@ class CommandMSSet : public Command
}
else if (!stricmp(param, "NOMAIL"))
{
- u->na->nc->flags &= ~NI_MEMO_MAIL;
+ u->nc->flags &= ~NI_MEMO_MAIL;
notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_NOMAIL);
}
else if (!stricmp(param, "OFF"))
{
- u->na->nc->flags &= ~(NI_MEMO_SIGNON | NI_MEMO_RECEIVE);
+ u->nc->flags &= ~(NI_MEMO_SIGNON | NI_MEMO_RECEIVE);
notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_OFF, s_MemoServ);
}
else
@@ -73,7 +73,7 @@ class CommandMSSet : public Command
const char *p3 = params.size() > 3 ? params[3].c_str() : NULL;
const char *user = NULL, *chan = NULL;
int32 limit;
- NickAlias *na = u->na;
+ NickCore *nc = u->nc;
ChannelInfo *ci = NULL;
int is_servadmin = is_services_admin(u);
@@ -104,6 +104,7 @@ class CommandMSSet : public Command
{
if (p2 && stricmp(p2, "HARD") && !chan)
{
+ NickAlias *na;
if (!(na = findnick(p1)))
{
notice_lang(s_MemoServ, u, NICK_X_NOT_REGISTERED, p1);
@@ -111,6 +112,7 @@ class CommandMSSet : public Command
}
user = p1;
mi = &na->nc->memos;
+ nc = na->nc;
p1 = p2;
p2 = p3;
}
@@ -134,9 +136,9 @@ class CommandMSSet : public Command
else
{
if (p2)
- na->nc->flags |= NI_MEMO_HARDMAX;
+ nc->flags |= NI_MEMO_HARDMAX;
else
- na->nc->flags &= ~NI_MEMO_HARDMAX;
+ nc->flags &= ~NI_MEMO_HARDMAX;
}
limit = atoi(p1);
if (limit < 0 || limit > 32767)
@@ -158,7 +160,7 @@ class CommandMSSet : public Command
notice_lang(s_MemoServ, u, MEMO_SET_LIMIT_FORBIDDEN, chan);
return MOD_CONT;
}
- else if (!chan && (na->nc->flags & NI_MEMO_HARDMAX)) {
+ else if (!chan && (nc->flags & NI_MEMO_HARDMAX)) {
notice_lang(s_MemoServ, u, MEMO_SET_YOUR_LIMIT_FORBIDDEN);
return MOD_CONT;
}
@@ -182,21 +184,21 @@ class CommandMSSet : public Command
mi->memomax = limit;
if (limit > 0)
{
- if (!chan && na->nc == u->na->nc)
+ if (!chan && nc == u->nc)
notice_lang(s_MemoServ, u, MEMO_SET_YOUR_LIMIT, limit);
else
notice_lang(s_MemoServ, u, MEMO_SET_LIMIT, chan ? chan : user, limit);
}
else if (!limit)
{
- if (!chan && na->nc == u->na->nc)
+ if (!chan && nc == u->nc)
notice_lang(s_MemoServ, u, MEMO_SET_YOUR_LIMIT_ZERO);
else
notice_lang(s_MemoServ, u, MEMO_SET_LIMIT_ZERO, chan ? chan : user);
}
else
{
- if (!chan && na->nc == u->na->nc)
+ if (!chan && nc == u->nc)
notice_lang(s_MemoServ, u, MEMO_UNSET_YOUR_LIMIT);
else
notice_lang(s_MemoServ, u, MEMO_UNSET_LIMIT,
@@ -212,7 +214,7 @@ class CommandMSSet : public Command
CommandReturn Execute(User *u, std::vector<std::string> &params)
{
const char *cmd = params[0].c_str();
- MemoInfo *mi = &u->na->nc->memos;
+ MemoInfo *mi = &u->nc->memos;
if (readonly)
{