summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/users.h2
-rw-r--r--src/modules/m_messageflood.cpp8
-rw-r--r--src/users.cpp12
3 files changed, 22 insertions, 0 deletions
diff --git a/include/users.h b/include/users.h
index d89a0f11f..c22964a4c 100644
--- a/include/users.h
+++ b/include/users.h
@@ -315,6 +315,8 @@ class userrec : public connection
void MakeHost(char* nhost);
+ char* MakeWildHost();
+
/** Shuts down and closes the user's socket
*/
void CloseSocket();
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp
index c88c93577..1f07e8155 100644
--- a/src/modules/m_messageflood.cpp
+++ b/src/modules/m_messageflood.cpp
@@ -181,6 +181,14 @@ class ModuleMsgFlood : public Module
{
/* Youre outttta here! */
f->clear(user);
+ if (f->ban)
+ {
+ char* parameters[3];
+ parameters[0] = dest->name;
+ parameters[1] = "+b";
+ parameters[2] = user->MakeWildHost();
+ Srv->SendMode(parameters,3,user);
+ }
Srv->KickUser(NULL, user, dest, "Channel flood triggered (mode +f)");
return 1;
}
diff --git a/src/users.cpp b/src/users.cpp
index f6ada52c8..8bc2f8baa 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -114,6 +114,18 @@ char* userrec::GetFullHost()
return result;
}
+char* userrec::MakeWildHost()
+{
+ static char nresult[MAXBUF];
+ char* t = nresult;
+ *t++ = '*'; *t++ = '!';
+ *t++ = '*'; *t++ = '@';
+ for(char* n = dhost; *n; n++)
+ *t++ = *n;
+ *t = 0;
+ return nresult;
+}
+
int userrec::ReadData(void* buffer, size_t size)
{
if (this->fd > -1)