From 62c54789a468b7642147cf338a12df7a8ac59971 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 4 Jul 2012 23:20:41 +0200 Subject: m_spanningtree Simplify OnMode and OnSetAway handlers --- src/modules/m_spanningtree/main.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/modules') 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; -- cgit v1.2.3