Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update autoop.cpp

Set it so that when you remove all hostmasks of a user, the user is also deleted
  • Loading branch information...
commit baf14adf0ce03b484aadcdd5b9c0ea9da9fce2b1 1 parent 9189e4d
@orchid-hybrid orchid-hybrid authored
Showing with 10 additions and 4 deletions.
  1. +10 −4 modules/autoop.cpp
View
14 modules/autoop.cpp
@@ -89,13 +89,15 @@ class CAutoOpUser {
return CString(" ").Join(m_ssChans.begin(), m_ssChans.end());
}
- void DelHostmasks(const CString& sHostmasks) {
+ bool DelHostmasks(const CString& sHostmasks) {
VCString vsHostmasks;
sHostmasks.Split(",", vsHostmasks);
for (unsigned int a = 0; a < vsHostmasks.size(); a++) {
m_ssHostmasks.erase(vsHostmasks[a]);
}
+
+ return m_ssHostmasks.empty();
}
void AddHostmasks(const CString& sHostmasks) {
@@ -330,11 +332,15 @@ class CAutoOpMod : public CModule {
pUser->AddHostmasks(sHostmasks);
PutModule("Hostmasks(s) added to user [" + pUser->GetUsername() + "]");
} else {
- pUser->DelHostmasks(sHostmasks);
+ if (pUser->DelHostmasks(sHostmasks)) {
+ PutModule("Removed user [" + pUser->GetUsername() + "]");
+ DelUser(sUser);
+ DelNV(sUser);
+ } else {
PutModule("Hostmasks(s) Removed from user [" + pUser->GetUsername() + "]");
+ SetNV(pUser->GetUsername(), pUser->ToString());
+ }
}
-
- SetNV(pUser->GetUsername(), pUser->ToString());
} else {
PutModule("Unknown command, try HELP");
}
Please sign in to comment.
Something went wrong with that request. Please try again.