Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't require account-notify/away-notify for WHOX #1793

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jesopo
Copy link
Contributor

@jesopo jesopo commented Jul 10, 2022

when you connect weechat to znc, you first get a CAP dance like this:

-> :irc.znc.in CAP unknown-nick LS :batch cap-notify echo-message multi-prefix server-time userhost-in-names znc.in/batch znc.in/self-message znc.in/server-time-iso
<- CAP REQ :cap-notify multi-prefix server-time userhost-in-names
<- CAP END
-> @time=2022-07-10T20:19:26.599Z :irc.znc.in CAP * ACK :cap-notify multi-prefix server-time userhost-in-names

and then once znc has figured out what network you're connecting to, you get this:

-> @time=2022-07-10T20:19:26.608Z :irc.znc.in CAP user NEW :account-notify away-notify extended-join
<- CAP REQ :account-notify away-notify extended-join

and then it takes until after znc has already finished replaying NAMES to you for you to get this

-> @time=2022-07-10T20:19:26.621Z :irc.znc.in CAP user ACK :account-notify away-notify extended-join

which means by the time you're hitting the code that I'm changing, you don't know that the network you're on supports away-notify or account-notify, which means this if will reliably fail and weechat simply won't send a WHOX request. this can be solved by simply sending WHOX whenever a network supports it.

@jesopo
Copy link
Contributor Author

jesopo commented Jul 10, 2022

an alternative solution is to check what CAPs you know the other side has said they support, rather than checking what's actually been ACKed, but that seems untidy

@codecov-commenter
Copy link

Codecov Report

Merging #1793 (9813401) into master (e057c16) will decrease coverage by 0.01%.
The diff coverage is 75.00%.

@@            Coverage Diff             @@
##           master    #1793      +/-   ##
==========================================
- Coverage   38.05%   38.04%   -0.02%     
==========================================
  Files         211      211              
  Lines       85672    85665       -7     
==========================================
- Hits        32605    32592      -13     
- Misses      53067    53073       +6     
Impacted Files Coverage Δ
src/plugins/irc/irc-channel.c 53.36% <75.00%> (-1.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e057c16...9813401. Read the comment docs.

if (weechat_hashtable_has_key (server->cap_list, "away-notify")
|| weechat_hashtable_has_key (server->cap_list, "account-notify")
|| ((IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_AWAY_CHECK) > 0)
&& ((IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_AWAY_CHECK_MAX_NICKS) == 0)
Copy link
Member

Choose a reason for hiding this comment

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

Hello,
You are removing the use of options away_check and away_check_max_nicks (this one becomes completely unused in IRC plugin), is that wanted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I don't think there's a reason to ever not use WHOX when it is available

Copy link
Member

Choose a reason for hiding this comment

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

But these options are there to let the user enable or disable WHO (or WHOX), based on how many nicks are in the channel. Purpose is to limit the bandwith used (WHO responses can be huge on some channels).

Using WHOX when available is OK for me, but I would like to keep the feature to completely disable WHO(X) if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair enough. i'll tweak the PR in a bit

@flashcode flashcode added waiting info Waiting for info from author of issue feature New feature request labels Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request waiting info Waiting for info from author of issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants