diff options
Diffstat (limited to 'plugins/usertest.cpp')
-rw-r--r-- | plugins/usertest.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/plugins/usertest.cpp b/plugins/usertest.cpp new file mode 100644 index 0000000..b1932a1 --- /dev/null +++ b/plugins/usertest.cpp @@ -0,0 +1,51 @@ +/* + * say.cpp + * + * Copyright 2009 Florian <flo@localhost.localdomain> + * + * 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 <iostream> + +using namespace std; + +#include <iostream> +#include <string> + +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") + if (parent->get_parent()->isuser(msg.origin_raw)) + parent->say("logged in"); + else + parent->say("not logged in"); +} |