- Notifications
You must be signed in to change notification settings - Fork382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Initial HalfOps features#1825
base:master
Are you sure you want to change the base?
Conversation
include/znc/Modules.h Outdated
/** Called when a nick is dehalfopped on a channel */ | ||
virtual void OnDeHalfOp2(const CNick* pOpNick, const CNick& Nick, | ||
CChan& Channel, bool bNoChange); | ||
virtual void OnDeHalfOp(const CNick& OpNick, const CNick& Nick, CChan& Channel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
If adding new callbacks, need to update modperl and modpython
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
modperl and modpython updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You've missed thefunction.in
files.
modules/autohalfop.cpp Outdated
Info.SetWikiPage("autohalfop"); | ||
} | ||
NETWORKMODULEDEFS(CAutoHalfOpMod, t_s("Auto halfop the good people")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We shouldn't copypaste/duplicate code like that. A better way would be to have a single module which supports ops, voices, halfops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Perhaps that shall be my second contribution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Perhaps it shall.
I believe merging this PR can wait until that's done though.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## master #1825 +/- ##==========================================- Coverage 41.87% 40.91% -0.97%========================================== Files 122 124 +2 Lines 27799 28471 +672 Branches 33 33 ==========================================+ Hits 11642 11649 +7- Misses 16132 16797 +665 Partials 25 25
Continue to review full report in Codecov by Sentry.
|
Updated missed calls in modperl and modpython.
Ready for another look |
I've added a new 'automode' module that can do automatic arbitrary mode changes. |
@DarthGandalf Have you looked at the new automode module yet? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
To clarify: it doesn't check the key like autoop did?
if (Nick.GetNick() == GetNetwork()->GetIRCNick().GetNick()) { | ||
const map<CString, CNick>& msNicks = Channel.GetNicks(); | ||
for (const auto& it : msNicks) { | ||
if (!it.second.HasPerm(CChan::HalfOp)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Are you sure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Ah, good catch. That needs to become more robust.
"[channels]")); | ||
} else if (sMode != "q" && sMode != "a" && sMode != "o" && | ||
sMode != "h" && sMode != "v") { | ||
PutModule("<mode> must be one of the following: qaohv"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You missed t_s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It seems to work fine.. what is t_s anyway?
I removed the key mechanism altogether because I don't know a single person who doesn't just useNOKEY. Having to request it sort of defeats the purpose of calling it 'auto'... |
t_s is for localisation support. Visible messages should be translateableKey is for efnet etc. You and another person add each other with the samekey, and the module cryptographically checks that the key is the sameinstead of only relying on hostmaskсб, 5 мар. 2022 г., 03:01 Jonathan Rudolph ***@***.***>: … I removed the key mechanism altogether because I don't know a single person who doesn't just use *NOKEY*. Having to request it sort of defeats the purpose of calling it 'auto'... — Reply to this email directly, view it on GitHub <#1825 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AACPLZCCDDCK7YOQDWYZDY3U6LFALANCNFSM5PL2RDBQ> . Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>. You are receiving this because you were mentioned.Message ID: ***@***.***> |
It's still auto, because module requests it itself when nick and host matchсб, 5 мар. 2022 г., 03:01 Jonathan Rudolph ***@***.***>: … I removed the key mechanism altogether because I don't know a single person who doesn't just use *NOKEY*. Having to request it sort of defeats the purpose of calling it 'auto'... — Reply to this email directly, view it on GitHub <#1825 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AACPLZCCDDCK7YOQDWYZDY3U6LFALANCNFSM5PL2RDBQ> . Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>. You are receiving this because you were mentioned.Message ID: ***@***.***> |
Almost entirely copy/paste with small edits to function names.
Added autohalfop module, nearly the same as the autoop module.