From dacd393fefeabafd1306533dd6c5a56e0ab347cc Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sun, 27 Feb 2011 18:48:35 +0100 Subject: Initial commit --- plugins/say.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 plugins/say.cpp (limited to 'plugins/say.cpp') diff --git a/plugins/say.cpp b/plugins/say.cpp new file mode 100644 index 0000000..eacd78e --- /dev/null +++ b/plugins/say.cpp @@ -0,0 +1,48 @@ +/* + * say.cpp + * + * Copyright 2009 Florian + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + + +#include + +using namespace std; + +#include +#include + +using namespace std; + +#include "../TConnectionInterface.h" +#include "../TPluginParentLight.h" +#include "../TUserList.h" +#include "../mytypes.h" +#include "../myfuncs.h" + +extern "C" void init(int* csize, int* conndefault, int* chandefault, int* sessdefault) +{ + *csize=0; *conndefault=0; *chandefault=PFLAGS_EXEC_ONDEMAND; *sessdefault=PFLAGS_EXEC_ONDEMAND; +} + +extern "C" void plugin (plugincontext* context, ircmessage msg, TPluginParentLight* parent, int reason) +{ + if (reason&PFLAGS_EXEC_ONDEMAND) + if (ucase(msg.command)=="PRIVMSG") + parent->say (ntharg(msg.content,2)); +} -- cgit v1.2.1