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 /* $ModDesc: Makes remote /whoises to SSL servers work on a non-ssl server */
20 class ModuleSSLDummy : public Module
26 ModuleSSLDummy(InspIRCd* Me) : Module(Me)
31 virtual ~ModuleSSLDummy()
35 virtual Version GetVersion()
37 return Version(1, 0, 0, 0, VF_VENDOR, API_VERSION);
40 void Implements(char* List)
42 List[I_OnSyncUserMetaData] = List[I_OnDecodeMetaData] = List[I_OnWhois] = 1;
45 // :kenny.chatspike.net 320 Om Epy|AFK :is a Secure Connection
46 virtual void OnWhois(userrec* source, userrec* dest)
48 if(dest->GetExt("ssl", dummy))
50 ServerInstance->SendWhoisLine(source, dest, 320, "%s %s :is using a secure connection", source->nick, dest->nick);
54 virtual void OnSyncUserMetaData(userrec* user, Module* proto, void* opaque, const std::string &extname, bool displayable)
56 // check if the linking module wants to know about OUR metadata
59 // check if this user has an ssl field to send
60 if(user->GetExt(extname, dummy))
62 // call this function in the linking module, let it format the data how it
63 // sees fit, and send it on its way. We dont need or want to know how.
64 proto->ProtoSendMetaData(opaque, TYPE_USER, user, extname, displayable ? "Enabled" : "ON");
69 virtual void OnDecodeMetaData(int target_type, void* target, const std::string &extname, const std::string &extdata)
71 // check if its our metadata key, and its associated with a user
72 if ((target_type == TYPE_USER) && (extname == "ssl"))
74 userrec* dest = (userrec*)target;
75 // if they dont already have an ssl flag, accept the remote server's
76 if (!dest->GetExt(extname, dummy))
78 dest->Extend(extname, "ON");
84 MODULE_INIT(ModuleSSLDummy)