nest a function for readable
parent
4ffc6bba8c
commit
8f681c7927
22
main.go
22
main.go
|
|
@ -49,17 +49,19 @@ func matrixrecv() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
states := map[string]map[config.State]struct{}{}
|
||||
for _, msg := range messages {
|
||||
if _, ok := states[msg.Sender]; ok {
|
||||
continue
|
||||
func() {
|
||||
states := map[string]map[config.State]struct{}{}
|
||||
for _, msg := range messages {
|
||||
if _, ok := states[msg.Sender]; ok {
|
||||
continue
|
||||
}
|
||||
states[msg.Sender] = map[config.State]struct{}{}
|
||||
for _, state := range parseOutStates([]byte(msg.Content)) {
|
||||
states[msg.Sender][state] = struct{}{}
|
||||
}
|
||||
}
|
||||
states[msg.Sender] = map[config.State]struct{}{}
|
||||
for _, state := range parseOutStates([]byte(msg.Content)) {
|
||||
states[msg.Sender][state] = struct{}{}
|
||||
}
|
||||
}
|
||||
setNewStates(states)
|
||||
setNewStates(states)
|
||||
}()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue