+
+ // Try to convert the IP address to a string. If this fails then the user
+ // does not have an IPv4 address in their ident.
+ errno = 0;
+ unsigned long address = strtoul(ident, NULL, 16);
+ if (errno)
+ return false;
+
+ out.in4.sin_family = AF_INET;
+ out.in4.sin_addr.s_addr = htonl(address);
+ return true;
+ }
+};
+
+class CommandWebIRC : public SplitCommand
+{
+ public:
+ std::vector<WebIRCHost> hosts;
+ bool notify;
+ StringExtItem gateway;
+ StringExtItem realhost;
+ StringExtItem realip;
+ UserCertificateAPI sslapi;
+ Events::ModuleEventProvider webircevprov;
+
+ CommandWebIRC(Module* Creator)
+ : SplitCommand(Creator, "WEBIRC", 4)
+ , gateway("cgiirc_gateway", ExtensionItem::EXT_USER, Creator)
+ , realhost("cgiirc_realhost", ExtensionItem::EXT_USER, Creator)
+ , realip("cgiirc_realip", ExtensionItem::EXT_USER, Creator)
+ , sslapi(Creator)
+ , webircevprov(Creator, "event/webirc")
+ {
+ allow_empty_last_param = false;
+ works_before_reg = true;
+ this->syntax = "<password> <gateway> <hostname> <ip> [<flags>]";