* limitations under the License.
*/
+#include <znc/IRCNetwork.h>
#include <znc/Modules.h>
#include <znc/Chan.h>
}
}
+ void OnOp2(const CNick* pOpNick, const CNick& Nick, CChan& Channel, bool bNoChange) override {
+ if (Nick.NickEquals(GetNetwork()->GetNick())) {
+ const map<CString,CNick>& msNicks = Channel.GetNicks();
+
+ for (const auto& it : msNicks) {
+ if (!it.second.HasPerm(CChan::Voice)) {
+ CheckAutoVoice(it.second, Channel);
+ }
+ }
+ }
+ }
+
+ bool CheckAutoVoice(const CNick& Nick, CChan& Channel) {
+ CAutoVoiceUser *pUser = FindUserByHost(Nick.GetHostMask(), Channel.GetName());
+ if (!pUser) {
+ return false;
+ }
+
+ PutIRC("MODE " + Channel.GetName() + " +v " + Nick.GetNick());
+ return true;
+ }
+
void OnAddUserCommand(const CString& sLine) {
CString sUser = sLine.Token(1);
CString sHost = sLine.Token(2);