Skip to content
Snippets Groups Projects
Commit 8a7916d9 authored by benjamin's avatar benjamin
Browse files

removed broken guard code in reception functions

parent a5e42c5d
No related branches found
No related tags found
1 merge request!60Revert "Fail a test to be sure it works"
...@@ -157,23 +157,6 @@ func (w *wasmModel) ReceiveMessage(channelID *id.ID, ...@@ -157,23 +157,6 @@ func (w *wasmModel) ReceiveMessage(channelID *id.ID,
msgToInsert := buildMessage(channelID.Marshal(), messageID.Bytes(), nil, msgToInsert := buildMessage(channelID.Marshal(), messageID.Bytes(), nil,
nickname, text, identity, timestamp, lease, round.ID, mType, status) nickname, text, identity, timestamp, lease, round.ID, mType, status)
// Attempt a lookup on the MessageID if it is non-zero to find an existing
// entry for it. This occurs any time a sender receives their own message
// from the mixnet.
emptyID := cryptoChannel.MessageID{}
jww.DEBUG.Printf("messageID: %s, blank messageID: %s",
messageID.String(),
emptyID)
if !messageID.Equals(cryptoChannel.MessageID{}) {
jww.DEBUG.Printf("non-empty messageID detected")
uuid, err := w.msgIDLookup(messageID)
if err == nil && uuid != 0 {
jww.WARN.Printf("found MessageID, will upsert: %d",
uuid)
msgToInsert.ID = uuid
}
}
uuid, err := w.receiveHelper(msgToInsert) uuid, err := w.receiveHelper(msgToInsert)
if err != nil { if err != nil {
jww.ERROR.Printf("Failed to receiver message: %+v", err) jww.ERROR.Printf("Failed to receiver message: %+v", err)
...@@ -199,17 +182,6 @@ func (w *wasmModel) ReceiveReply(channelID *id.ID, ...@@ -199,17 +182,6 @@ func (w *wasmModel) ReceiveReply(channelID *id.ID,
replyTo.Bytes(), nickname, text, identity, timestamp, lease, round.ID, replyTo.Bytes(), nickname, text, identity, timestamp, lease, round.ID,
mType, status) mType, status)
// Attempt a lookup on the MessageID if it is non-zero to find an existing
// entry for it. This occurs any time a sender receives their own message
// from the mixnet.
if !messageID.Equals(cryptoChannel.MessageID{}) {
uuid, err := w.msgIDLookup(messageID)
if err != nil {
// message is already in the database, no insert necessary
return uuid
}
}
uuid, err := w.receiveHelper(msgToInsert) uuid, err := w.receiveHelper(msgToInsert)
if err != nil { if err != nil {
...@@ -235,17 +207,6 @@ func (w *wasmModel) ReceiveReaction(channelID *id.ID, ...@@ -235,17 +207,6 @@ func (w *wasmModel) ReceiveReaction(channelID *id.ID,
reactionTo.Bytes(), nickname, reaction, identity, timestamp, lease, reactionTo.Bytes(), nickname, reaction, identity, timestamp, lease,
round.ID, mType, status) round.ID, mType, status)
// Attempt a lookup on the MessageID if it is non-zero to find
// an existing entry for it. This occurs any time a sender
// receives their own message from the mixnet.
if !messageID.Equals(cryptoChannel.MessageID{}) {
uuid, err := w.msgIDLookup(messageID)
if err == nil {
// message is already in the database, no insert necessary
return uuid
}
}
uuid, err := w.receiveHelper(msgToInsert) uuid, err := w.receiveHelper(msgToInsert)
if err != nil { if err != nil {
jww.ERROR.Printf("Failed to receive reaction: %+v", err) jww.ERROR.Printf("Failed to receive reaction: %+v", err)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment