aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/idle.cpp
diff options
context:
space:
mode:
authorGravatar attilamolnar2013-08-19 19:11:02 +0200
committerGravatar attilamolnar2013-08-25 13:42:01 +0200
commitd9d9cbe025f94523265daa72de7596467d71f5c8 (patch)
tree3bd29833312c61949ddbbcb6cfa815c4de5781ce /src/modules/m_spanningtree/idle.cpp
parentClean up the protocol interface (diff)
m_spanningtree Allow server-to-server command handlers to specify whether they accept servers, remote users or both as the command source
To make life easier for handlers accepting servers only as source, pass them a TreeServer* so they don't have to call FindServer()
Diffstat (limited to 'src/modules/m_spanningtree/idle.cpp')
-rw-r--r--src/modules/m_spanningtree/idle.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/modules/m_spanningtree/idle.cpp b/src/modules/m_spanningtree/idle.cpp
index 57692ddf5..679948a51 100644
--- a/src/modules/m_spanningtree/idle.cpp
+++ b/src/modules/m_spanningtree/idle.cpp
@@ -21,17 +21,19 @@
#include "utils.h"
#include "commands.h"
-CmdResult CommandIdle::Handle(User* issuer, std::vector<std::string>& params)
+CmdResult CommandIdle::HandleRemote(RemoteUser* issuer, std::vector<std::string>& params)
{
- /* If this is a request, this user did the /whois
- * If this is a reply, this user's information is in params[1] and params[2]
+ /**
+ * There are two forms of IDLE: request and reply. Requests have one parameter,
+ * replies have more than one.
+ *
+ * If this is a request, 'issuer' did a /whois and its server wants to learn the
+ * idle time of the user in params[0].
+ *
+ * If this is a reply, params[0] is the user who did the whois and params.back() is
+ * the number of seconds 'issuer' has been idle.
*/
- if (IS_SERVER(issuer))
- return CMD_FAILURE;
- /* If this is a request, this is the user whose idle information was requested
- * If this is a reply, this user did the /whois
- */
User* target = ServerInstance->FindUUID(params[0]);
if ((!target) || (IS_SERVER(target)))
return CMD_FAILURE;