Fix handling community description (#2254)

This commit is contained in:
Volodymyr Kozieiev 2021-06-03 13:49:04 +03:00 committed by GitHub
parent 10becb4902
commit 22204c3757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -1 +1 @@
0.79.9
0.79.10

View File

@ -423,8 +423,8 @@ func (m *Messenger) EditCommunityChat(communityID types.HexBytes, chatID string,
var chats []*Chat
var chatIDs []string
for chatID, chat := range changes.ChatsModified {
c := CreateCommunityChat(community.IDString(), chatID, chat.ChatModified, m.getTimesource())
for chatID, change := range changes.ChatsModified {
c := CreateCommunityChat(community.IDString(), chatID, change.ChatModified, m.getTimesource())
chats = append(chats, c)
chatIDs = append(chatIDs, c.ID)
response.AddChat(c)
@ -753,8 +753,10 @@ func (m *Messenger) handleCommunityDescription(state *ReceivedMessageState, sign
state.Response.AddChat(chat)
chatIDs = append(chatIDs, chat.ID)
// Update name, currently is the only field is mutable
} else if oldChat.Name != chat.Name {
} else if oldChat.Name != chat.Name ||
oldChat.Description != chat.Description {
oldChat.Name = chat.Name
oldChat.Description = chat.Description
// TODO(samyoul) remove storing of an updated reference pointer?
state.AllChats.Store(chat.ID, oldChat)
state.Response.AddChat(chat)