summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-09 21:51:48 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-09 21:51:48 +0000
commitb94c45340e153254f9dd06ecc3445222f31d0220 (patch)
tree3f0dda82973d84bbbcf08c0e8e1115f89afc3be6 /src/modules
parentc708d7a3c0defba07171a70c68636d0b14abf590 (diff)
Roadmap item "Fix jointhrottle to not try 'throttle' clients during a netmerge (requires changing join event to be aware of netmerge?)" -- 1.2 only
requires an extra parameter to OnUserJoin, bool sync. usually false, but FJOIN code during burst sets it to true. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8552 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_auditorium.cpp2
-rw-r--r--src/modules/m_banredirect.cpp4
-rw-r--r--src/modules/m_chancreate.cpp2
-rw-r--r--src/modules/m_conn_join.cpp2
-rw-r--r--src/modules/m_cycle.cpp2
-rw-r--r--src/modules/m_delayjoin.cpp6
-rw-r--r--src/modules/m_foobar.cpp4
-rw-r--r--src/modules/m_httpd_stats.cpp2
-rw-r--r--src/modules/m_invisible.cpp2
-rw-r--r--src/modules/m_joinflood.cpp8
-rw-r--r--src/modules/m_operjoin.cpp2
-rw-r--r--src/modules/m_redirect.cpp2
-rw-r--r--src/modules/m_sajoin.cpp2
-rw-r--r--src/modules/m_spanningtree/main.cpp2
-rw-r--r--src/modules/m_spanningtree/main.h2
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp2
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp2
17 files changed, 29 insertions, 19 deletions
diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp
index d75175fed..cab6395ef 100644
--- a/src/modules/m_auditorium.cpp
+++ b/src/modules/m_auditorium.cpp
@@ -122,7 +122,7 @@ class ModuleAuditorium : public Module
return 0;
}
- virtual void OnUserJoin(User* user, Channel* channel, bool &silent)
+ virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
{
if (channel->IsModeSet('u'))
{
diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp
index 363da21d7..80a79e25b 100644
--- a/src/modules/m_banredirect.cpp
+++ b/src/modules/m_banredirect.cpp
@@ -258,7 +258,7 @@ class ModuleBanRedirect : public Module
ExceptionModule = ServerInstance->Modules->Find("m_banexception.so");
}
- virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs)
+ virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, bool synching = false)
{
/* This prevents recursion when a user sets multiple ban redirects in a chain
* (thanks Potter)
@@ -307,7 +307,7 @@ class ModuleBanRedirect : public Module
user->WriteServ("474 %s %s :Cannot join channel (You are banned)", user->nick, chan->name);
user->WriteServ("470 %s :You are being automatically redirected to %s", user->nick, redir->targetchan.c_str());
nofollow = true;
- Channel::JoinUser(ServerInstance, user, redir->targetchan.c_str(), false, "", ServerInstance->Time(true));
+ Channel::JoinUser(ServerInstance, user, redir->targetchan.c_str(), false, "", false, ServerInstance->Time(true));
nofollow = false;
return 1;
}
diff --git a/src/modules/m_chancreate.cpp b/src/modules/m_chancreate.cpp
index 3b81799c3..fb111071a 100644
--- a/src/modules/m_chancreate.cpp
+++ b/src/modules/m_chancreate.cpp
@@ -38,7 +38,7 @@ class ModuleChanCreate : public Module
}
- virtual void OnUserJoin(User* user, Channel* channel, bool &silent)
+ virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
{
if (channel->GetUserCounter() == 1)
{
diff --git a/src/modules/m_conn_join.cpp b/src/modules/m_conn_join.cpp
index e87a137cf..4d026aa91 100644
--- a/src/modules/m_conn_join.cpp
+++ b/src/modules/m_conn_join.cpp
@@ -82,7 +82,7 @@ class ModuleConnJoin : public Module
for(std::vector<std::string>::iterator it = Joinchans.begin(); it != Joinchans.end(); it++)
if (ServerInstance->IsChannel(it->c_str()))
- Channel::JoinUser(ServerInstance, user, it->c_str(), false, "", ServerInstance->Time(true));
+ Channel::JoinUser(ServerInstance, user, it->c_str(), false, "", false, ServerInstance->Time(true));
}
};
diff --git a/src/modules/m_cycle.cpp b/src/modules/m_cycle.cpp
index d190eda3c..045ea3ad9 100644
--- a/src/modules/m_cycle.cpp
+++ b/src/modules/m_cycle.cpp
@@ -62,7 +62,7 @@ class CommandCycle : public Command
if (!channel->PartUser(user, reason.c_str()))
delete channel;
- Channel::JoinUser(ServerInstance, user, parameters[0], true, "", ServerInstance->Time(true));
+ Channel::JoinUser(ServerInstance, user, parameters[0], true, "", false, ServerInstance->Time(true));
}
return CMD_LOCALONLY;
diff --git a/src/modules/m_delayjoin.cpp b/src/modules/m_delayjoin.cpp
index 435148c61..9d9a4007e 100644
--- a/src/modules/m_delayjoin.cpp
+++ b/src/modules/m_delayjoin.cpp
@@ -118,7 +118,7 @@ class ModuleDelayJoin : public Module
return 0;
}
- virtual void OnUserJoin(User* user, Channel* channel, bool &silent)
+ virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
{
if (channel->IsModeSet('D'))
{
@@ -191,6 +191,10 @@ class ModuleDelayJoin : public Module
/* Display the join to everyone else (the user who joined got it earlier) */
this->WriteCommonFrom(user, channel, "JOIN %s", channel->name);
+ std::string n = this->ServerInstance->Modes->ModeString(user, channel);
+ if (n.length() > 0)
+ this->WriteCommonFrom(user, channel, "MODE %s +%s", channel->name, n.c_str());
+
/* Shrink off the neccessary metadata for a specific channel */
user->Shrink(std::string("delayjoin_")+channel->name);
diff --git a/src/modules/m_foobar.cpp b/src/modules/m_foobar.cpp
index fb3e8d736..16f2a9863 100644
--- a/src/modules/m_foobar.cpp
+++ b/src/modules/m_foobar.cpp
@@ -68,10 +68,10 @@ class ModuleFoobar : public Module
ServerInstance->Log(DEBUG,"Foobar: User quitting: "+b);
}
- virtual void OnUserJoin(User* user, Channel* channel, bool &silent)
+ virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
{
// method called when a user joins a channel
-
+
std::string c = channel->name;
std::string b = user->nick;
ServerInstance->Log(DEBUG,"Foobar: User "+b+" joined "+c);
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
index 9324e974d..951103271 100644
--- a/src/modules/m_httpd_stats.cpp
+++ b/src/modules/m_httpd_stats.cpp
@@ -186,7 +186,7 @@ class ModuleHttpStats : public Module
this->changed = true;
}
- void OnUserJoin(User* user, Channel* channel, bool &silent)
+ void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
{
StatsIter a = sh->find(channel->name);
if (a != sh->end())
diff --git a/src/modules/m_invisible.cpp b/src/modules/m_invisible.cpp
index 3b419350d..30e7ddfb0 100644
--- a/src/modules/m_invisible.cpp
+++ b/src/modules/m_invisible.cpp
@@ -186,7 +186,7 @@ class ModuleInvisible : public Module
}
- virtual void OnUserJoin(User* user, Channel* channel, bool &silent)
+ virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
{
if (user->IsModeSet('Q'))
{
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp
index a1f1f7a51..effe67dab 100644
--- a/src/modules/m_joinflood.cpp
+++ b/src/modules/m_joinflood.cpp
@@ -239,9 +239,15 @@ class ModuleJoinFlood : public Module
return 0;
}
- virtual void OnUserJoin(User* user, Channel* channel, bool &silent)
+ virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
{
joinfloodsettings *f;
+
+ /* We arent interested in JOIN events caused by a network burst */
+ if (sync)
+ return;
+
+ /* But all others are OK */
if (channel->GetExt("joinflood",f))
{
f->addjoin();
diff --git a/src/modules/m_operjoin.cpp b/src/modules/m_operjoin.cpp
index 243c329c8..c8b4b1eaa 100644
--- a/src/modules/m_operjoin.cpp
+++ b/src/modules/m_operjoin.cpp
@@ -77,7 +77,7 @@ class ModuleOperjoin : public Module
for(std::vector<std::string>::iterator it = operChans.begin(); it != operChans.end(); it++)
if (ServerInstance->IsChannel(it->c_str()))
- Channel::JoinUser(ServerInstance, user, it->c_str(), false, "", ServerInstance->Time(true));
+ Channel::JoinUser(ServerInstance, user, it->c_str(), false, "", false, ServerInstance->Time(true));
}
};
diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp
index 7827fd4ec..373ac097c 100644
--- a/src/modules/m_redirect.cpp
+++ b/src/modules/m_redirect.cpp
@@ -132,7 +132,7 @@ class ModuleRedirect : public Module
}
user->WriteServ("470 %s :%s has become full, so you are automatically being transferred to the linked channel %s", user->nick, cname, channel.c_str());
- Channel::JoinUser(ServerInstance, user, channel.c_str(), false, "", ServerInstance->Time(true));
+ Channel::JoinUser(ServerInstance, user, channel.c_str(), false, "", false, ServerInstance->Time(true));
return 1;
}
}
diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp
index 68f4fd0c0..21bab9150 100644
--- a/src/modules/m_sajoin.cpp
+++ b/src/modules/m_sajoin.cpp
@@ -50,7 +50,7 @@ class CommandSajoin : public Command
*/
if (IS_LOCAL(dest))
{
- Channel::JoinUser(ServerInstance, dest, parameters[1], true, "", ServerInstance->Time(true));
+ Channel::JoinUser(ServerInstance, dest, parameters[1], true, "", false, ServerInstance->Time(true));
/* Fix for dotslasher and w00t - if the join didnt succeed, return CMD_FAILURE so that it doesnt propagate */
Channel* n = ServerInstance->FindChan(parameters[1]);
if (n)
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 5a04ba27e..3c9a9803e 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -557,7 +557,7 @@ void ModuleSpanningTree::OnBackgroundTimer(time_t curtime)
DoPingChecks(curtime);
}
-void ModuleSpanningTree::OnUserJoin(User* user, Channel* channel, bool &silent)
+void ModuleSpanningTree::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
{
// Only do this for local users
if (IS_LOCAL(user))
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index ec2a6f849..f9b63d431 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -166,7 +166,7 @@ class ModuleSpanningTree : public Module
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(User* user, Channel* channel, bool &silent);
+ virtual void OnUserJoin(User* user, Channel* channel, bool sync, 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);
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index 5fbb8ee2b..78db02d8b 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -861,7 +861,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);
- Channel::JoinUser(this->Instance, who, channel.c_str(), true, "", TS);
+ Channel::JoinUser(this->Instance, who, channel.c_str(), true, "", true, TS);
}
else
{
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index b18261c52..c40dd318c 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -338,7 +338,7 @@ bool TreeSocket::ServiceJoin(const std::string &prefix, std::deque<std::string>
{
/* only join if it's local, otherwise just pass it on! */
if (IS_LOCAL(u))
- Channel::JoinUser(this->Instance, u, params[1].c_str(), false, "", Instance->Time());
+ Channel::JoinUser(this->Instance, u, params[1].c_str(), false, "", false, Instance->Time());
Utils->DoOneToAllButSender(prefix,"SVSJOIN",params,prefix);
}
return true;