Repository navigation
Conversation
Two cases left members of a +A channel with hidden users in their nick list who never go away, because the client is never told when those users change nick or leave: - m_names() listed hidden members to IRC operators who are in the channel, but JOIN/NICK/QUIT/PART of hidden members are not sent to them. Now the oper exemption only applies when the oper is not a member of the channel. - A local user who loses their last of +o/+h/+v keeps the plain members they saw while they had status, but is no longer sent their NICK/QUIT/PART. Send them a PART for each hidden member, the reverse of the nicklist resend that already happens on +v. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a +A (auditorium) channel, members without op, halfop or voice are hidden from each other. Ops, halfops and voiced users see everyone. Two cases give a client a hidden member without ever sending it that member's NICK, QUIT or PART. The member then stays in the client's nick list forever as a "ghost".
Bug 1: IRC operators who are in the channel
m_names()exempts opers from the +A check (!IsAnOper(sptr)), and so doesm_who(). But the JOIN/NICK/QUIT/PART fan-out insend.c(sendto_common_channels(),send_quit_to_common_channels(),send_part_to_common_channels(),sendto_channel_butserv_noopvoice()) does not. An oper without channel status who joins a +A channel gets every hidden member in the NAMES reply on join. When those members later rename or quit, the oper hears nothing.Fix: the oper exemption in
m_names()now applies only when the oper is not a member of the channel. Opers can still look up who is in a +A channel from outside it, since that builds no nick list. An oper who is a member sees the same names they will get events for.m_who()is unchanged: WHO is a lookup and doesn't feed a client's nick list.I chose this over sending membership events to opers. That alternative goes wrong again whenever a user opers up or down while already in the channel.
Bug 2: members who lose op/halfop/voice
When a local user gets +v/+h/+o in a +A channel,
set_mode()resends their nick list (fake KICK, JOIN, NAMES) so they see the hidden members. The reverse never happens. After losing their last status, the user keeps every hidden member in their client, but is no longer sent their NICK/QUIT/PART.Fix: when a local user goes from having any of +o/+h/+v to having none, send them a PART for each member who is now hidden from them. I used PARTs rather than the KICK-and-rejoin used for +v, because some clients show kicks or auto-rejoin. Losing just one of several statuses (for example
-von someone who is still@) sends nothing.Repro
Needs a +A channel. Only servers can set +A, so set it from services.
Bug 1
Opjoins#test; services set+A.Hiddenjoins#test(no status).Operopers up and joins#test. Their NAMES reply includesHidden.Hiddenchanges nick, then quits.Opergets neither message, andHiddenstays inOper's nick list. A fresh/NAMESno longer lists them.Bug 2
Opjoins#test; services set+A;OpvoicesWas.Hiddenjoins andWassees the JOIN.Opsets-v Was.Wasgets no PART or nick list refresh forHidden.Hiddenquits.Wasnever hears about it.Testing
I tested on two linked servers built from master (fc3d398), plus a test U-lined server that sets +A. A script checks exactly which users see each JOIN/NICK/QUIT/PART: a local op, a remote op, a voiced user, an oper with no channel status, and plain local and remote members. It covers:
+vgets no PARTs and still sees hidden members quitchannel.ccompiles without warnings, before and after the patch.🤖 Generated with Claude Code