mirror of
https://github.com/jech/galene.git
synced 2024-12-22 15:25:48 +01:00
Don't notify clients when description is unchanged.
When we fixed the handling of autolocked groups, we introduced a bug where we spuriously notify clients even when the description didn't change.
This commit is contained in:
parent
8a2357de21
commit
249c1c1132
1 changed files with 8 additions and 1 deletions
|
@ -438,9 +438,11 @@ func add(name string, desc *Description) (*Group, []Client, error) {
|
|||
g.mu.Lock()
|
||||
defer g.mu.Unlock()
|
||||
|
||||
notify := false
|
||||
if desc != nil {
|
||||
if !descriptionMatch(g.description, desc) {
|
||||
g.description = desc
|
||||
notify = true
|
||||
}
|
||||
} else if !descriptionUnchanged(name, g.description) {
|
||||
desc, err = readDescription(name)
|
||||
|
@ -452,11 +454,16 @@ func add(name string, desc *Description) (*Group, []Client, error) {
|
|||
return nil, nil, err
|
||||
}
|
||||
g.description = desc
|
||||
notify = true
|
||||
}
|
||||
|
||||
autoLockKick(g)
|
||||
|
||||
return g, g.getClientsUnlocked(nil), nil
|
||||
var clients []Client
|
||||
if notify {
|
||||
clients = g.getClientsUnlocked(nil)
|
||||
}
|
||||
return g, clients, nil
|
||||
}
|
||||
|
||||
func Range(f func(g *Group) bool) {
|
||||
|
|
Loading…
Reference in a new issue