diff --git a/peer/cwtch_peer.go b/peer/cwtch_peer.go index c484916..3edbacb 100644 --- a/peer/cwtch_peer.go +++ b/peer/cwtch_peer.go @@ -551,7 +551,7 @@ func ImportLegacyProfile(profile *model.Profile, cps *CwtchProfileStorage) Cwtch if err == nil { for key, value := range contact.Attributes { switch key { - case event.PreserveHistoryDefaultSettingKey: + case event.SaveHistoryKey: cp.SetConversationAttribute(conversationID, attr.LocalScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(event.SaveHistoryKey)), value) case string(model.BundleType): cp.AddServer(value) diff --git a/peer/cwtchprofilestorage.go b/peer/cwtchprofilestorage.go index c388cd2..74496c8 100644 --- a/peer/cwtchprofilestorage.go +++ b/peer/cwtchprofilestorage.go @@ -854,8 +854,8 @@ func (cps *CwtchProfileStorage) PurgeNonSavedMessages() { // FIXME: revisit this for hybrid groups. if !conversation.IsGroup() && !conversation.IsServer() { // Note that we only check for confirmed status here...if it is set to any other value we will fallthrough to the default. - saveHistoryConfirmed := conversation.Attributes[attr.LocalScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(event.PreserveHistoryDefaultSettingKey)).ToString()] == event.SaveHistoryConfirmed - deleteHistoryConfirmed := conversation.Attributes[attr.LocalScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(event.PreserveHistoryDefaultSettingKey)).ToString()] == event.DeleteHistoryConfirmed + saveHistoryConfirmed := conversation.Attributes[attr.LocalScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(event.SaveHistoryKey)).ToString()] == event.SaveHistoryConfirmed + deleteHistoryConfirmed := conversation.Attributes[attr.LocalScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(event.SaveHistoryKey)).ToString()] == event.DeleteHistoryConfirmed // we purge conversation history in two specific instances... // if the conversation has been explicitly marked as delete history confirmed OR // if save history hasn't been confirmed and default save history is false - i.e. in all other cases diff --git a/storage/v1/profile_store.go b/storage/v1/profile_store.go index db8436b..98c6802 100644 --- a/storage/v1/profile_store.go +++ b/storage/v1/profile_store.go @@ -65,7 +65,7 @@ func (ps *ProfileStoreV1) load() error { } } - if contact.Attributes[event.PreserveHistoryDefaultSettingKey] == event.SaveHistoryConfirmed { + if contact.Attributes[event.SaveHistoryKey] == event.SaveHistoryConfirmed { ss := NewStreamStore(ps.directory, contact.LocalID, ps.key) cp.Contacts[contact.Onion].Timeline.SetMessages(ss.Read()) }