Fixup Keys
continuous-integration/drone/pr Build is pending
Details
continuous-integration/drone/pr Build is pending
Details
This commit is contained in:
parent
5b2b839865
commit
51f993973c
|
@ -551,7 +551,7 @@ func ImportLegacyProfile(profile *model.Profile, cps *CwtchProfileStorage) Cwtch
|
||||||
if err == nil {
|
if err == nil {
|
||||||
for key, value := range contact.Attributes {
|
for key, value := range contact.Attributes {
|
||||||
switch key {
|
switch key {
|
||||||
case event.PreserveHistoryDefaultSettingKey:
|
case event.SaveHistoryKey:
|
||||||
cp.SetConversationAttribute(conversationID, attr.LocalScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(event.SaveHistoryKey)), value)
|
cp.SetConversationAttribute(conversationID, attr.LocalScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(event.SaveHistoryKey)), value)
|
||||||
case string(model.BundleType):
|
case string(model.BundleType):
|
||||||
cp.AddServer(value)
|
cp.AddServer(value)
|
||||||
|
|
|
@ -854,8 +854,8 @@ func (cps *CwtchProfileStorage) PurgeNonSavedMessages() {
|
||||||
// FIXME: revisit this for hybrid groups.
|
// FIXME: revisit this for hybrid groups.
|
||||||
if !conversation.IsGroup() && !conversation.IsServer() {
|
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.
|
// 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
|
saveHistoryConfirmed := conversation.Attributes[attr.LocalScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(event.SaveHistoryKey)).ToString()] == event.SaveHistoryConfirmed
|
||||||
deleteHistoryConfirmed := conversation.Attributes[attr.LocalScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(event.PreserveHistoryDefaultSettingKey)).ToString()] == event.DeleteHistoryConfirmed
|
deleteHistoryConfirmed := conversation.Attributes[attr.LocalScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(event.SaveHistoryKey)).ToString()] == event.DeleteHistoryConfirmed
|
||||||
// we purge conversation history in two specific instances...
|
// we purge conversation history in two specific instances...
|
||||||
// if the conversation has been explicitly marked as delete history confirmed OR
|
// 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
|
// 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)
|
ss := NewStreamStore(ps.directory, contact.LocalID, ps.key)
|
||||||
cp.Contacts[contact.Onion].Timeline.SetMessages(ss.Read())
|
cp.Contacts[contact.Onion].Timeline.SetMessages(ss.Read())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue