1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
18 #include "httpclient.h"
20 /* $ModDep: httpclient.h */
22 class MyModule : public Module
27 MyModule(InspIRCd* Me)
30 Implementation eventlist[] = { I_OnRequest, I_OnUserJoin, I_OnUserPart };
31 ServerInstance->Modules->Attach(eventlist, this, 3);
38 virtual void Implements(char* List)
40 List[I_OnRequest] = List[I_OnUserJoin] = List[I_OnUserPart] = 1;
43 virtual Version GetVersion()
45 return Version(1,0,0,1,VF_VENDOR,API_VERSION);
48 virtual void OnUserJoin(User* user, Channel* channel, bool &silent)
50 // method called when a user joins a channel
52 std::string chan = channel->name;
53 std::string nick = user->nick;
54 ServerInstance->Log(DEBUG,"User " + nick + " joined " + chan);
56 Module* target = ServerInstance->Modules->Find("m_http_client.so");
59 HTTPClientRequest req(ServerInstance, this, target, "http://znc.in/~psychon");
63 ServerInstance->Log(DEBUG,"module not found, load it!!");
66 char* OnRequest(Request* req)
68 HTTPClientResponse* resp = (HTTPClientResponse*)req;
69 if(!strcmp(resp->GetId(), HTTP_CLIENT_RESPONSE))
71 ServerInstance->Log(DEBUG, resp->GetData());
76 virtual void OnUserPart(User* user, Channel* channel, const std::string &partmessage, bool &silent)