From 62517844a5193bcaf34c156c500fd70ac5d72a33 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Thu, 22 Sep 2022 17:30:48 +0200 Subject: [PATCH] Ensure autolocked groups are locked on creation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We used to autolock groups when the last user left, but not when creating a group that was not in memory yet. Ensure that groups are autolocked in all cases. Thanks to Michael Ströder. --- CHANGES | 2 ++ group/group.go | 10 +++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index d11e900..832deb9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Galene 0.6.1 (unreleased): + * Ensure that autolocked groups are locked on creation. Thanks to + Michael Ströder. * Add a camera/microphone indicator in the users list. * Hide audio-only peers by default. diff --git a/group/group.go b/group/group.go index bcf61b2..a4315ec 100644 --- a/group/group.go +++ b/group/group.go @@ -433,20 +433,16 @@ func add(name string, desc *Description) (*Group, []Client, error) { timestamp: time.Now(), } groups.groups[name] = g - return g, nil, nil } g.mu.Lock() defer g.mu.Unlock() if desc != nil { - if descriptionMatch(g.description, desc) { - return g, nil, nil + if !descriptionMatch(g.description, desc) { + g.description = desc } - g.description = desc - } else if descriptionUnchanged(name, g.description) { - return g, nil, nil - } else { + } else if !descriptionUnchanged(name, g.description) { desc, err = readDescription(name) if err != nil { if !os.IsNotExist(err) {