Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[chansaver] Correctly load from all module types

  • Loading branch information...
commit bc795f03cb6e83a0988d5892e52f5f4c13bf2226 1 parent 66ea539
@kylef kylef authored
Showing with 11 additions and 7 deletions.
  1. +11 −7 modules/chansaver.cpp
View
18 modules/chansaver.cpp
@@ -25,12 +25,16 @@ class CChanSaverMod : public CModule {
MODCONSTRUCTOR(CChanSaverMod) {
m_bWriteConf = false;
- if (GetNetwork()) {
- LoadNetwork(*GetNetwork());
- } else if (GetUser()) {
- LoadUser(*GetUser());
- } else {
- LoadUsers();
+ switch (GetType()) {
+ case CModInfo::GlobalModule:
+ LoadUsers();
+ break;
+ case CModInfo::UserModule:
+ LoadUser(*GetUser());
+ break;
+ case CModInfo::NetworkModule:
+ LoadNetwork(*GetNetwork());
+ break;
}
}
@@ -108,7 +112,7 @@ class CChanSaverMod : public CModule {
template<> void TModInfo<CChanSaverMod>(CModInfo& Info) {
Info.SetWikiPage("chansaver");
Info.AddType(CModInfo::NetworkModule);
- Info.AddType(CModInfo::UserModule);
+ Info.AddType(CModInfo::GlobalModule);
}
USERMODULEDEFS(CChanSaverMod, "Keep config up-to-date when user joins/parts")
Please sign in to comment.
Something went wrong with that request. Please try again.