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/greet.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 plugins/greet.cpp (limited to 'plugins/greet.cpp') diff --git a/plugins/greet.cpp b/plugins/greet.cpp new file mode 100644 index 0000000..8ac5820 --- /dev/null +++ b/plugins/greet.cpp @@ -0,0 +1,31 @@ +#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=0; +} + +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)) + { + list foo=parent->get_parent()->get_channel_users(parent->get_name()).give_list(); + for (list::iterator it=foo.begin(); it!=foo.end(); it++) + parent->say ("hello, "+*it+"!"); + } + else + { + parent->say ("sorry, you aren't a user, "+msg.origin+"!"); + } +} -- cgit v1.2.1