diff options
| author | 2014-09-03 14:26:40 +0200 | |
|---|---|---|
| committer | 2014-09-03 14:26:40 +0200 | |
| commit | e7e315fc9dbd37218d55a6673ba65503c0bbcc1b (patch) | |
| tree | f65d4ea644952b183bd2c231a14002d8cebd9a0e /src/modules/m_spanningtree/main.cpp | |
| parent | m_spanningtree Add function to serialize parameters in a Modes::ChangeList::L... (diff) | |
| download | inspircd++-e7e315fc9dbd37218d55a6673ba65503c0bbcc1b.tar.gz inspircd++-e7e315fc9dbd37218d55a6673ba65503c0bbcc1b.tar.bz2 inspircd++-e7e315fc9dbd37218d55a6673ba65503c0bbcc1b.zip | |
m_spanningtree Send MODE/FMODE from the OnMode hook
If the MODE_LOCALONLY flag is set the mode change is not propagated
Diffstat (limited to 'src/modules/m_spanningtree/main.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/main.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 74bbf0b8a..c21064683 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -33,6 +33,7 @@ #include "link.h" #include "treesocket.h" #include "commands.h" +#include "translate.h" ModuleSpanningTree::ModuleSpanningTree() : rconnect(this), rsquit(this), map(this) @@ -751,6 +752,33 @@ ModResult ModuleSpanningTree::OnSetAway(User* user, const std::string &awaymsg) return MOD_RES_PASSTHRU; } +void ModuleSpanningTree::OnMode(User* source, User* u, Channel* c, const Modes::ChangeList& modes, ModeParser::ModeProcessFlag processflags, const std::string& output_mode) +{ + if (processflags & ModeParser::MODE_LOCALONLY) + return; + + if (u) + { + if (u->registered != REG_ALL) + return; + + CmdBuilder params(source, "MODE"); + params.push(u->uuid); + params.push(output_mode); + params.push_raw(Translate::ModeChangeListToParams(modes.getlist())); + params.Broadcast(); + } + else + { + CmdBuilder params(source, "FMODE"); + params.push(c->name); + params.push_int(c->age); + params.push(output_mode); + params.push_raw(Translate::ModeChangeListToParams(modes.getlist())); + params.Broadcast(); + } +} + CullResult ModuleSpanningTree::cull() { if (Utils) |
