aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/away.cpp
diff options
context:
space:
mode:
authorGravatar attilamolnar2013-08-19 20:22:15 +0200
committerGravatar attilamolnar2013-08-27 15:33:05 +0200
commit7e7e773d4d43e68c18c19e2ec712f4250e5f756d (patch)
treea446c63b439f3854ad2da6d8bd8d4dce9715b38a /src/modules/m_spanningtree/away.cpp
parentm_spanningtree Changes to TreeSocket::WriteLine() to avoid string copies (diff)
m_spanningtree Introduce command builders
Diffstat (limited to 'src/modules/m_spanningtree/away.cpp')
-rw-r--r--src/modules/m_spanningtree/away.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/away.cpp b/src/modules/m_spanningtree/away.cpp
index 7b151dfef..9c4ec5783 100644
--- a/src/modules/m_spanningtree/away.cpp
+++ b/src/modules/m_spanningtree/away.cpp
@@ -43,3 +43,16 @@ CmdResult CommandAway::HandleRemote(RemoteUser* u, std::vector<std::string>& par
}
return CMD_SUCCESS;
}
+
+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);
+}