diff --git a/VERSION b/VERSION index 1308ddab9..3df99b6b2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.88.2 +0.88.3 diff --git a/protocol/messenger.go b/protocol/messenger.go index ec24fdfed..cefd4c245 100644 --- a/protocol/messenger.go +++ b/protocol/messenger.go @@ -2741,20 +2741,12 @@ func (m *Messenger) handleRetrievedMessages(chatWithMessages map[transport.Filte // We join and re-register as we want to receive mentions from the newly joined public chat if addedChat != nil { - _, err = m.Join(addedChat) + _, err = m.createPublicChat(addedChat.ID, messageState.Response) if err != nil { allMessagesProcessed = false logger.Error("error joining chat", zap.Error(err)) continue } - logger.Debug("newly synced public chat, re-registering for push notifications") - err := m.reregisterForPushNotifications() - if err != nil { - - allMessagesProcessed = false - logger.Warn("could not re-register for push notifications", zap.Error(err)) - continue - } } case protobuf.SyncCommunity: diff --git a/protocol/messenger_chats.go b/protocol/messenger_chats.go index 665eeec2d..d61b26d0c 100644 --- a/protocol/messenger_chats.go +++ b/protocol/messenger_chats.go @@ -102,13 +102,7 @@ func (m *Messenger) initChatSyncFields(chat *Chat) error { return nil } -func (m *Messenger) CreatePublicChat(request *requests.CreatePublicChat) (*MessengerResponse, error) { - if err := request.Validate(); err != nil { - return nil, err - } - - chatID := request.ID - +func (m *Messenger) createPublicChat(chatID string, response *MessengerResponse) (*MessengerResponse, error) { chat, ok := m.allChats.Load(chatID) if !ok { chat = CreatePublicChat(chatID, m.getTimesource()) @@ -155,12 +149,22 @@ func (m *Messenger) CreatePublicChat(request *requests.CreatePublicChat) (*Messe return nil, err } - response := &MessengerResponse{} response.AddChat(chat) return response, nil } +func (m *Messenger) CreatePublicChat(request *requests.CreatePublicChat) (*MessengerResponse, error) { + if err := request.Validate(); err != nil { + return nil, err + } + + chatID := request.ID + response := &MessengerResponse{} + + return m.createPublicChat(chatID, response) +} + func (m *Messenger) CreateProfileChat(request *requests.CreateProfileChat) (*MessengerResponse, error) { if err := request.Validate(); err != nil { return nil, err diff --git a/protocol/messenger_handler.go b/protocol/messenger_handler.go index 85f77b19b..7627bcedf 100644 --- a/protocol/messenger_handler.go +++ b/protocol/messenger_handler.go @@ -365,11 +365,6 @@ func (m *Messenger) HandleSyncInstallationPublicChat(state *ReceivedMessageState } chat := CreatePublicChat(chatID, state.Timesource) - - timestamp := uint32(state.Timesource.GetCurrentTime() / 1000) - chat.SyncedTo = timestamp - chat.SyncedFrom = timestamp - state.AllChats.Store(chat.ID, chat) state.Response.AddChat(chat)