Allow Peers to Store History #316
无审核者
标签
未选择标签
applications
BLOCKED
bug
design
duplicate
enhancement
fixed?
funding-needed
help wanted
infrastructure
invalid
payments
qubes
question
ready-for-implementation
refactor
spam
tapir-server
testing
tor
wontfix
未选择里程碑
未指派成员
3 名参与者
通知
到期时间
未设置到期时间。
依赖工单
没有设置依赖项。
参考:cwtch.im/cwtch#316
正在加载...
在新工单中引用
没有提供说明。
删除分支 peer_history
删除分支是永久的。虽然已删除的分支在实际被删除前有可能会短时间存在,但这在大多数情况下无法撤销。是否继续?
Drone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch/769
Drone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch/771
@ -258,6 +260,10 @@ func (ps *ProfileStoreV1) load() error {
contact.Authorization = model.AuthApproved
}
}
like above, prolly better to check at load if the attribute is set or not and set it accordingly instead of the double initializer for it you have in the event handler below. Also since this is a required attribute, should also be added to cwtchPeer.AddContact, line 194 has the attributes being initialized.
then we can create a stream store only where needed, then the event handler can just reach for the stream store and if there is one, use it, if not, not use it, simplifying that code a bunch in the event handler
BUT it does mean then doing processing of the SavePeerHistory event and creating or deleting stream stores there.
but that's actually good as right now we don't capture that, so we never delete history when its changed? which means when someone turns it off, the existing history sits there, forever being loaded, but never updated, which isn't great, so that event does need handling regardless
also prolly want a ps.save after the loop to capture and save any new defaults added
@ -346,0 +368,4 @@
ss.Write(message)
}
}
case event.DontSaveHistoryDefault:
very rust of you? :P
but we can just have hte one empty default
@ -346,0 +376,4 @@
}
}
}
ps.save()
shouldn't need this if we aren't setting a default here
@ -346,0 +382,4 @@
}
case event.NewMessageFromPeer:
contact, exists := ps.profile.GetContact(ev.Data[event.RemotePeer])
if exists {
also this is copy/pasted, should be pulled out into a function instead
Drone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch/773
Drone Build Status: failure
https://build.openprivacy.ca/cwtch.im/cwtch/775
WIP: Allow Peers to Store History为 Allow Peers to Store HistoryDrone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch/777