summaryrefslogtreecommitdiff
path: root/modules/m_xmlrpc_main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/m_xmlrpc_main.cpp')
-rw-r--r--modules/m_xmlrpc_main.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/m_xmlrpc_main.cpp b/modules/m_xmlrpc_main.cpp
index 13645bc98..38cb4a8d7 100644
--- a/modules/m_xmlrpc_main.cpp
+++ b/modules/m_xmlrpc_main.cpp
@@ -59,6 +59,8 @@ class MyXMLRPCEvent : public XMLRPCEvent
this->DoUser(iface, client, request);
else if (request.name == "opers")
this->DoOperType(iface, client, request);
+ else if (request.name == "notice")
+ this->DoNotice(iface, client, request);
return true;
}
@@ -249,6 +251,21 @@ class MyXMLRPCEvent : public XMLRPCEvent
request.reply(ot->GetName(), perms);
}
}
+
+ void DoNotice(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request)
+ {
+ Anope::string from = request.data.size() > 0 ? request.data[0] : "";
+ Anope::string to = request.data.size() > 1 ? request.data[1] : "";
+ Anope::string message = request.data.size() > 2 ? request.data[2] : "";
+
+ BotInfo *bi = BotInfo::Find(from, true);
+ User *u = User::Find(to, true);
+
+ if (!bi || !u || message.empty())
+ return;
+
+ u->SendMessage(bi, message);
+ }
};
class ModuleXMLRPCMain : public Module