- 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 0;
- }
-
- // 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 OnSyncUserMetaData(User* user, Module* proto, void* opaque, const std::string &extname, bool displayable)
- {
- // check if the linking module wants to know about OUR metadata
- if (extname == "ctitle")
- {
- // check if this user has an ctitle field to send
- std::string* ctitle;
- user->GetExt("ctitle", ctitle);
- if (ctitle)
- {
- // call this function in the linking module, let it format the data how it
- // sees fit, and send it on its way. We dont need or want to know how.
- proto->ProtoSendMetaData(opaque,TYPE_USER,user,extname,*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;
- user->GetExt("ctitle", ctitle);
- if (ctitle)
- {
- user->Shrink("ctitle");
- delete ctitle;
- }
- }
-
- // if the module is unloaded, tidy up all our dangling metadata
- virtual void OnCleanup(int target_type, void* item)
- {
- if (target_type == TYPE_USER)
- {
- User* user = (User*)item;
- std::string* ctitle;
- user->GetExt("ctitle", ctitle);