- /* Insert our numeric before 312 */
- std::string* ctitle;
- if (dest->GetExt("ctitle", ctitle))
- {
- ServerInstance->SendWhoisLine(user, dest, 320, "%s %s :%s",user->nick.c_str(), dest->nick.c_str(), ctitle->c_str());
- }
- }
- /* Dont block anything */
- return MOD_RES_PASSTHRU;
- }
-
- // Whenever the linking module wants to send out data, but doesnt know what the data
- // represents (e.g. it is metadata, added to a User or Channel by a module) then
- // this method is called. We should use the ProtoSendMetaData function after we've
- // corrected decided how the data should look, to send the metadata on its way if
- // it is ours.
- virtual void OnSyncUser(User* user, Module* proto, void* opaque)
- {
- // check if this user has an ctitle field to send
- std::string* ctitle;
- if (user->GetExt("ctitle", ctitle))
- proto->ProtoSendMetaData(opaque,user,"ctitle",*ctitle);
- }
-
- // when a user quits, tidy up their metadata
- virtual void OnUserQuit(User* user, const std::string &message, const std::string &oper_message)
- {
- std::string* ctitle;
- if (user->GetExt("ctitle", ctitle))
- {
- user->Shrink("ctitle");
- delete ctitle;
+ reference<ConfigTag> tag = i->second;
+ std::string name = tag->getString("name", "", 1);
+ if (name.empty())
+ throw ModuleException("<title:name> is empty at " + tag->getTagLocation());
+
+ std::string pass = tag->getString("password");
+ if (pass.empty())
+ throw ModuleException("<title:password> is empty at " + tag->getTagLocation());
+
+ std::string hash = tag->getString("hash");
+ std::string host = tag->getString("host", "*@*");
+ std::string title = tag->getString("title");
+ std::string vhost = tag->getString("vhost");
+ CustomTitle config(name, pass, hash, host, title, vhost);
+ newtitles.insert(std::make_pair(name, config));