forked from cwtch.im/cwtch
Fixup Keys
This commit is contained in:
parent
5b2b839865
commit
51f993973c
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue