diff options
| author | 2018-08-12 14:56:27 +0100 | |
|---|---|---|
| committer | 2018-08-12 15:01:45 +0100 | |
| commit | ba23c2b115ad3bf2632179d283165c1579332fd8 (patch) | |
| tree | 992b199acb6e10e75ab18422147de1cf377a65b4 /src/modules/m_spanningtree/main.cpp | |
| parent | Pass the Extensible container to ExtensionItem::free(). (diff) | |
Convert AWAY to use cross-module events and clean up slightly.
OnSetAway has been replaced with four events. OnUserPreAway and
OnUserPreBack can be used to deny an away state change and/or
change the away message of a local user. OnUserAway and OnUserBack
allow modules to be notified that a user's away state has changed.
Diffstat (limited to 'src/modules/m_spanningtree/main.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/main.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index c7e55c66c..3c9089115 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -37,7 +37,8 @@ #include "translate.h" ModuleSpanningTree::ModuleSpanningTree() - : Stats::EventListener(this) + : Away::EventListener(this) + , Stats::EventListener(this) , rconnect(this) , rsquit(this) , map(this) @@ -718,12 +719,16 @@ void ModuleSpanningTree::OnDelLine(User* user, XLine *x) params.Broadcast(); } -ModResult ModuleSpanningTree::OnSetAway(User* user, const std::string &awaymsg) +void ModuleSpanningTree::OnUserAway(User* user) { if (IS_LOCAL(user)) - CommandAway::Builder(user, awaymsg).Broadcast(); + CommandAway::Builder(user).Broadcast(); +} - return MOD_RES_PASSTHRU; +void ModuleSpanningTree::OnUserBack(User* user) +{ + if (IS_LOCAL(user)) + CommandAway::Builder(user).Broadcast(); } void ModuleSpanningTree::OnMode(User* source, User* u, Channel* c, const Modes::ChangeList& modes, ModeParser::ModeProcessFlag processflags, const std::string& output_mode) |
