diff --git a/protocol/messenger.go b/protocol/messenger.go index fcbbfa001b2..481f0223290 100644 --- a/protocol/messenger.go +++ b/protocol/messenger.go @@ -1724,6 +1724,8 @@ func (m *Messenger) Init() error { if err != nil { return err } + + communityInfo := make(map[string]*communities.Community) for _, chat := range chats { if err := chat.Validate(); err != nil { logger.Warn("failed to validate chat", zap.Error(err)) @@ -1740,20 +1742,13 @@ func (m *Messenger) Init() error { continue } - communityInfo := make(map[string]*communities.Community) - switch chat.ChatType { case ChatTypePublic, ChatTypeProfile: filtersToInit = append(filtersToInit, transport.FiltersToInitialize{ChatID: chat.ID}) case ChatTypeCommunityChat: - communityID, err := hexutil.Decode(chat.CommunityID) - if err != nil { - return err - } - community, ok := communityInfo[chat.CommunityID] if !ok { - community, err = m.communitiesManager.GetByID(communityID) + community, err = m.communitiesManager.GetByIDString(chat.CommunityID) if err != nil { return err }