mirror of
https://github.com/anope/anope.git
synced 2026-07-01 05:56:38 +02:00
First stab at adding User::nc as requested!
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2055 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -43,6 +43,7 @@ public: // XXX: exposing a tiny bit too much
|
||||
time_t svid; /* Services ID */
|
||||
uint32 mode; /* See below */
|
||||
|
||||
NickCore *nc;
|
||||
NickAlias *na;
|
||||
|
||||
int isSuperAdmin; /* is SuperAdmin on or off? */
|
||||
|
||||
@@ -164,6 +164,7 @@ class CommandNSGroup : public Command
|
||||
}
|
||||
|
||||
u->na = na;
|
||||
u->nc = na->nc;
|
||||
na->u = u;
|
||||
|
||||
send_event(EVENT_GROUP, 1, u->nick);
|
||||
|
||||
@@ -89,6 +89,7 @@ class CommandNSConfirm : public Command
|
||||
if (!force)
|
||||
{
|
||||
u->na = na;
|
||||
u->nc = na->nc;
|
||||
na->u = u;
|
||||
alog("%s: '%s' registered by %s@%s (e-mail: %s)", s_NickServ, u->nick, u->GetIdent().c_str(), u->host, nr->email ? nr->email : "none");
|
||||
if (NSAddAccessOnReg)
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ class CommandOSOper : public Command
|
||||
|
||||
if (!nick || (isdigit(*nick) && strspn(nick, "1234567890,-") == strlen(nick)))
|
||||
{
|
||||
res = slist_enum(&servopers, nick, &oper_list_callback, u, &sent_header);
|
||||
int res = slist_enum(&servopers, nick, &oper_list_callback, u, &sent_header);
|
||||
if (!res)
|
||||
{
|
||||
notice_lang(s_OperServ, u, OPER_OPER_NO_MATCH);
|
||||
|
||||
@@ -1126,6 +1126,7 @@ int delnickrequest(NickRequest * nr)
|
||||
|
||||
int delnick(NickAlias * na)
|
||||
{
|
||||
User *u = NULL;
|
||||
/* First thing to do: remove any timeout belonging to the nick we're deleting */
|
||||
clean_ns_timeouts(na);
|
||||
|
||||
@@ -1134,6 +1135,7 @@ int delnick(NickAlias * na)
|
||||
|
||||
if (na->u)
|
||||
{
|
||||
u = na->u;
|
||||
na->u->na = NULL;
|
||||
|
||||
if (ircd->modeonunreg)
|
||||
@@ -1153,6 +1155,7 @@ int delnick(NickAlias * na)
|
||||
if (!delcore(na->nc))
|
||||
return 0;
|
||||
na->nc = NULL;
|
||||
u->nc = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+7
-2
@@ -41,6 +41,7 @@ User::User(const std::string &snick, const std::string &suid)
|
||||
host = hostip = vhost = realname = nickTrack = NULL;
|
||||
server = NULL;
|
||||
na = NULL;
|
||||
nc = NULL;
|
||||
chans = NULL;
|
||||
founder_chans = NULL;
|
||||
invalid_pw_count = timestamp = my_signon = svid = mode = invalid_pw_time = lastmemosend = lastnickreg = lastmail = 0;
|
||||
@@ -57,8 +58,10 @@ User::User(const std::string &snick, const std::string &suid)
|
||||
|
||||
this->na = findnick(snick);
|
||||
|
||||
if (this->na)
|
||||
if (this->na) {
|
||||
this->na->u = this;
|
||||
this->nc = this->na->nc;
|
||||
}
|
||||
|
||||
usercnt++;
|
||||
|
||||
@@ -113,8 +116,10 @@ void User::SetNewNick(const std::string &newnick)
|
||||
if (this->na)
|
||||
this->na->u = NULL;
|
||||
this->na = findnick(this->nick);
|
||||
if (this->na)
|
||||
if (this->na) {
|
||||
this->na->u = this;
|
||||
this->nc = this->na->nc;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user