Skip to content

Instantly share code, notes, and snippets.

@xatlas
Created September 18, 2017 20:23
Show Gist options
  • Save xatlas/1fd6e26c64ed7513a9b59e61c36331e5 to your computer and use it in GitHub Desktop.
Save xatlas/1fd6e26c64ed7513a9b59e61c36331e5 to your computer and use it in GitHub Desktop.
Módulo que deopea automáticamente cuando CHaN te da Op en el canal indicado
/*
* Copyright (C) 2004-2017 ZNC, see the NOTICE file for details.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <znc/Client.h>
#include <znc/Chan.h>
#include <znc/Modules.h>
#include <znc/IRCNetwork.h>
#include <znc/IRCSock.h>
// Change this
std::string CHANNEL = "#irc-hispano";
std::string CHANSERV = "CHaN";
// End
using std::vector;
class CAutodeop : public CModule {
public:
MODCONSTRUCTOR(CAutodeop) {}
bool OnBoot() override {
return true;
}
void OnOp(const CNick& OpNick, const CNick& Nick,
CChan& Channel, bool bNoChange) override {
CIRCSock* pIRCSock = GetNetwork()->GetIRCSock();
if (OpNick.GetNick().Equals(CHANSERV)
&& Nick.GetNick().Equals(pIRCSock->GetNick())
&& Channel.GetName().Equals(CHANNEL))
{
PutIRC("MODE " + Channel.GetName() + " -o " + pIRCSock->GetNick());
}
}
};
template <>
void TModInfo<CAutodeop>(CModInfo& Info) {
Info.SetHasArgs(false);
}
MODULEDEFS(CAutodeop, "Autodeops yourself automatically when ChanServ gives you Op in specified channel")
@xatlas
Copy link
Author

xatlas commented Apr 14, 2020

Actualmente el uso de este módulo carece de sentido en IRC-Hispano debido a la transición al nuevo ircd y servicios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment