diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-07-04 23:20:41 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-10-03 00:30:03 +0200 |
commit | 62c54789a468b7642147cf338a12df7a8ac59971 (patch) | |
tree | 4db78483f23179fb3ad60b09db8defc1a9a19277 /src/modules | |
parent | 9a1a6e85f8c3c8792083f0a4042aa3cea48eecae (diff) |
m_spanningtree Simplify OnMode and OnSetAway handlers
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index d8385e47d..34a6437de 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -878,7 +878,6 @@ void ModuleSpanningTree::OnMode(User* user, void* dest, int target_type, const p if ((IS_LOCAL(user)) && (user->registered == REG_ALL)) { parameterlist params; - std::string command; std::string output_text; ServerInstance->Parser->TranslateUIDs(translate, text, output_text); @@ -888,7 +887,7 @@ void ModuleSpanningTree::OnMode(User* user, void* dest, int target_type, const p User* u = (User*)dest; params.push_back(u->uuid); params.push_back(output_text); - command = "MODE"; + Utils->DoOneToMany(user->uuid, "MODE", params); } else { @@ -896,10 +895,8 @@ void ModuleSpanningTree::OnMode(User* user, void* dest, int target_type, const p params.push_back(c->name); params.push_back(ConvToStr(c->age)); params.push_back(output_text); - command = "FMODE"; + Utils->DoOneToMany(user->uuid, "FMODE", params); } - - Utils->DoOneToMany(user->uuid, command, params); } } @@ -907,18 +904,13 @@ ModResult ModuleSpanningTree::OnSetAway(User* user, const std::string &awaymsg) { if (IS_LOCAL(user)) { - if (awaymsg.empty()) - { - parameterlist params; - Utils->DoOneToMany(user->uuid,"AWAY",params); - } - else + parameterlist params; + if (!awaymsg.empty()) { - parameterlist params; params.push_back(ConvToStr(user->awaytime)); params.push_back(":" + awaymsg); - Utils->DoOneToMany(user->uuid,"AWAY",params); } + Utils->DoOneToMany(user->uuid, "AWAY", params); } return MOD_RES_PASSTHRU; |