Temporarily ignore timeline dedupelication for p2p messags.
This commit is contained in:
parent
c62ecd6f71
commit
bff922df35
|
@ -186,10 +186,18 @@ func (t *Timeline) Insert(mi *Message) int {
|
||||||
|
|
||||||
// check that we haven't seen this message before (this has no impact on p2p messages, but is essential for
|
// check that we haven't seen this message before (this has no impact on p2p messages, but is essential for
|
||||||
// group messages)
|
// group messages)
|
||||||
idx, exists := t.signatureCache[base64.StdEncoding.EncodeToString(mi.Signature)]
|
// FIXME: The below code now checks if the message has a signature. If it doesn't then skip duplication check.
|
||||||
if exists {
|
// We do this because p2p messages right now do not have a signature, and so many p2p messages are not stored
|
||||||
t.Messages[idx].Acknowledged = true
|
// with a signature. In the future in hybrid groups this check will go away as all timelines will use the same
|
||||||
return idx
|
// underlying protocol.
|
||||||
|
// This is currently safe to do because p2p does not rely on signatures and groups will verify the signature of
|
||||||
|
// messages prior to generating an event to include them in the timeline.
|
||||||
|
if len(mi.Signature) != 0 {
|
||||||
|
idx, exists := t.signatureCache[base64.StdEncoding.EncodeToString(mi.Signature)]
|
||||||
|
if exists {
|
||||||
|
t.Messages[idx].Acknowledged = true
|
||||||
|
return idx
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the message store
|
// update the message store
|
||||||
|
|
Loading…
Reference in New Issue