+#include "modules/whois.h"
+
+enum
+{
+ // From UnrealIRCd.
+ RPL_WHOISSPECIAL = 320
+};
+
+struct CustomTitle
+{
+ const std::string name;
+ const std::string password;
+ const std::string hash;
+ const std::string host;
+ const std::string title;
+ const std::string vhost;
+
+ CustomTitle(const std::string& n, const std::string& p, const std::string& h, const std::string& hst, const std::string& t, const std::string& v)
+ : name(n)
+ , password(p)
+ , hash(h)
+ , host(hst)
+ , title(t)
+ , vhost(v)
+ {
+ }
+
+ bool MatchUser(User* user) const
+ {
+ const std::string userHost = user->ident + "@" + user->GetRealHost();
+ const std::string userIP = user->ident + "@" + user->GetIPString();
+ return InspIRCd::MatchMask(host, userHost, userIP);
+ }
+
+ bool CheckPass(User* user, const std::string& pass) const
+ {
+ return ServerInstance->PassCompare(user, password, pass, hash);
+ }
+};
+
+typedef std::multimap<std::string, CustomTitle> CustomVhostMap;
+typedef std::pair<CustomVhostMap::iterator, CustomVhostMap::iterator> MatchingConfigs;