Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change the order that modules are looked up in /msg *module

The new order is as follows:
    Network Module
    User Module
    Global Module
  • Loading branch information...
commit 9b746dcc31acc1745b1a09fca7a7e1191ec7b8a6 1 parent 0b1627c
Kyle Fuller kylef authored
Showing with 41 additions and 49 deletions.
  1. +41 −49 Client.cpp
90 Client.cpp
View
@@ -15,55 +15,47 @@
#include "znc.h"
#include "WebModules.h"
-#define CALLMOD(MOD, CLIENT, USER, NETWORK, FUNC) { \
- CModule* pModule = CZNC::Get().GetModules().FindModule(MOD); \
- if (pModule) { \
- try { \
- pModule->SetClient(CLIENT); \
- pModule->SetNetwork(NETWORK); \
- pModule->SetUser(USER); \
- pModule->FUNC; \
- pModule->SetClient(NULL); \
- pModule->SetNetwork(NULL); \
- pModule->SetUser(NULL); \
- } catch (CModule::EModException e) { \
- if (e == CModule::UNLOAD) { \
- CZNC::Get().GetModules().UnloadModule(MOD); \
- } \
- } \
- } else { \
- pModule = (USER)->GetModules().FindModule(MOD); \
- if (pModule) { \
- try { \
- pModule->SetClient(CLIENT); \
- pModule->SetNetwork(NETWORK); \
- pModule->FUNC; \
- pModule->SetClient(NULL); \
- pModule->SetNetwork(NULL); \
- } catch (CModule::EModException e) { \
- if (e == CModule::UNLOAD) { \
- (USER)->GetModules().UnloadModule(MOD); \
- } \
- } \
- } else if (NETWORK) { \
- pModule = (NETWORK)->GetModules().FindModule(MOD); \
- if (pModule) { \
- try { \
- pModule->SetClient(CLIENT); \
- pModule->FUNC; \
- pModule->SetClient(NULL); \
- } catch (CModule::EModException e) { \
- if (e == CModule::UNLOAD) { \
- (NETWORK)->GetModules().UnloadModule(MOD); \
- } \
- } \
- } else { \
- PutStatus("No such module [" + MOD + "]"); \
- } \
- } else { \
- PutStatus("No such module [" + MOD + "]"); \
- } \
- } \
+#define CALLMOD(MOD, CLIENT, USER, NETWORK, FUNC) { \
+ CModule *pModule = (NETWORK)->GetModules().FindModule(MOD); \
+ if (pModule) { \
+ try { \
+ pModule->SetClient(CLIENT); \
+ pModule->FUNC; \
+ pModule->SetClient(NULL); \
+ } catch (CModule::EModException e) { \
+ if (e == CModule::UNLOAD) { \
+ (NETWORK)->GetModules().UnloadModule(MOD); \
+ } \
+ } \
+ } else if ((pModule = (USER)->GetModules().FindModule(MOD))) { \
+ try { \
+ pModule->SetClient(CLIENT); \
+ pModule->SetNetwork(NETWORK); \
+ pModule->FUNC; \
+ pModule->SetClient(NULL); \
+ pModule->SetNetwork(NULL); \
+ } catch (CModule::EModException e) { \
+ if (e == CModule::UNLOAD) { \
+ (USER)->GetModules().UnloadModule(MOD); \
+ } \
+ } \
+ } else if ((pModule = CZNC::Get().GetModules().FindModule(MOD))) { \
+ try { \
+ pModule->SetClient(CLIENT); \
+ pModule->SetNetwork(NETWORK); \
+ pModule->SetUser(USER); \
+ pModule->FUNC; \
+ pModule->SetClient(NULL); \
+ pModule->SetNetwork(NULL); \
+ pModule->SetUser(NULL); \
+ } catch (CModule::EModException e) { \
+ if (e == CModule::UNLOAD) { \
+ CZNC::Get().GetModules().UnloadModule(MOD); \
+ } \
+ } \
+ } else { \
+ PutStatus("No such module [" + MOD + "]"); \
+ } \
}
CClient::~CClient() {
Please sign in to comment.
Something went wrong with that request. Please try again.