+ if ((command != "OPER") || (result != CMD_SUCCESS))
+ return;
+
+ std::string swhois;
+
+ for (int i = 0; i < Conf->Enumerate("oper"); i++)
+ {
+ std::string name = Conf->ReadValue("oper", "name", i);
+
+ if (name == params[0])
+ {
+ swhois = Conf->ReadValue("oper", "swhois", i);
+ break;
+ }
+ }
+
+ if (!swhois.length())
+ {
+ for (int i = 0; i < Conf->Enumerate("type"); i++)
+ {
+ std::string type = Conf->ReadValue("type", "name", i);
+
+ if (type == user->oper)
+ {
+ swhois = Conf->ReadValue("type", "swhois", i);
+ break;
+ }
+ }
+ }
+
+ std::string *old;
+ if (user->GetExt("swhois", old))
+ {
+ user->Shrink("swhois");
+ DELETE(old);
+ }
+
+ if (!swhois.length())
+ return;
+
+ std::string *text = new std::string(swhois);
+ user->Extend("swhois", text);
+ std::deque<std::string>* metadata = new std::deque<std::string>;
+ metadata->push_back(user->nick);
+ metadata->push_back("swhois"); // The metadata id
+ metadata->push_back(*text); // The value to send
+ Event event((char*)metadata,(Module*)this,"send_metadata");
+ event.Send(ServerInstance);
+ delete metadata;