Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/zncPublic
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

Open
skralg wants to merge6 commits intoznc:master
base:master
Choose a base branch
Loading
fromskralg:master
Open

Initial HalfOps features#1825

skralg wants to merge6 commits intoznc:masterfromskralg:master

Conversation

skralg
Copy link

Almost entirely copy/paste with small edits to function names.
Added autohalfop module, nearly the same as the autoop module.

/** 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,
Copy link
Member

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

modperl and modpython updated

Copy link
Member

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.

Info.SetWikiPage("autohalfop");
}

NETWORKMODULEDEFS(CAutoHalfOpMod, t_s("Auto halfop the good people"))
Copy link
Member

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

Copy link
Author

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.

Copy link
Member

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
Copy link

codecovbot commentedFeb 26, 2022
edited
Loading

Codecov Report

Attention: Patch coverage is1.04167% with665 lines in your changes missing coverage. Please review.

Project coverage is 40.91%. Comparing base(9be0cae) to head(4ff25a5).
Report is 218 commits behind head on master.

Files with missing linesPatch %Lines
modules/autohalfop.cpp0.78%377 Missing⚠️
modules/automode.cpp1.12%264 Missing⚠️
src/Modules.cpp0.00%12 Missing⚠️
src/Chan.cpp9.09%10 Missing⚠️
modules/modperl/startup.pl0.00%2 Missing⚠️
Additional details and impacted files

Impacted file tree graph

@@            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
Files with missing linesCoverage Δ
include/znc/Chan.h54.71% <ø> (ø)
include/znc/Modules.h62.60% <ø> (ø)
modules/modperl/module.h40.00% <ø> (ø)
modules/modpython/module.h61.84% <ø> (ø)
modules/modperl/startup.pl33.46% <0.00%> (-0.14%)⬇️
src/Chan.cpp66.32% <9.09%> (-1.31%)⬇️
src/Modules.cpp63.11% <0.00%> (-0.56%)⬇️
modules/automode.cpp1.12% <1.12%> (ø)
modules/autohalfop.cpp0.78% <0.78%> (ø)

Continue to review full report in Codecov by Sentry.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update9be0cae...4ff25a5. Read thecomment docs.

@skralg
Copy link
Author

Ready for another look

@skralg
Copy link
Author

I've added a new 'automode' module that can do automatic arbitrary mode changes.

@skralg
Copy link
Author

@DarthGandalf Have you looked at the new automode module yet?

Copy link
Member

@DarthGandalfDarthGandalf left a 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)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Are you sure?

Copy link
Author

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");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You missed t_s

Copy link
Author

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?

@skralg
Copy link
Author

skralg commentedMar 5, 2022
edited
Loading

To clarify: it doesn't check the key like autoop did?

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'...

@DarthGandalf
Copy link
Member

DarthGandalf commentedMar 5, 2022 via email

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: ***@***.***>

@DarthGandalf
Copy link
Member

DarthGandalf commentedMar 5, 2022 via email

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: ***@***.***>

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

@DarthGandalfDarthGandalfDarthGandalf left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@skralg@DarthGandalf

[8]ページ先頭

©2009-2025 Movatter.jp