- return std::make_pair(false, parameter);
-}
-
-void ModeChannelVoice::RemoveMode(chanrec* channel)
-{
- CUList* list = channel->GetVoicedUsers();
- CUList copy;
- char moderemove[MAXBUF];
- userrec* n = new userrec(ServerInstance);
- n->SetFd(FD_MAGIC_NUMBER);
-
- for (CUList::iterator i = list->begin(); i != list->end(); i++)
- {
- userrec* n = i->first;
- copy.insert(std::make_pair(n,n->nick));
- }
- for (CUList::iterator i = copy.begin(); i != copy.end(); i++)
- {
- sprintf(moderemove,"-%c",this->GetModeChar());
- const char* parameters[] = { channel->name, moderemove, i->first->nick };
- ServerInstance->SendMode(parameters, 3, n);
- }
- delete n;
-}
-
-void ModeChannelVoice::RemoveMode(userrec* user)
-{
-}
-
-ModeAction ModeChannelVoice::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding)
-{
- int status = channel->GetStatus(source);
-
- /* Call the correct method depending on wether we're adding or removing the mode */
- if (adding)
- {
- parameter = this->AddVoice(source, parameter.c_str(), channel, status);
- }
- else
- {
- parameter = this->DelVoice(source, parameter.c_str(), channel, status);
- }
- /* If the method above 'ate' the parameter by reducing it to an empty string, then
- * it won't matter wether we return ALLOW or DENY here, as an empty string overrides
- * the return value and is always MODEACTION_DENY if the mode is supposed to have
- * a parameter.
- */
- if (parameter.length())
- return MODEACTION_ALLOW;
- else
- return MODEACTION_DENY;