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