summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/main.cpp96
-rw-r--r--src/modules/m_spanningtree/main.h92
-rw-r--r--src/modules/m_spanningtree/override_admin.cpp2
-rw-r--r--src/modules/m_spanningtree/override_map.cpp4
-rw-r--r--src/modules/m_spanningtree/override_modules.cpp2
-rw-r--r--src/modules/m_spanningtree/override_motd.cpp2
-rw-r--r--src/modules/m_spanningtree/override_squit.cpp2
-rw-r--r--src/modules/m_spanningtree/override_stats.cpp4
-rw-r--r--src/modules/m_spanningtree/override_time.cpp2
-rw-r--r--src/modules/m_spanningtree/override_whois.cpp4
-rw-r--r--src/modules/m_spanningtree/postcommand.cpp2
-rw-r--r--src/modules/m_spanningtree/precommand.cpp2
-rw-r--r--src/modules/m_spanningtree/rconnect.cpp2
-rw-r--r--src/modules/m_spanningtree/rconnect.h2
-rw-r--r--src/modules/m_spanningtree/rsquit.cpp4
-rw-r--r--src/modules/m_spanningtree/rsquit.h4
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp10
-rw-r--r--src/modules/m_spanningtree/treesocket.h4
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp34
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp82
-rw-r--r--src/modules/m_spanningtree/utils.cpp8
-rw-r--r--src/modules/m_spanningtree/utils.h2
22 files changed, 183 insertions, 183 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 4a31d7007..62f288fb3 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -54,7 +54,7 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me)
ServerInstance->Timers->AddTimer(RefreshTimer);
}
-void ModuleSpanningTree::ShowLinks(TreeServer* Current, userrec* user, int hops)
+void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops)
{
std::string Parent = Utils->TreeRoot->GetName();
if (Current->GetParent())
@@ -98,14 +98,14 @@ int ModuleSpanningTree::CountServs()
return Utils->serverlist.size();
}
-void ModuleSpanningTree::HandleLinks(const char** parameters, int pcnt, userrec* user)
+void ModuleSpanningTree::HandleLinks(const char** parameters, int pcnt, User* user)
{
ShowLinks(Utils->TreeRoot,user,0);
user->WriteServ("365 %s * :End of /LINKS list.",user->nick);
return;
}
-void ModuleSpanningTree::HandleLusers(const char** parameters, int pcnt, userrec* user)
+void ModuleSpanningTree::HandleLusers(const char** parameters, int pcnt, User* user)
{
unsigned int n_users = ServerInstance->UserCount();
@@ -299,7 +299,7 @@ void ModuleSpanningTree::AutoConnectServers(time_t curtime)
}
}
-int ModuleSpanningTree::HandleVersion(const char** parameters, int pcnt, userrec* user)
+int ModuleSpanningTree::HandleVersion(const char** parameters, int pcnt, User* user)
{
// we've already checked if pcnt > 0, so this is safe
TreeServer* found = Utils->FindServerMask(parameters[0]);
@@ -326,7 +326,7 @@ int ModuleSpanningTree::HandleVersion(const char** parameters, int pcnt, userrec
* If the user is NULL, then the notice is sent locally via WriteToSnoMask with snomask 'l',
* and remotely via SNONOTICE with mask 'l'.
*/
-void ModuleSpanningTree::RemoteMessage(userrec* user, const char* format, ...)
+void ModuleSpanningTree::RemoteMessage(User* user, const char* format, ...)
{
/* This could cause an infinite loop, because DoOneToMany() will, on error,
* call TreeSocket::OnError(), which in turn will call this function to
@@ -369,7 +369,7 @@ void ModuleSpanningTree::RemoteMessage(userrec* user, const char* format, ...)
SendingRemoteMessage = false;
}
-int ModuleSpanningTree::HandleConnect(const char** parameters, int pcnt, userrec* user)
+int ModuleSpanningTree::HandleConnect(const char** parameters, int pcnt, User* user)
{
for (std::vector<Link>::iterator x = Utils->LinkBlocks.begin(); x < Utils->LinkBlocks.end(); x++)
{
@@ -413,7 +413,7 @@ void ModuleSpanningTree::OnGetServerDescription(const std::string &servername,st
}
}
-void ModuleSpanningTree::OnUserInvite(userrec* source,userrec* dest,chanrec* channel)
+void ModuleSpanningTree::OnUserInvite(User* source,User* dest,Channel* channel)
{
if (IS_LOCAL(source))
{
@@ -424,7 +424,7 @@ void ModuleSpanningTree::OnUserInvite(userrec* source,userrec* dest,chanrec* cha
}
}
-void ModuleSpanningTree::OnPostLocalTopicChange(userrec* user, chanrec* chan, const std::string &topic)
+void ModuleSpanningTree::OnPostLocalTopicChange(User* user, Channel* chan, const std::string &topic)
{
std::deque<std::string> params;
params.push_back(chan->name);
@@ -432,7 +432,7 @@ void ModuleSpanningTree::OnPostLocalTopicChange(userrec* user, chanrec* chan, co
Utils->DoOneToMany(user->uuid,"TOPIC",params);
}
-void ModuleSpanningTree::OnWallops(userrec* user, const std::string &text)
+void ModuleSpanningTree::OnWallops(User* user, const std::string &text)
{
if (IS_LOCAL(user))
{
@@ -442,11 +442,11 @@ void ModuleSpanningTree::OnWallops(userrec* user, const std::string &text)
}
}
-void ModuleSpanningTree::OnUserNotice(userrec* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list)
+void ModuleSpanningTree::OnUserNotice(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list)
{
if (target_type == TYPE_USER)
{
- userrec* d = (userrec*)dest;
+ User* d = (User*)dest;
if ((d->GetFd() < 0) && (IS_LOCAL(user)))
{
std::deque<std::string> params;
@@ -460,7 +460,7 @@ void ModuleSpanningTree::OnUserNotice(userrec* user, void* dest, int target_type
{
if (IS_LOCAL(user))
{
- chanrec *c = (chanrec*)dest;
+ Channel *c = (Channel*)dest;
if (c)
{
std::string cname = c->name;
@@ -490,13 +490,13 @@ void ModuleSpanningTree::OnUserNotice(userrec* user, void* dest, int target_type
}
}
-void ModuleSpanningTree::OnUserMessage(userrec* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list)
+void ModuleSpanningTree::OnUserMessage(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list)
{
if (target_type == TYPE_USER)
{
// route private messages which are targetted at clients only to the server
// which needs to receive them
- userrec* d = (userrec*)dest;
+ User* d = (User*)dest;
if ((d->GetFd() < 0) && (IS_LOCAL(user)))
{
std::deque<std::string> params;
@@ -510,7 +510,7 @@ void ModuleSpanningTree::OnUserMessage(userrec* user, void* dest, int target_typ
{
if (IS_LOCAL(user))
{
- chanrec *c = (chanrec*)dest;
+ Channel *c = (Channel*)dest;
if (c)
{
std::string cname = c->name;
@@ -546,7 +546,7 @@ void ModuleSpanningTree::OnBackgroundTimer(time_t curtime)
DoPingChecks(curtime);
}
-void ModuleSpanningTree::OnUserJoin(userrec* user, chanrec* channel, bool &silent)
+void ModuleSpanningTree::OnUserJoin(User* user, Channel* channel, bool &silent)
{
// Only do this for local users
if (IS_LOCAL(user))
@@ -576,7 +576,7 @@ void ModuleSpanningTree::OnUserJoin(userrec* user, chanrec* channel, bool &silen
}
}
-void ModuleSpanningTree::OnChangeHost(userrec* user, const std::string &newhost)
+void ModuleSpanningTree::OnChangeHost(User* user, const std::string &newhost)
{
// only occurs for local clients
if (user->registered != REG_ALL)
@@ -586,7 +586,7 @@ void ModuleSpanningTree::OnChangeHost(userrec* user, const std::string &newhost)
Utils->DoOneToMany(user->uuid,"FHOST",params);
}
-void ModuleSpanningTree::OnChangeName(userrec* user, const std::string &gecos)
+void ModuleSpanningTree::OnChangeName(User* user, const std::string &gecos)
{
// only occurs for local clients
if (user->registered != REG_ALL)
@@ -596,7 +596,7 @@ void ModuleSpanningTree::OnChangeName(userrec* user, const std::string &gecos)
Utils->DoOneToMany(user->uuid,"FNAME",params);
}
-void ModuleSpanningTree::OnUserPart(userrec* user, chanrec* channel, const std::string &partmessage, bool &silent)
+void ModuleSpanningTree::OnUserPart(User* user, Channel* channel, const std::string &partmessage, bool &silent)
{
if (IS_LOCAL(user))
{
@@ -608,7 +608,7 @@ void ModuleSpanningTree::OnUserPart(userrec* user, chanrec* channel, const std::
}
}
-void ModuleSpanningTree::OnUserConnect(userrec* user)
+void ModuleSpanningTree::OnUserConnect(User* user)
{
if (IS_LOCAL(user))
{
@@ -633,7 +633,7 @@ void ModuleSpanningTree::OnUserConnect(userrec* user)
}
}
-void ModuleSpanningTree::OnUserQuit(userrec* user, const std::string &reason, const std::string &oper_message)
+void ModuleSpanningTree::OnUserQuit(User* user, const std::string &reason, const std::string &oper_message)
{
if ((IS_LOCAL(user)) && (user->registered == REG_ALL))
{
@@ -656,7 +656,7 @@ void ModuleSpanningTree::OnUserQuit(userrec* user, const std::string &reason, co
}
}
-void ModuleSpanningTree::OnUserPostNick(userrec* user, const std::string &oldnick)
+void ModuleSpanningTree::OnUserPostNick(User* user, const std::string &oldnick)
{
if (IS_LOCAL(user))
{
@@ -673,7 +673,7 @@ void ModuleSpanningTree::OnUserPostNick(userrec* user, const std::string &oldnic
}
}
-void ModuleSpanningTree::OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason, bool &silent)
+void ModuleSpanningTree::OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent)
{
if ((source) && (IS_LOCAL(source)))
{
@@ -693,7 +693,7 @@ void ModuleSpanningTree::OnUserKick(userrec* source, userrec* user, chanrec* cha
}
}
-void ModuleSpanningTree::OnRemoteKill(userrec* source, userrec* dest, const std::string &reason, const std::string &operreason)
+void ModuleSpanningTree::OnRemoteKill(User* source, User* dest, const std::string &reason, const std::string &operreason)
{
std::deque<std::string> params;
params.push_back(":"+reason);
@@ -705,7 +705,7 @@ void ModuleSpanningTree::OnRemoteKill(userrec* source, userrec* dest, const std:
Utils->DoOneToMany(source->uuid,"KILL",params);
}
-void ModuleSpanningTree::OnRehash(userrec* user, const std::string &parameter)
+void ModuleSpanningTree::OnRehash(User* user, const std::string &parameter)
{
if (!parameter.empty())
{
@@ -726,7 +726,7 @@ void ModuleSpanningTree::OnRehash(userrec* user, const std::string &parameter)
// note: the protocol does not allow direct umode +o except
// via NICK with 8 params. sending OPERTYPE infers +o modechange
// locally.
-void ModuleSpanningTree::OnOper(userrec* user, const std::string &opertype)
+void ModuleSpanningTree::OnOper(User* user, const std::string &opertype)
{
if (IS_LOCAL(user))
{
@@ -736,7 +736,7 @@ void ModuleSpanningTree::OnOper(userrec* user, const std::string &opertype)
}
}
-void ModuleSpanningTree::OnLine(userrec* source, const std::string &host, bool adding, char linetype, long duration, const std::string &reason)
+void ModuleSpanningTree::OnLine(User* source, const std::string &host, bool adding, char linetype, long duration, const std::string &reason)
{
if (!source)
{
@@ -775,47 +775,47 @@ void ModuleSpanningTree::OnLine(userrec* source, const std::string &host, bool a
}
}
-void ModuleSpanningTree::OnAddGLine(long duration, userrec* source, const std::string &reason, const std::string &hostmask)
+void ModuleSpanningTree::OnAddGLine(long duration, User* source, const std::string &reason, const std::string &hostmask)
{
OnLine(source,hostmask,true,'G',duration,reason);
}
-void ModuleSpanningTree::OnAddZLine(long duration, userrec* source, const std::string &reason, const std::string &ipmask)
+void ModuleSpanningTree::OnAddZLine(long duration, User* source, const std::string &reason, const std::string &ipmask)
{
OnLine(source,ipmask,true,'Z',duration,reason);
}
-void ModuleSpanningTree::OnAddQLine(long duration, userrec* source, const std::string &reason, const std::string &nickmask)
+void ModuleSpanningTree::OnAddQLine(long duration, User* source, const std::string &reason, const std::string &nickmask)
{
OnLine(source,nickmask,true,'Q',duration,reason);
}
-void ModuleSpanningTree::OnAddELine(long duration, userrec* source, const std::string &reason, const std::string &hostmask)
+void ModuleSpanningTree::OnAddELine(long duration, User* source, const std::string &reason, const std::string &hostmask)
{
OnLine(source,hostmask,true,'E',duration,reason);
}
-void ModuleSpanningTree::OnDelGLine(userrec* source, const std::string &hostmask)
+void ModuleSpanningTree::OnDelGLine(User* source, const std::string &hostmask)
{
OnLine(source,hostmask,false,'G',0,"");
}
-void ModuleSpanningTree::OnDelZLine(userrec* source, const std::string &ipmask)
+void ModuleSpanningTree::OnDelZLine(User* source, const std::string &ipmask)
{
OnLine(source,ipmask,false,'Z',0,"");
}
-void ModuleSpanningTree::OnDelQLine(userrec* source, const std::string &nickmask)
+void ModuleSpanningTree::OnDelQLine(User* source, const std::string &nickmask)
{
OnLine(source,nickmask,false,'Q',0,"");
}
-void ModuleSpanningTree::OnDelELine(userrec* source, const std::string &hostmask)
+void ModuleSpanningTree::OnDelELine(User* source, const std::string &hostmask)
{
OnLine(source,hostmask,false,'E',0,"");
}
-void ModuleSpanningTree::OnMode(userrec* user, void* dest, int target_type, const std::string &text)
+void ModuleSpanningTree::OnMode(User* user, void* dest, int target_type, const std::string &text)
{
if ((IS_LOCAL(user)) && (user->registered == REG_ALL))
{
@@ -827,14 +827,14 @@ void ModuleSpanningTree::OnMode(userrec* user, void* dest, int target_type, cons
if (target_type == TYPE_USER)
{
- userrec* u = (userrec*)dest;
+ User* u = (User*)dest;
params.push_back(u->uuid);
params.push_back(output_text);
command = "MODE";
}
else
{
- chanrec* c = (chanrec*)dest;
+ Channel* c = (Channel*)dest;
params.push_back(c->name);
params.push_back(ConvToStr(c->age));
params.push_back(output_text);
@@ -845,7 +845,7 @@ void ModuleSpanningTree::OnMode(userrec* user, void* dest, int target_type, cons
}
}
-void ModuleSpanningTree::OnSetAway(userrec* user)
+void ModuleSpanningTree::OnSetAway(User* user)
{
if (IS_LOCAL(user))
{
@@ -855,7 +855,7 @@ void ModuleSpanningTree::OnSetAway(userrec* user)
}
}
-void ModuleSpanningTree::OnCancelAway(userrec* user)
+void ModuleSpanningTree::OnCancelAway(User* user)
{
if (IS_LOCAL(user))
{
@@ -876,12 +876,12 @@ void ModuleSpanningTree::ProtoSendMode(void* opaque, int target_type, void* targ
{
if (target_type == TYPE_USER)
{
- userrec* u = (userrec*)target;
+ User* u = (User*)target;
s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" FMODE "+u->uuid+" "+ConvToStr(u->age)+" "+output_text);
}
else
{
- chanrec* c = (chanrec*)target;
+ Channel* c = (Channel*)target;
s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" FMODE "+c->name+" "+ConvToStr(c->age)+" "+output_text);
}
}
@@ -894,12 +894,12 @@ void ModuleSpanningTree::ProtoSendMetaData(void* opaque, int target_type, void*
{
if (target_type == TYPE_USER)
{
- userrec* u = (userrec*)target;
+ User* u = (User*)target;
s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" METADATA "+u->uuid+" "+extname+" :"+extdata);
}
else if (target_type == TYPE_CHANNEL)
{
- chanrec* c = (chanrec*)target;
+ Channel* c = (Channel*)target;
s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" METADATA "+c->name+" "+extname+" :"+extdata);
}
}
@@ -932,7 +932,7 @@ void ModuleSpanningTree::OnEvent(Event* event)
{
if (params->size() < 2)
return;
- // Insert the TS value of the object, either userrec or chanrec
+ // Insert the TS value of the object, either User or Channel
time_t ourTS = 0;
std::string output_text;
@@ -940,7 +940,7 @@ void ModuleSpanningTree::OnEvent(Event* event)
for (size_t n = 0; n < params->size(); n++)
ServerInstance->Parser->TranslateUIDs(TR_NICK, (*params)[n], (*params)[n]);
- userrec* a = ServerInstance->FindNick((*params)[0]);
+ User* a = ServerInstance->FindNick((*params)[0]);
if (a)
{
ourTS = a->age;
@@ -949,7 +949,7 @@ void ModuleSpanningTree::OnEvent(Event* event)
}
else
{
- chanrec* a = ServerInstance->FindChan((*params)[0]);
+ Channel* a = ServerInstance->FindChan((*params)[0]);
if (a)
{
ourTS = a->age;
@@ -996,7 +996,7 @@ void ModuleSpanningTree::OnEvent(Event* event)
if (params->size() < 2)
return;
- userrec *a = ServerInstance->FindNick((*params)[0]);
+ User *a = ServerInstance->FindNick((*params)[0]);
if (!a)
return;
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index 9b697a89f..dab1b2420 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -63,7 +63,7 @@ class ModuleSpanningTree : public Module
/** Shows /LINKS
*/
- void ShowLinks(TreeServer* Current, userrec* user, int hops);
+ void ShowLinks(TreeServer* Current, User* user, int hops);
/** Counts local servers
*/
@@ -75,47 +75,47 @@ class ModuleSpanningTree : public Module
/** Handle LINKS command
*/
- void HandleLinks(const char** parameters, int pcnt, userrec* user);
+ void HandleLinks(const char** parameters, int pcnt, User* user);
/** Handle LUSERS command
*/
- void HandleLusers(const char** parameters, int pcnt, userrec* user);
+ void HandleLusers(const char** parameters, int pcnt, User* user);
/** Show MAP output to a user (recursive)
*/
- void ShowMap(TreeServer* Current, userrec* user, int depth, char matrix[128][128], float &totusers, float &totservers);
+ void ShowMap(TreeServer* Current, User* user, int depth, char matrix[128][128], float &totusers, float &totservers);
/** Handle remote MOTD
*/
- int HandleMotd(const char** parameters, int pcnt, userrec* user);
+ int HandleMotd(const char** parameters, int pcnt, User* user);
/** Handle remote ADMIN
*/
- int HandleAdmin(const char** parameters, int pcnt, userrec* user);
+ int HandleAdmin(const char** parameters, int pcnt, User* user);
/** Handle remote STATS
*/
- int HandleStats(const char** parameters, int pcnt, userrec* user);
+ int HandleStats(const char** parameters, int pcnt, User* user);
/** Handle MAP command
*/
- void HandleMap(const char** parameters, int pcnt, userrec* user);
+ void HandleMap(const char** parameters, int pcnt, User* user);
/** Handle SQUIT
*/
- int HandleSquit(const char** parameters, int pcnt, userrec* user);
+ int HandleSquit(const char** parameters, int pcnt, User* user);
/** Handle TIME
*/
- int HandleTime(const char** parameters, int pcnt, userrec* user);
+ int HandleTime(const char** parameters, int pcnt, User* user);
/** Handle remote WHOIS
*/
- int HandleRemoteWhois(const char** parameters, int pcnt, userrec* user);
+ int HandleRemoteWhois(const char** parameters, int pcnt, User* user);
/** Handle remote MODULES
*/
- int HandleModules(const char** parameters, int pcnt, userrec* user);
+ int HandleModules(const char** parameters, int pcnt, User* user);
/** Ping all local servers
*/
@@ -131,11 +131,11 @@ class ModuleSpanningTree : public Module
/** Handle remote VERSON
*/
- int HandleVersion(const char** parameters, int pcnt, userrec* user);
+ int HandleVersion(const char** parameters, int pcnt, User* user);
/** Handle CONNECT
*/
- int HandleConnect(const char** parameters, int pcnt, userrec* user);
+ int HandleConnect(const char** parameters, int pcnt, User* user);
/** Send out time sync to all servers
*/
@@ -143,7 +143,7 @@ class ModuleSpanningTree : public Module
/** Attempt to send a message to a user
*/
- void RemoteMessage(userrec* user, const char* format, ...);
+ void RemoteMessage(User* user, const char* format, ...);
/** Returns oper-specific MAP information
*/
@@ -157,39 +157,39 @@ class ModuleSpanningTree : public Module
** *** MODULE EVENTS ***
**/
- virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated, const std::string &original_line);
- virtual void OnPostCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, CmdResult result, const std::string &original_line);
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line);
+ virtual void OnPostCommand(const std::string &command, const char** parameters, int pcnt, User *user, CmdResult result, const std::string &original_line);
virtual void OnGetServerDescription(const std::string &servername,std::string &description);
- virtual void OnUserInvite(userrec* source,userrec* dest,chanrec* channel);
- virtual void OnPostLocalTopicChange(userrec* user, chanrec* chan, const std::string &topic);
- virtual void OnWallops(userrec* user, const std::string &text);
- virtual void OnUserNotice(userrec* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list);
- virtual void OnUserMessage(userrec* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list);
+ virtual void OnUserInvite(User* source,User* dest,Channel* channel);
+ virtual void OnPostLocalTopicChange(User* user, Channel* chan, const std::string &topic);
+ virtual void OnWallops(User* user, const std::string &text);
+ virtual void OnUserNotice(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list);
+ virtual void OnUserMessage(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list);
virtual void OnBackgroundTimer(time_t curtime);
- virtual void OnUserJoin(userrec* user, chanrec* channel, bool &silent);
- virtual void OnChangeHost(userrec* user, const std::string &newhost);
- virtual void OnChangeName(userrec* user, const std::string &gecos);
- virtual void OnUserPart(userrec* user, chanrec* channel, const std::string &partmessage, bool &silent);
- virtual void OnUserConnect(userrec* user);
- virtual void OnUserQuit(userrec* user, const std::string &reason, const std::string &oper_message);
- virtual void OnUserPostNick(userrec* user, const std::string &oldnick);
- virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason, bool &silent);
- virtual void OnRemoteKill(userrec* source, userrec* dest, const std::string &reason, const std::string &operreason);
- virtual void OnRehash(userrec* user, const std::string &parameter);
- virtual void OnOper(userrec* user, const std::string &opertype);
- void OnLine(userrec* source, const std::string &host, bool adding, char linetype, long duration, const std::string &reason);
- virtual void OnAddGLine(long duration, userrec* source, const std::string &reason, const std::string &hostmask);
- virtual void OnAddZLine(long duration, userrec* source, const std::string &reason, const std::string &ipmask);
- virtual void OnAddQLine(long duration, userrec* source, const std::string &reason, const std::string &nickmask);
- virtual void OnAddELine(long duration, userrec* source, const std::string &reason, const std::string &hostmask);
- virtual void OnDelGLine(userrec* source, const std::string &hostmask);
- virtual void OnDelZLine(userrec* source, const std::string &ipmask);
- virtual void OnDelQLine(userrec* source, const std::string &nickmask);
- virtual void OnDelELine(userrec* source, const std::string &hostmask);
- virtual void OnMode(userrec* user, void* dest, int target_type, const std::string &text);
- virtual int OnStats(char statschar, userrec* user, string_list &results);
- virtual void OnSetAway(userrec* user);
- virtual void OnCancelAway(userrec* user);
+ virtual void OnUserJoin(User* user, Channel* channel, bool &silent);
+ virtual void OnChangeHost(User* user, const std::string &newhost);
+ virtual void OnChangeName(User* user, const std::string &gecos);
+ virtual void OnUserPart(User* user, Channel* channel, const std::string &partmessage, bool &silent);
+ virtual void OnUserConnect(User* user);
+ virtual void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message);
+ virtual void OnUserPostNick(User* user, const std::string &oldnick);
+ virtual void OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent);
+ virtual void OnRemoteKill(User* source, User* dest, const std::string &reason, const std::string &operreason);
+ virtual void OnRehash(User* user, const std::string &parameter);
+ virtual void OnOper(User* user, const std::string &opertype);
+ void OnLine(User* source, const std::string &host, bool adding, char linetype, long duration, const std::string &reason);
+ virtual void OnAddGLine(long duration, User* source, const std::string &reason, const std::string &hostmask);
+ virtual void OnAddZLine(long duration, User* source, const std::string &reason, const std::string &ipmask);
+ virtual void OnAddQLine(long duration, User* source, const std::string &reason, const std::string &nickmask);
+ virtual void OnAddELine(long duration, User* source, const std::string &reason, const std::string &hostmask);
+ virtual void OnDelGLine(User* source, const std::string &hostmask);
+ virtual void OnDelZLine(User* source, const std::string &ipmask);
+ virtual void OnDelQLine(User* source, const std::string &nickmask);
+ virtual void OnDelELine(User* source, const std::string &hostmask);
+ virtual void OnMode(User* user, void* dest, int target_type, const std::string &text);
+ virtual int OnStats(char statschar, User* user, string_list &results);
+ virtual void OnSetAway(User* user);
+ virtual void OnCancelAway(User* user);
virtual void ProtoSendMode(void* opaque, int target_type, void* target, const std::string &modeline);
virtual void ProtoSendMetaData(void* opaque, int target_type, void* target, const std::string &extname, const std::string &extdata);
virtual void OnEvent(Event* event);
diff --git a/src/modules/m_spanningtree/override_admin.cpp b/src/modules/m_spanningtree/override_admin.cpp
index 41bb66570..0a122a780 100644
--- a/src/modules/m_spanningtree/override_admin.cpp
+++ b/src/modules/m_spanningtree/override_admin.cpp
@@ -33,7 +33,7 @@
/* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h */
-int ModuleSpanningTree::HandleAdmin(const char** parameters, int pcnt, userrec* user)
+int ModuleSpanningTree::HandleAdmin(const char** parameters, int pcnt, User* user)
{
if (pcnt > 0)
{
diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp
index d6f39e6a8..d0940936a 100644
--- a/src/modules/m_spanningtree/override_map.cpp
+++ b/src/modules/m_spanningtree/override_map.cpp
@@ -40,7 +40,7 @@ const std::string ModuleSpanningTree::MapOperInfo(TreeServer* Current)
}
// WARNING: NOT THREAD SAFE - DONT GET ANY SMART IDEAS.
-void ModuleSpanningTree::ShowMap(TreeServer* Current, userrec* user, int depth, char matrix[128][128], float &totusers, float &totservers)
+void ModuleSpanningTree::ShowMap(TreeServer* Current, User* user, int depth, char matrix[128][128], float &totusers, float &totservers)
{
if (line < 128)
{
@@ -104,7 +104,7 @@ void ModuleSpanningTree::ShowMap(TreeServer* Current, userrec* user, int depth,
// and divisons, we instead render the map onto a backplane of characters
// (a character matrix), then draw the branches as a series of "L" shapes
// from the nodes. This is not only friendlier on CPU it uses less stack.
-void ModuleSpanningTree::HandleMap(const char** parameters, int pcnt, userrec* user)
+void ModuleSpanningTree::HandleMap(const char** parameters, int pcnt, User* user)
{
// This array represents a virtual screen which we will
// "scratch" draw to, as the console device of an irc
diff --git a/src/modules/m_spanningtree/override_modules.cpp b/src/modules/m_spanningtree/override_modules.cpp
index 21f6f7350..f32e3ced0 100644
--- a/src/modules/m_spanningtree/override_modules.cpp
+++ b/src/modules/m_spanningtree/override_modules.cpp
@@ -33,7 +33,7 @@
/* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h */
-int ModuleSpanningTree::HandleModules(const char** parameters, int pcnt, userrec* user)
+int ModuleSpanningTree::HandleModules(const char** parameters, int pcnt, User* user)
{
if (pcnt > 0)
{
diff --git a/src/modules/m_spanningtree/override_motd.cpp b/src/modules/m_spanningtree/override_motd.cpp
index df8331cb7..78e030429 100644
--- a/src/modules/m_spanningtree/override_motd.cpp
+++ b/src/modules/m_spanningtree/override_motd.cpp
@@ -33,7 +33,7 @@
/* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h */
-int ModuleSpanningTree::HandleMotd(const char** parameters, int pcnt, userrec* user)
+int ModuleSpanningTree::HandleMotd(const char** parameters, int pcnt, User* user)
{
if (pcnt > 0)
{
diff --git a/src/modules/m_spanningtree/override_squit.cpp b/src/modules/m_spanningtree/override_squit.cpp
index ce58744b7..8db459411 100644
--- a/src/modules/m_spanningtree/override_squit.cpp
+++ b/src/modules/m_spanningtree/override_squit.cpp
@@ -33,7 +33,7 @@
/* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h */
-int ModuleSpanningTree::HandleSquit(const char** parameters, int pcnt, userrec* user)
+int ModuleSpanningTree::HandleSquit(const char** parameters, int pcnt, User* user)
{
TreeServer* s = Utils->FindServerMask(parameters[0]);
if (s)
diff --git a/src/modules/m_spanningtree/override_stats.cpp b/src/modules/m_spanningtree/override_stats.cpp
index 05a8da8af..d9dca2827 100644
--- a/src/modules/m_spanningtree/override_stats.cpp
+++ b/src/modules/m_spanningtree/override_stats.cpp
@@ -33,7 +33,7 @@
/* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h */
-int ModuleSpanningTree::HandleStats(const char** parameters, int pcnt, userrec* user)
+int ModuleSpanningTree::HandleStats(const char** parameters, int pcnt, User* user)
{
if (pcnt > 1)
{
@@ -61,7 +61,7 @@ int ModuleSpanningTree::HandleStats(const char** parameters, int pcnt, userrec*
return 0;
}
-int ModuleSpanningTree::OnStats(char statschar, userrec* user, string_list &results)
+int ModuleSpanningTree::OnStats(char statschar, User* user, string_list &results)
{
if ((statschar == 'c') || (statschar == 'n'))
{
diff --git a/src/modules/m_spanningtree/override_time.cpp b/src/modules/m_spanningtree/override_time.cpp
index 6c093ba98..359275dfd 100644
--- a/src/modules/m_spanningtree/override_time.cpp
+++ b/src/modules/m_spanningtree/override_time.cpp
@@ -33,7 +33,7 @@
/* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h */
-int ModuleSpanningTree::HandleTime(const char** parameters, int pcnt, userrec* user)
+int ModuleSpanningTree::HandleTime(const char** parameters, int pcnt, User* user)
{
if ((IS_LOCAL(user)) && (pcnt))
{
diff --git a/src/modules/m_spanningtree/override_whois.cpp b/src/modules/m_spanningtree/override_whois.cpp
index 493735f6a..214c20da3 100644
--- a/src/modules/m_spanningtree/override_whois.cpp
+++ b/src/modules/m_spanningtree/override_whois.cpp
@@ -33,11 +33,11 @@
/* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h */
-int ModuleSpanningTree::HandleRemoteWhois(const char** parameters, int pcnt, userrec* user)
+int ModuleSpanningTree::HandleRemoteWhois(const char** parameters, int pcnt, User* user)
{
if ((IS_LOCAL(user)) && (pcnt > 1))
{
- userrec* remote = ServerInstance->FindNick(parameters[1]);
+ User* remote = ServerInstance->FindNick(parameters[1]);
if ((remote) && (remote->GetFd() < 0))
{
std::deque<std::string> params;
diff --git a/src/modules/m_spanningtree/postcommand.cpp b/src/modules/m_spanningtree/postcommand.cpp
index f538e2963..bf4232b96 100644
--- a/src/modules/m_spanningtree/postcommand.cpp
+++ b/src/modules/m_spanningtree/postcommand.cpp
@@ -33,7 +33,7 @@
/* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h */
-void ModuleSpanningTree::OnPostCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, CmdResult result, const std::string &original_line)
+void ModuleSpanningTree::OnPostCommand(const std::string &command, const char** parameters, int pcnt, User *user, CmdResult result, const std::string &original_line)
{
if ((result == CMD_SUCCESS) && (ServerInstance->IsValidModuleCommand(command, pcnt, user)))
{
diff --git a/src/modules/m_spanningtree/precommand.cpp b/src/modules/m_spanningtree/precommand.cpp
index c9afef795..1c854a1c1 100644
--- a/src/modules/m_spanningtree/precommand.cpp
+++ b/src/modules/m_spanningtree/precommand.cpp
@@ -33,7 +33,7 @@
/* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h */
-int ModuleSpanningTree::OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated, const std::string &original_line)
+int ModuleSpanningTree::OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line)
{
/* If the command doesnt appear to be valid, we dont want to mess with it. */
if (!validated)
diff --git a/src/modules/m_spanningtree/rconnect.cpp b/src/modules/m_spanningtree/rconnect.cpp
index 25bf833e1..a984472d1 100644
--- a/src/modules/m_spanningtree/rconnect.cpp
+++ b/src/modules/m_spanningtree/rconnect.cpp
@@ -36,7 +36,7 @@ cmd_rconnect::cmd_rconnect (InspIRCd* Instance, Module* Callback, SpanningTreeUt
syntax = "<remote-server-mask> <target-server-mask>";
}
-CmdResult cmd_rconnect::Handle (const char** parameters, int pcnt, userrec *user)
+CmdResult cmd_rconnect::Handle (const char** parameters, int pcnt, User *user)
{
if (IS_LOCAL(user))
{
diff --git a/src/modules/m_spanningtree/rconnect.h b/src/modules/m_spanningtree/rconnect.h
index 080d2aad6..ec33445ab 100644
--- a/src/modules/m_spanningtree/rconnect.h
+++ b/src/modules/m_spanningtree/rconnect.h
@@ -22,7 +22,7 @@ class cmd_rconnect : public Command
SpanningTreeUtilities* Utils; /* Utility class */
public:
cmd_rconnect (InspIRCd* Instance, Module* Callback, SpanningTreeUtilities* Util);
- CmdResult Handle (const char** parameters, int pcnt, userrec *user);
+ CmdResult Handle (const char** parameters, int pcnt, User *user);
};
#endif
diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp
index 8c7e9d7f9..62f22bc4f 100644
--- a/src/modules/m_spanningtree/rsquit.cpp
+++ b/src/modules/m_spanningtree/rsquit.cpp
@@ -36,7 +36,7 @@ cmd_rsquit::cmd_rsquit (InspIRCd* Instance, Module* Callback, SpanningTreeUtilit
syntax = "<remote-server-mask> [target-server-mask]";
}
-CmdResult cmd_rsquit::Handle (const char** parameters, int pcnt, userrec *user)
+CmdResult cmd_rsquit::Handle (const char** parameters, int pcnt, User *user)
{
if (IS_LOCAL(user))
{
@@ -103,7 +103,7 @@ CmdResult cmd_rsquit::Handle (const char** parameters, int pcnt, userrec *user)
return CMD_SUCCESS;
}
-void cmd_rsquit::NoticeUser(userrec* user, const std::string &msg)
+void cmd_rsquit::NoticeUser(User* user, const std::string &msg)
{
if (IS_LOCAL(user))
{
diff --git a/src/modules/m_spanningtree/rsquit.h b/src/modules/m_spanningtree/rsquit.h
index d6285b83f..af2d347b1 100644
--- a/src/modules/m_spanningtree/rsquit.h
+++ b/src/modules/m_spanningtree/rsquit.h
@@ -22,8 +22,8 @@ class cmd_rsquit : public Command
SpanningTreeUtilities* Utils; /* Utility class */
public:
cmd_rsquit (InspIRCd* Instance, Module* Callback, SpanningTreeUtilities* Util);
- CmdResult Handle (const char** parameters, int pcnt, userrec *user);
- void NoticeUser(userrec* user, const std::string &msg);
+ CmdResult Handle (const char** parameters, int pcnt, User *user);
+ void NoticeUser(User* user, const std::string &msg);
};
#endif
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp
index 4bedf8388..635d2cc18 100644
--- a/src/modules/m_spanningtree/treeserver.cpp
+++ b/src/modules/m_spanningtree/treeserver.cpp
@@ -149,7 +149,7 @@ bool TreeServer::DuplicateID()
int TreeServer::QuitUsers(const std::string &reason)
{
const char* reason_s = reason.c_str();
- std::vector<userrec*> time_to_die;
+ std::vector<User*> time_to_die;
for (user_hash::iterator n = ServerInstance->clientlist->begin(); n != ServerInstance->clientlist->end(); n++)
{
if (!strcmp(n->second->server, this->ServerName.c_str()))
@@ -157,15 +157,15 @@ int TreeServer::QuitUsers(const std::string &reason)
time_to_die.push_back(n->second);
}
}
- for (std::vector<userrec*>::iterator n = time_to_die.begin(); n != time_to_die.end(); n++)
+ for (std::vector<User*>::iterator n = time_to_die.begin(); n != time_to_die.end(); n++)
{
- userrec* a = (userrec*)*n;
+ User* a = (User*)*n;
if (!IS_LOCAL(a))
{
if (ServerInstance->Config->HideSplits)
- userrec::QuitUser(ServerInstance, a, "*.net *.split", reason_s);
+ User::QuitUser(ServerInstance, a, "*.net *.split", reason_s);
else
- userrec::QuitUser(ServerInstance, a, reason_s);
+ User::QuitUser(ServerInstance, a, reason_s);
if (this->Utils->quiet_bursts)
ServerInstance->GlobalCulls.MakeSilent(a);
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h
index a798976d2..08e308dfb 100644
--- a/src/modules/m_spanningtree/treesocket.h
+++ b/src/modules/m_spanningtree/treesocket.h
@@ -228,7 +228,7 @@ class TreeSocket : public InspSocket
bool ForceJoin(const std::string &source, std::deque<std::string> &params);
/* Used on nick collision ... XXX ugly function HACK */
- int DoCollision(userrec *u, time_t remotets, const char *remoteident, const char *remoteip, const char *remoteuid);
+ int DoCollision(User *u, time_t remotets, const char *remoteident, const char *remoteip, const char *remoteuid);
/** UID command */
bool ParseUID(const std::string &source, std::deque<std::string> &params);
@@ -237,7 +237,7 @@ class TreeSocket : public InspSocket
* If the length of a single line is more than 480-NICKMAX
* in length, it is split over multiple lines.
*/
- void SendFJoins(TreeServer* Current, chanrec* c);
+ void SendFJoins(TreeServer* Current, Channel* c);
/** Send G, Q, Z and E lines */
void SendXLines(TreeServer* Current);
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index f75362bd3..4f6dae56a 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -622,7 +622,7 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
bool smode = false;
std::string sourceserv;
/* Are we dealing with an FMODE from a user, or from a server? */
- userrec* who = this->Instance->FindNick(source);
+ User* who = this->Instance->FindNick(source);
if (who)
{
/* FMODE from a user, set sourceserv to the users server name */
@@ -632,7 +632,7 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
{
/* FMODE from a server, use a fake user to receive mode feedback */
who = this->Instance->FakeClient;
- smode = true; /* Setting this flag tells us we should free the userrec later */
+ smode = true; /* Setting this flag tells us we should free the User later */
sourceserv = source; /* Set sourceserv to the actual source string */
}
const char* modelist[64];
@@ -656,9 +656,9 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
}
}
- /* Extract the TS value of the object, either userrec or chanrec */
- userrec* dst = this->Instance->FindNick(params[0]);
- chanrec* chan = NULL;
+ /* Extract the TS value of the object, either User or Channel */
+ User* dst = this->Instance->FindNick(params[0]);
+ Channel* chan = NULL;
time_t ourTS = 0;
if (dst)
{
@@ -713,7 +713,7 @@ bool TreeSocket::ForceTopic(const std::string &source, std::deque<std::string> &
return true;
time_t ts = atoi(params[1].c_str());
std::string nsource = source;
- chanrec* c = this->Instance->FindChan(params[0]);
+ Channel* c = this->Instance->FindChan(params[0]);
if (c)
{
if ((ts >= c->topicset) || (!*c->topic))
@@ -728,7 +728,7 @@ bool TreeSocket::ForceTopic(const std::string &source, std::deque<std::string> &
*/
if (oldtopic != params[3])
{
- userrec* user = this->Instance->FindNick(source);
+ User* user = this->Instance->FindNick(source);
if (!user)
{
c->WriteChannelWithServ(Instance->Config->ServerName, "TOPIC %s :%s", c->name, c->topic);
@@ -789,12 +789,12 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
return true;
irc::modestacker modestack(true); /* Modes to apply from the users in the user list */
- userrec* who = NULL; /* User we are currently checking */
+ User* who = NULL; /* User we are currently checking */
std::string channel = params[0]; /* Channel name, as a string */
time_t TS = atoi(params[1].c_str()); /* Timestamp given to us for remote side */
irc::tokenstream users(params[2]); /* Users from the user list */
bool apply_other_sides_modes = true; /* True if we are accepting the other side's modes */
- chanrec* chan = this->Instance->FindChan(channel); /* The channel we're sending joins to */
+ Channel* chan = this->Instance->FindChan(channel); /* The channel we're sending joins to */
time_t ourTS = chan ? chan->age : Instance->Time(true)+600; /* The TS of our side of the link */
bool created = !chan; /* True if the channel doesnt exist here yet */
std::string item; /* One item in the list of nicks */
@@ -866,7 +866,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
for (std::string::iterator x = modes.begin(); x != modes.end(); ++x)
modestack.Push(*x, who->nick);
- chanrec::JoinUser(this->Instance, who, channel.c_str(), true, "", TS);
+ Channel::JoinUser(this->Instance, who, channel.c_str(), true, "", TS);
}
else
{
@@ -898,11 +898,11 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
/*
* Yes, this function looks a little ugly.
- * However, in some circumstances we may not have a userrec, so we need to do things this way.
+ * However, in some circumstances we may not have a User, so we need to do things this way.
* Returns 1 if colliding local client, 2 if colliding remote, 3 if colliding both.
* Sends SVSNICKs as appropriate and forces nickchanges too.
*/
-int TreeSocket::DoCollision(userrec *u, time_t remotets, const char *remoteident, const char *remoteip, const char *remoteuid)
+int TreeSocket::DoCollision(User *u, time_t remotets, const char *remoteident, const char *remoteip, const char *remoteuid)
{
/*
* Under old protocol rules, we would have had to kill both clients.
@@ -924,7 +924,7 @@ int TreeSocket::DoCollision(userrec *u, time_t remotets, const char *remoteident
bool bChangeLocal = true;
bool bChangeRemote = true;
- /* for brevity, don't use the userrec */
+ /* for brevity, don't use the User */
time_t localts = u->age;
const char *localident = u->ident;
const char *localip = u->GetIPString();
@@ -980,7 +980,7 @@ int TreeSocket::DoCollision(userrec *u, time_t remotets, const char *remoteident
* have 928AAAB's nick set to that.
* -- w00t
*/
- userrec *remote = this->Instance->FindUUID(remoteuid);
+ User *remote = this->Instance->FindUUID(remoteuid);
if (remote)
{
@@ -1066,10 +1066,10 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
/* IMPORTANT NOTE: For remote users, we pass the UUID in the constructor. This automatically
* sets it up in the UUID hash for us.
*/
- userrec* _new = NULL;
+ User* _new = NULL;
try
{
- _new = new userrec(this->Instance, params[0]);
+ _new = new User(this->Instance, params[0]);
}
catch (...)
{
@@ -1142,7 +1142,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
* If the length of a single line is more than 480-NICKMAX
* in length, it is split over multiple lines.
*/
-void TreeSocket::SendFJoins(TreeServer* Current, chanrec* c)
+void TreeSocket::SendFJoins(TreeServer* Current, Channel* c)
{
std::string buffer;
char list[MAXBUF];
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index becfc785b..0c2e99041 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -67,7 +67,7 @@ bool TreeSocket::Modules(const std::string &prefix, std::deque<std::string> &par
par.push_back(prefix);
par.push_back("");
- userrec* source = this->Instance->FindNick(prefix);
+ User* source = this->Instance->FindNick(prefix);
if (!source)
return true;
@@ -114,7 +114,7 @@ bool TreeSocket::Motd(const std::string &prefix, std::deque<std::string> &params
{
/* It's for our server */
string_list results;
- userrec* source = this->Instance->FindNick(prefix);
+ User* source = this->Instance->FindNick(prefix);
if (source)
{
@@ -145,7 +145,7 @@ bool TreeSocket::Motd(const std::string &prefix, std::deque<std::string> &params
else
{
/* Pass it on */
- userrec* source = this->Instance->FindNick(prefix);
+ User* source = this->Instance->FindNick(prefix);
if (source)
Utils->DoOneToOne(prefix, "MOTD", params, params[0]);
}
@@ -162,7 +162,7 @@ bool TreeSocket::Admin(const std::string &prefix, std::deque<std::string> &param
{
/* It's for our server */
string_list results;
- userrec* source = this->Instance->FindNick(prefix);
+ User* source = this->Instance->FindNick(prefix);
if (source)
{
std::deque<std::string> par;
@@ -181,7 +181,7 @@ bool TreeSocket::Admin(const std::string &prefix, std::deque<std::string> &param
else
{
/* Pass it on */
- userrec* source = this->Instance->FindNick(prefix);
+ User* source = this->Instance->FindNick(prefix);
if (source)
Utils->DoOneToOne(prefix, "ADMIN", params, params[0]);
}
@@ -200,7 +200,7 @@ bool TreeSocket::Stats(const std::string &prefix, std::deque<std::string> &param
{
/* It's for our server */
string_list results;
- userrec* source = this->Instance->FindNick(prefix);
+ User* source = this->Instance->FindNick(prefix);
if (source)
{
std::deque<std::string> par;
@@ -217,7 +217,7 @@ bool TreeSocket::Stats(const std::string &prefix, std::deque<std::string> &param
else
{
/* Pass it on */
- userrec* source = this->Instance->FindNick(prefix);
+ User* source = this->Instance->FindNick(prefix);
if (source)
Utils->DoOneToOne(source->uuid, "STATS", params, params[1]);
}
@@ -234,7 +234,7 @@ bool TreeSocket::OperType(const std::string &prefix, std::deque<std::string> &pa
if (params.size() != 1)
return true;
std::string opertype = params[0];
- userrec* u = this->Instance->FindNick(prefix);
+ User* u = this->Instance->FindNick(prefix);
if (u)
{
if (!u->IsModeSet('o'))
@@ -276,7 +276,7 @@ bool TreeSocket::ForceNick(const std::string &prefix, std::deque<std::string> &p
if (params.size() < 3)
return true;
- userrec* u = this->Instance->FindNick(params[0]);
+ User* u = this->Instance->FindNick(params[0]);
if (u)
{
@@ -292,7 +292,7 @@ bool TreeSocket::ForceNick(const std::string &prefix, std::deque<std::string> &p
/* buh. UID them */
if (!u->ForceNickChange(u->uuid))
{
- userrec::QuitUser(this->Instance, u, "Nickname collision");
+ User::QuitUser(this->Instance, u, "Nickname collision");
return true;
}
}
@@ -309,7 +309,7 @@ bool TreeSocket::OperQuit(const std::string &prefix, std::deque<std::string> &pa
if (params.size() < 1)
return true;
- userrec* u = this->Instance->FindNick(prefix);
+ User* u = this->Instance->FindNick(prefix);
if (u)
{
@@ -328,13 +328,13 @@ bool TreeSocket::ServiceJoin(const std::string &prefix, std::deque<std::string>
if (!this->Instance->IsChannel(params[1].c_str()))
return true;
- userrec* u = this->Instance->FindNick(params[0]);
+ User* u = this->Instance->FindNick(params[0]);
if (u)
{
/* only join if it's local, otherwise just pass it on! */
if (IS_LOCAL(u))
- chanrec::JoinUser(this->Instance, u, params[1].c_str(), false, "", Instance->Time());
+ Channel::JoinUser(this->Instance, u, params[1].c_str(), false, "", Instance->Time());
Utils->DoOneToAllButSender(prefix,"SVSJOIN",params,prefix);
}
return true;
@@ -348,8 +348,8 @@ bool TreeSocket::ServicePart(const std::string &prefix, std::deque<std::string>
if (!this->Instance->IsChannel(params[1].c_str()))
return true;
- userrec* u = this->Instance->FindNick(params[0]);
- chanrec* c = this->Instance->FindChan(params[1]);
+ User* u = this->Instance->FindNick(params[0]);
+ Channel* c = this->Instance->FindChan(params[1]);
if (u)
{
@@ -386,7 +386,7 @@ bool TreeSocket::RemoteKill(const std::string &prefix, std::deque<std::string> &
if (params.size() != 2)
return true;
- userrec* who = this->Instance->FindNick(params[0]);
+ User* who = this->Instance->FindNick(params[0]);
if (who)
{
@@ -401,7 +401,7 @@ bool TreeSocket::RemoteKill(const std::string &prefix, std::deque<std::string> &
// NOTE: This is safe with kill hiding on, as RemoteKill is only reached if we have a server prefix.
// in short this is not executed for USERS.
who->Write(":%s KILL %s :%s (%s)", prefix.c_str(), who->nick, prefix.c_str(), reason.c_str());
- userrec::QuitUser(this->Instance,who,reason);
+ User::QuitUser(this->Instance,who,reason);
}
return true;
}
@@ -434,7 +434,7 @@ bool TreeSocket::LocalPong(const std::string &prefix, std::deque<std::string> &p
* dump the PONG reply back to their fd. If its a server, do nowt.
* Services might want to send these s->s, but we dont need to yet.
*/
- userrec* u = this->Instance->FindNick(prefix);
+ User* u = this->Instance->FindNick(prefix);
if (u)
{
u->WriteServ("PONG %s %s",params[0].c_str(),params[1].c_str());
@@ -467,7 +467,7 @@ bool TreeSocket::MetaData(const std::string &prefix, std::deque<std::string> &pa
}
else if (*(params[0].c_str()) == '#')
{
- chanrec* c = this->Instance->FindChan(params[0]);
+ Channel* c = this->Instance->FindChan(params[0]);
if (c)
{
FOREACH_MOD_I(this->Instance,I_OnDecodeMetaData,OnDecodeMetaData(TYPE_CHANNEL,c,params[1],params[2]));
@@ -475,7 +475,7 @@ bool TreeSocket::MetaData(const std::string &prefix, std::deque<std::string> &pa
}
else if (*(params[0].c_str()) != '#')
{
- userrec* u = this->Instance->FindNick(params[0]);
+ User* u = this->Instance->FindNick(params[0]);
if (u)
{
FOREACH_MOD_I(this->Instance,I_OnDecodeMetaData,OnDecodeMetaData(TYPE_USER,u,params[1],params[2]));
@@ -508,7 +508,7 @@ bool TreeSocket::ChangeHost(const std::string &prefix, std::deque<std::string> &
{
if (params.size() < 1)
return true;
- userrec* u = this->Instance->FindNick(prefix);
+ User* u = this->Instance->FindNick(prefix);
if (u)
{
@@ -587,7 +587,7 @@ bool TreeSocket::ChangeName(const std::string &prefix, std::deque<std::string> &
{
if (params.size() < 1)
return true;
- userrec* u = this->Instance->FindNick(prefix);
+ User* u = this->Instance->FindNick(prefix);
if (u)
{
u->ChangeName(params[0].c_str());
@@ -601,16 +601,16 @@ bool TreeSocket::Whois(const std::string &prefix, std::deque<std::string> &param
{
if (params.size() < 1)
return true;
- userrec* u = this->Instance->FindNick(prefix);
+ User* u = this->Instance->FindNick(prefix);
if (u)
{
// an incoming request
if (params.size() == 1)
{
- userrec* x = this->Instance->FindNick(params[0]);
+ User* x = this->Instance->FindNick(params[0]);
if ((x) && (IS_LOCAL(x)))
{
- userrec* x = this->Instance->FindNick(params[0]);
+ User* x = this->Instance->FindNick(params[0]);
char signon[MAXBUF];
char idle[MAXBUF];
snprintf(signon, MAXBUF, "%lu", (unsigned long)x->signon);
@@ -632,7 +632,7 @@ bool TreeSocket::Whois(const std::string &prefix, std::deque<std::string> &param
else if (params.size() == 3)
{
std::string who_did_the_whois = params[0];
- userrec* who_to_send_to = this->Instance->FindNick(who_did_the_whois);
+ User* who_to_send_to = this->Instance->FindNick(who_did_the_whois);
if ((who_to_send_to) && (IS_LOCAL(who_to_send_to)))
{
// an incoming reply to a whois we sent out
@@ -659,7 +659,7 @@ bool TreeSocket::Push(const std::string &prefix, std::deque<std::string> &params
{
if (params.size() < 2)
return true;
- userrec* u = this->Instance->FindNick(params[0]);
+ User* u = this->Instance->FindNick(params[0]);
if (!u)
return true;
if (IS_LOCAL(u))
@@ -710,7 +710,7 @@ bool TreeSocket::Time(const std::string &prefix, std::deque<std::string> &params
// someone querying our time?
if (this->Instance->Config->ServerName == params[0] || this->Instance->Config->GetSID() == params[0])
{
- userrec* u = this->Instance->FindNick(params[1]);
+ User* u = this->Instance->FindNick(params[1]);
if (u)
{
params.push_back(ConvToStr(Instance->Time(false)));
@@ -721,7 +721,7 @@ bool TreeSocket::Time(const std::string &prefix, std::deque<std::string> &params
else
{
// not us, pass it on
- userrec* u = this->Instance->FindNick(params[1]);
+ User* u = this->Instance->FindNick(params[1]);
if (u)
Utils->DoOneToOne(prefix,"TIME",params,params[0]);
}
@@ -729,7 +729,7 @@ bool TreeSocket::Time(const std::string &prefix, std::deque<std::string> &params
else if (params.size() == 3)
{
// a response to a previous TIME
- userrec* u = this->Instance->FindNick(params[1]);
+ User* u = this->Instance->FindNick(params[1]);
if ((u) && (IS_LOCAL(u)))
{
time_t rawtime = atol(params[2].c_str());
@@ -784,7 +784,7 @@ bool TreeSocket::RemoveStatus(const std::string &prefix, std::deque<std::string>
{
if (params.size() < 1)
return true;
- chanrec* c = Instance->FindChan(params[0]);
+ Channel* c = Instance->FindChan(params[0]);
if (c)
{
for (char modeletter = 'A'; modeletter <= 'z'; modeletter++)
@@ -1208,7 +1208,7 @@ bool TreeSocket::ProcessLine(std::string &line)
{
std::string direction = prefix;
- userrec *t = this->Instance->FindUUID(prefix);
+ User *t = this->Instance->FindUUID(prefix);
if (t)
{
direction = t->server;
@@ -1239,10 +1239,10 @@ bool TreeSocket::ProcessLine(std::string &line)
if ((command == "MODE") && (params.size() >= 2))
{
- chanrec* channel = Instance->FindChan(params[0]);
+ Channel* channel = Instance->FindChan(params[0]);
if (channel)
{
- userrec* x = Instance->FindNick(prefix);
+ User* x = Instance->FindNick(prefix);
if (x)
{
if (warned.find(x->server) == warned.end())
@@ -1421,8 +1421,8 @@ bool TreeSocket::ProcessLine(std::string &line)
std::string sourceserv = this->myhost;
if (params.size() == 3)
{
- userrec* user = this->Instance->FindNick(params[1]);
- chanrec* chan = this->Instance->FindChan(params[0]);
+ User* user = this->Instance->FindNick(params[1]);
+ Channel* chan = this->Instance->FindChan(params[0]);
if (user && chan)
{
if (!chan->ServerKickUser(user, params[2].c_str(), false))
@@ -1504,7 +1504,7 @@ bool TreeSocket::ProcessLine(std::string &line)
* Not a special s2s command. Emulate the user doing it.
* This saves us having a huge ugly command parser again.
*/
- userrec *who = this->Instance->FindUUID(prefix);
+ User *who = this->Instance->FindUUID(prefix);
std::string sourceserv = this->myhost;
if (!this->InboundServerName.empty())
@@ -1539,7 +1539,7 @@ bool TreeSocket::ProcessLine(std::string &line)
* already exist here. If it does, kill their copy,
* and our copy.
*/
- userrec* x = this->Instance->FindNickOnly(params[0]);
+ User* x = this->Instance->FindNickOnly(params[0]);
if ((x) && (x != who))
{
int collideret = 0;
@@ -1567,11 +1567,11 @@ Old nickname collision logic..
p.push_back(prefix);
p.push_back(":Nickname collision");
Utils->DoOneToMany(this->Instance->Config->ServerName,"KILL",p);
- userrec::QuitUser(this->Instance,x,"Nickname collision ("+prefix+" -> "+params[0]+")");
- userrec* y = this->Instance->FindNick(prefix);
+ User::QuitUser(this->Instance,x,"Nickname collision ("+prefix+" -> "+params[0]+")");
+ User* y = this->Instance->FindNick(prefix);
if (y)
{
- userrec::QuitUser(this->Instance,y,"Nickname collision");
+ User::QuitUser(this->Instance,y,"Nickname collision");
}
return Utils->DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params);
*/
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index abc251ab0..4814013e6 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -230,7 +230,7 @@ void SpanningTreeUtilities::AddThisServer(TreeServer* server, TreeServerList &li
}
/* returns a list of DIRECT servernames for a specific channel */
-void SpanningTreeUtilities::GetListOfServersForChannel(chanrec* c, TreeServerList &list, char status, const CUList &exempt_list)
+void SpanningTreeUtilities::GetListOfServersForChannel(Channel* c, TreeServerList &list, char status, const CUList &exempt_list)
{
CUList *ulist;
switch (status)
@@ -277,7 +277,7 @@ bool SpanningTreeUtilities::DoOneToAllButSenderRaw(const std::string &data, cons
if ((*(params[0].c_str()) != '#') && (*(params[0].c_str()) != '$'))
{
// special routing for private messages/notices
- userrec* d = ServerInstance->FindNick(params[0]);
+ User* d = ServerInstance->FindNick(params[0]);
if (d)
{
std::deque<std::string> par;
@@ -297,8 +297,8 @@ bool SpanningTreeUtilities::DoOneToAllButSenderRaw(const std::string &data, cons
}
else
{
- chanrec* c = ServerInstance->FindChan(params[0]);
- userrec* u = ServerInstance->FindNick(prefix);
+ Channel* c = ServerInstance->FindChan(params[0]);
+ User* u = ServerInstance->FindNick(prefix);
if (c && u)
{
CUList elist;
diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h
index 0203e7602..aeb89c6be 100644
--- a/src/modules/m_spanningtree/utils.h
+++ b/src/modules/m_spanningtree/utils.h
@@ -158,7 +158,7 @@ class SpanningTreeUtilities
void AddThisServer(TreeServer* server, TreeServerList &list);
/** Compile a list of servers which contain members of channel c
*/
- void GetListOfServersForChannel(chanrec* c, TreeServerList &list, char status, const CUList &exempt_list);
+ void GetListOfServersForChannel(Channel* c, TreeServerList &list, char status, const CUList &exempt_list);
/** Find a server by name
*/
TreeServer* FindServer(const std::string &ServerName);