Skip to content
Snippets Groups Projects

fix for latest client release

Merged Jake Taylor requested to merge release into master
4 files
+ 22
2
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -98,6 +98,7 @@ func (w *wasmModel) Receive(messageID message.ID, nickname string, text []byte,
pubKey ed25519.PublicKey, dmToken uint32, codeset uint8, timestamp time.Time,
round rounds.Round, mType dm.MessageType, status dm.Status) uint64 {
parentErr := errors.New("failed to Receive")
jww.TRACE.Printf("[DM indexedDB] Receive(%s)", messageID)
// If there is no extant Conversation, create one.
_, err := impl.Get(w.db, conversationStoreName, utils.CopyBytesToJS(pubKey))
@@ -132,6 +133,8 @@ func (w *wasmModel) Receive(messageID message.ID, nickname string, text []byte,
jww.ERROR.Printf("Failed to receive Message: %+v", err)
}
jww.TRACE.Printf("[DM indexedDB] Calling ReceiveMessageCB(%v, %v, f)",
uuid, pubKey)
go w.receivedMessageCB(uuid, pubKey, false)
return uuid
}
@@ -140,6 +143,7 @@ func (w *wasmModel) ReceiveText(messageID message.ID, nickname, text string,
pubKey ed25519.PublicKey, dmToken uint32, codeset uint8,
timestamp time.Time, round rounds.Round, status dm.Status) uint64 {
parentErr := errors.New("failed to ReceiveText")
jww.TRACE.Printf("[DM indexedDB] ReceiveText(%s)", messageID)
// If there is no extant Conversation, create one.
_, err := impl.Get(w.db, conversationStoreName, utils.CopyBytesToJS(pubKey))
@@ -176,6 +180,8 @@ func (w *wasmModel) ReceiveText(messageID message.ID, nickname, text string,
jww.ERROR.Printf("Failed to receive Message: %+v", err)
}
jww.TRACE.Printf("[DM indexedDB] Calling ReceiveMessageCB(%v, %v, f)",
uuid, pubKey)
go w.receivedMessageCB(uuid, pubKey, false)
return uuid
}
@@ -184,6 +190,7 @@ func (w *wasmModel) ReceiveReply(messageID, reactionTo message.ID, nickname,
text string, pubKey ed25519.PublicKey, dmToken uint32, codeset uint8,
timestamp time.Time, round rounds.Round, status dm.Status) uint64 {
parentErr := errors.New("failed to ReceiveReply")
jww.TRACE.Printf("[DM indexedDB] ReceiveReply(%s)", messageID)
// If there is no extant Conversation, create one.
_, err := impl.Get(w.db, conversationStoreName, utils.CopyBytesToJS(pubKey))
@@ -220,6 +227,8 @@ func (w *wasmModel) ReceiveReply(messageID, reactionTo message.ID, nickname,
jww.ERROR.Printf("Failed to receive Message: %+v", err)
}
jww.TRACE.Printf("[DM indexedDB] Calling ReceiveMessageCB(%v, %v, f)",
uuid, pubKey)
go w.receivedMessageCB(uuid, pubKey, false)
return uuid
}
@@ -228,6 +237,7 @@ func (w *wasmModel) ReceiveReaction(messageID, _ message.ID, nickname,
reaction string, pubKey ed25519.PublicKey, dmToken uint32, codeset uint8,
timestamp time.Time, round rounds.Round, status dm.Status) uint64 {
parentErr := errors.New("failed to ReceiveText")
jww.TRACE.Printf("[DM indexedDB] ReceiveReaction(%s)", messageID)
// If there is no extant Conversation, create one.
_, err := impl.Get(w.db, conversationStoreName, utils.CopyBytesToJS(pubKey))
@@ -264,6 +274,8 @@ func (w *wasmModel) ReceiveReaction(messageID, _ message.ID, nickname,
jww.ERROR.Printf("Failed to receive Message: %+v", err)
}
jww.TRACE.Printf("[DM indexedDB] Calling ReceiveMessageCB(%v, %v, f)",
uuid, pubKey)
go w.receivedMessageCB(uuid, pubKey, false)
return uuid
}
@@ -277,6 +289,8 @@ func (w *wasmModel) UpdateSentStatus(uuid uint64, messageID message.ID,
// special version of receiveHelper)
w.updateMux.Lock()
defer w.updateMux.Unlock()
jww.TRACE.Printf("[DM indexedDB] UpdateSentStatus(%d, %s, ...)",
uuid, messageID)
// Convert messageID to the key generated by json.Marshal
key := js.ValueOf(uuid)
@@ -316,6 +330,9 @@ func (w *wasmModel) UpdateSentStatus(uuid uint64, messageID message.ID,
if err != nil {
jww.ERROR.Printf("%+v", errors.Wrap(parentErr, err.Error()))
}
jww.TRACE.Printf("[DM indexedDB] Calling ReceiveMessageCB(%v, %v, t)",
uuid, newMessage.ConversationPubKey)
go w.receivedMessageCB(uuid, newMessage.ConversationPubKey, true)
}
Loading