Fix lastMessages map init in LoadUsers()
This commit is contained in:
parent
972f568a00
commit
e0ca9d5d8c
@ -85,9 +85,11 @@ func LoadUsers(store Store) ([]*User, error) {
|
|||||||
for _, channel := range channels {
|
for _, channel := range channels {
|
||||||
messages, _, err := user.LastMessages(channel.Network, channel.Name, 1)
|
messages, _, err := user.LastMessages(channel.Network, channel.Name, 1)
|
||||||
if err == nil && len(messages) == 1 {
|
if err == nil && len(messages) == 1 {
|
||||||
user.lastMessages[channel.Network] = map[string]*Message{
|
if _, ok := user.lastMessages[channel.Network]; !ok {
|
||||||
channel.Name: &messages[0],
|
user.lastMessages[channel.Network] = map[string]*Message{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
user.lastMessages[channel.Network][channel.Name] = &messages[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user