3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 11:59:40 +01:00

Merge pull request #1397 from slingamn/resume_joinline

fix duplicated JOIN line sent to some resuming clients
This commit is contained in:
Shivaram Lingamneni 2020-11-25 21:30:35 -08:00 committed by GitHub
commit 6e2119be60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -993,19 +993,19 @@ func (channel *Channel) resumeAndAnnounce(session *Session) {
// but really we should send it to voiced clients // but really we should send it to voiced clients
if !channel.flags.HasMode(modes.Auditorium) { if !channel.flags.HasMode(modes.Auditorium) {
for _, member := range channel.Members() { for _, member := range channel.Members() {
for _, session := range member.Sessions() { for _, mSes := range member.Sessions() {
if session.capabilities.Has(caps.Resume) { if mSes == session || mSes.capabilities.Has(caps.Resume) {
continue continue
} }
if session.capabilities.Has(caps.ExtendedJoin) { if mSes.capabilities.Has(caps.ExtendedJoin) {
session.Send(nil, details.nickMask, "JOIN", chname, details.accountName, details.realname) mSes.Send(nil, details.nickMask, "JOIN", chname, details.accountName, details.realname)
} else { } else {
session.Send(nil, details.nickMask, "JOIN", chname) mSes.Send(nil, details.nickMask, "JOIN", chname)
} }
if 0 < len(oldModes) { if 0 < len(oldModes) {
session.Send(nil, channel.server.name, "MODE", chname, oldModes, details.nick) mSes.Send(nil, channel.server.name, "MODE", chname, oldModes, details.nick)
} }
} }
} }

@ -1 +1 @@
Subproject commit b43e1278057113041ba51ced58571a2ad8dacb5c Subproject commit d741ab86d5f63782e746384a553f44b04a672ebb