summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/away.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree/away.cpp')
-rw-r--r--src/modules/m_spanningtree/away.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/modules/m_spanningtree/away.cpp b/src/modules/m_spanningtree/away.cpp
index e65b3099b..282f52a35 100644
--- a/src/modules/m_spanningtree/away.cpp
+++ b/src/modules/m_spanningtree/away.cpp
@@ -27,19 +27,19 @@ CmdResult CommandAway::HandleRemote(::RemoteUser* u, Params& params)
{
if (!params.empty())
{
- FOREACH_MOD(OnSetAway, (u, params.back()));
-
if (params.size() > 1)
u->awaytime = ConvToInt(params[0]);
else
u->awaytime = ServerInstance->Time();
u->awaymsg = params.back();
+ FOREACH_MOD_CUSTOM(awayevprov, Away::EventListener, OnUserAway, (u));
}
else
{
- FOREACH_MOD(OnSetAway, (u, ""));
+ u->awaytime = 0;
u->awaymsg.clear();
+ FOREACH_MOD_CUSTOM(awayevprov, Away::EventListener, OnUserBack, (u));
}
return CMD_SUCCESS;
}
@@ -47,12 +47,6 @@ CmdResult CommandAway::HandleRemote(::RemoteUser* u, Params& params)
CommandAway::Builder::Builder(User* user)
: CmdBuilder(user, "AWAY")
{
- push_int(user->awaytime).push_last(user->awaymsg);
-}
-
-CommandAway::Builder::Builder(User* user, const std::string& msg)
- : CmdBuilder(user, "AWAY")
-{
- if (!msg.empty())
- push_int(ServerInstance->Time()).push_last(msg);
+ if (user->awaymsg.empty())
+ push_int(user->awaytime).push_last(user->awaymsg);
}