#ifndef M_CAP_H
#define M_CAP_H
+class GenericCap;
+
class CapEvent : public Event
{
public:
CapEventType type;
std::vector<std::string> wanted;
std::vector<std::string> ack;
+ std::vector<std::pair<GenericCap*, int> > changed; // HACK: clean this up before 2.2
User* user;
CapEvent(Module* sender, User* u, CapEventType capevtype) : Event(sender, "cap_request"), type(capevtype), user(u) {}
};
const std::string cap;
GenericCap(Module* parent, const std::string &Cap) : ext("cap_" + Cap, parent), cap(Cap)
{
- ServerInstance->Extensions.Register(&ext);
+ ServerInstance->Modules->AddService(ext);
}
void HandleEvent(Event& ev)
// we can handle this, so ACK it, and remove it from the wanted list
data->ack.push_back(*it);
data->wanted.erase(it);
- ext.set(data->user, enablecap ? 1 : 0);
+ data->changed.push_back(std::make_pair(this, ext.set(data->user, enablecap ? 1 : 0)));
break;
}
}