Skip to content
Snippets Groups Projects
Commit 53e94f01 authored by Jono Wenger's avatar Jono Wenger
Browse files

Update deps

parent aef91c3e
No related branches found
No related tags found
2 merge requests!60Revert "Fail a test to be sure it works",!32Admin Commands
...@@ -12,8 +12,8 @@ build: ...@@ -12,8 +12,8 @@ build:
go mod tidy go mod tidy
update_release: update_release:
GOFLAGS="" go get -d gitlab.com/elixxir/client/v4@release GOFLAGS="" go get -d gitlab.com/elixxir/client/v4@project/adminCommands
GOFLAGS="" go get gitlab.com/elixxir/crypto@release GOFLAGS="" go get gitlab.com/elixxir/crypto@project/adminCommands
GOFLAGS="" go get gitlab.com/elixxir/primitives@release GOFLAGS="" go get gitlab.com/elixxir/primitives@release
GOFLAGS="" go get gitlab.com/xx_network/crypto@release GOFLAGS="" go get gitlab.com/xx_network/crypto@release
GOFLAGS="" go get gitlab.com/xx_network/primitives@release GOFLAGS="" go get gitlab.com/xx_network/primitives@release
......
...@@ -8,7 +8,7 @@ require ( ...@@ -8,7 +8,7 @@ require (
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/jwalterweatherman v1.1.0
gitlab.com/elixxir/client/v4 v4.3.12-0.20230104175249-e265a4ca4e58 gitlab.com/elixxir/client/v4 v4.3.12-0.20230104175249-e265a4ca4e58
gitlab.com/elixxir/crypto v0.0.7-0.20221220211727-4158804e6037 gitlab.com/elixxir/crypto v0.0.7-0.20230104175234-604a6cd56b98
gitlab.com/elixxir/primitives v0.0.3-0.20221214192222-988b44a6958a gitlab.com/elixxir/primitives v0.0.3-0.20221214192222-988b44a6958a
gitlab.com/xx_network/crypto v0.0.5-0.20221121220724-8eefdbb0eb46 gitlab.com/xx_network/crypto v0.0.5-0.20221121220724-8eefdbb0eb46
gitlab.com/xx_network/primitives v0.0.4-0.20221219230308-4b5550a9247d gitlab.com/xx_network/primitives v0.0.4-0.20221219230308-4b5550a9247d
......
...@@ -382,8 +382,8 @@ gitlab.com/elixxir/client/v4 v4.3.12-0.20230104175249-e265a4ca4e58 h1:cZFtKQQT3F ...@@ -382,8 +382,8 @@ gitlab.com/elixxir/client/v4 v4.3.12-0.20230104175249-e265a4ca4e58 h1:cZFtKQQT3F
gitlab.com/elixxir/client/v4 v4.3.12-0.20230104175249-e265a4ca4e58/go.mod h1:IbslBQ3B9cAoWiHhucRSLcDiF6CMIDmbRlHfoO0sEDA= gitlab.com/elixxir/client/v4 v4.3.12-0.20230104175249-e265a4ca4e58/go.mod h1:IbslBQ3B9cAoWiHhucRSLcDiF6CMIDmbRlHfoO0sEDA=
gitlab.com/elixxir/comms v0.0.4-0.20221215214627-7807bfdde33a h1:DuqDqWc5cWjZ3qk98K1Bf9y1dYlyCeIigFmkHWDKc1Q= gitlab.com/elixxir/comms v0.0.4-0.20221215214627-7807bfdde33a h1:DuqDqWc5cWjZ3qk98K1Bf9y1dYlyCeIigFmkHWDKc1Q=
gitlab.com/elixxir/comms v0.0.4-0.20221215214627-7807bfdde33a/go.mod h1:B2Yek4mCbtN2aXZkyZcUffd3sTEZ5WgKD0mRBSVYtF8= gitlab.com/elixxir/comms v0.0.4-0.20221215214627-7807bfdde33a/go.mod h1:B2Yek4mCbtN2aXZkyZcUffd3sTEZ5WgKD0mRBSVYtF8=
gitlab.com/elixxir/crypto v0.0.7-0.20221220211727-4158804e6037 h1:R6jdr5GiYmZGYYdCokey/k2JJD1eB0+AwD+BVNT6iBQ= gitlab.com/elixxir/crypto v0.0.7-0.20230104175234-604a6cd56b98 h1:4uAPUenpRJYdnVGJzC3QXPX+dQkztL3YOMC1C0lJGN4=
gitlab.com/elixxir/crypto v0.0.7-0.20221220211727-4158804e6037/go.mod h1:7whUm4bnEdEoiVfMnu3TbHgvlrz0Ywp/Tekqg2Wl7vw= gitlab.com/elixxir/crypto v0.0.7-0.20230104175234-604a6cd56b98/go.mod h1:7whUm4bnEdEoiVfMnu3TbHgvlrz0Ywp/Tekqg2Wl7vw=
gitlab.com/elixxir/ekv v0.2.1 h1:dtwbt6KmAXG2Tik5d60iDz2fLhoFBgWwST03p7T+9Is= gitlab.com/elixxir/ekv v0.2.1 h1:dtwbt6KmAXG2Tik5d60iDz2fLhoFBgWwST03p7T+9Is=
gitlab.com/elixxir/ekv v0.2.1/go.mod h1:USLD7xeDnuZEavygdrgzNEwZXeLQJK/w1a+htpN+JEU= gitlab.com/elixxir/ekv v0.2.1/go.mod h1:USLD7xeDnuZEavygdrgzNEwZXeLQJK/w1a+htpN+JEU=
gitlab.com/elixxir/primitives v0.0.3-0.20221214192222-988b44a6958a h1:F17FfEjS+/uDI/TTYQD21S5JvNZ9+p9bieau2nyLCzo= gitlab.com/elixxir/primitives v0.0.3-0.20221214192222-988b44a6958a h1:F17FfEjS+/uDI/TTYQD21S5JvNZ9+p9bieau2nyLCzo=
......
...@@ -152,10 +152,9 @@ func (w *wasmModel) deleteMsgByChannel(channelID *id.ID) error { ...@@ -152,10 +152,9 @@ func (w *wasmModel) deleteMsgByChannel(channelID *id.ID) error {
// //
// It may be called multiple times on the same message; it is incumbent on the // It may be called multiple times on the same message; it is incumbent on the
// user of the API to filter such called by message ID. // user of the API to filter such called by message ID.
func (w *wasmModel) ReceiveMessage(channelID *id.ID, func (w *wasmModel) ReceiveMessage(channelID *id.ID, messageID message.ID,
messageID message.ID, nickname, text string, nickname, text string, pubKey ed25519.PublicKey, dmToken uint32,
pubKey ed25519.PublicKey, dmToken uint32, codeset uint8, codeset uint8, timestamp time.Time, lease time.Duration, round rounds.Round,
timestamp time.Time, lease time.Duration, round rounds.Round,
mType channels.MessageType, status channels.SentStatus, hidden bool) uint64 { mType channels.MessageType, status channels.SentStatus, hidden bool) uint64 {
textBytes := []byte(text) textBytes := []byte(text)
var err error var err error
...@@ -189,11 +188,11 @@ func (w *wasmModel) ReceiveMessage(channelID *id.ID, ...@@ -189,11 +188,11 @@ func (w *wasmModel) ReceiveMessage(channelID *id.ID,
// //
// Messages may arrive our of order, so a reply, in theory, can arrive before // Messages may arrive our of order, so a reply, in theory, can arrive before
// the initial message. As a result, it may be important to buffer replies. // the initial message. As a result, it may be important to buffer replies.
func (w *wasmModel) ReceiveReply(channelID *id.ID, func (w *wasmModel) ReceiveReply(channelID *id.ID, messageID,
messageID message.ID, replyTo message.ID, replyTo message.ID, nickname, text string, pubKey ed25519.PublicKey,
nickname, text string, pubKey ed25519.PublicKey, dmToken uint32, codeset uint8, dmToken uint32, codeset uint8, timestamp time.Time, lease time.Duration,
timestamp time.Time, lease time.Duration, round rounds.Round, round rounds.Round, mType channels.MessageType, status channels.SentStatus,
mType channels.MessageType, status channels.SentStatus, hidden bool) uint64 { hidden bool) uint64 {
textBytes := []byte(text) textBytes := []byte(text)
var err error var err error
...@@ -225,11 +224,11 @@ func (w *wasmModel) ReceiveReply(channelID *id.ID, ...@@ -225,11 +224,11 @@ func (w *wasmModel) ReceiveReply(channelID *id.ID,
// //
// Messages may arrive our of order, so a reply, in theory, can arrive before // Messages may arrive our of order, so a reply, in theory, can arrive before
// the initial message. As a result, it may be important to buffer reactions. // the initial message. As a result, it may be important to buffer reactions.
func (w *wasmModel) ReceiveReaction(channelID *id.ID, func (w *wasmModel) ReceiveReaction(channelID *id.ID, messageID,
messageID message.ID, reactionTo message.ID, reactionTo message.ID, nickname, reaction string, pubKey ed25519.PublicKey,
nickname, reaction string, pubKey ed25519.PublicKey, dmToken uint32, codeset uint8, dmToken uint32, codeset uint8, timestamp time.Time, lease time.Duration,
timestamp time.Time, lease time.Duration, round rounds.Round, round rounds.Round, mType channels.MessageType, status channels.SentStatus,
mType channels.MessageType, status channels.SentStatus, hidden bool) uint64 { hidden bool) uint64 {
textBytes := []byte(reaction) textBytes := []byte(reaction)
var err error var err error
...@@ -255,6 +254,9 @@ func (w *wasmModel) ReceiveReaction(channelID *id.ID, ...@@ -255,6 +254,9 @@ func (w *wasmModel) ReceiveReaction(channelID *id.ID,
return uuid return uuid
} }
// UpdateFromMessageID is called whenever a message with the message ID is
// modified.
//
// The API needs to return the UUID of the modified message that can be // The API needs to return the UUID of the modified message that can be
// referenced at a later time. // referenced at a later time.
// //
...@@ -296,9 +298,9 @@ func (w *wasmModel) UpdateFromMessageID(messageID message.ID, ...@@ -296,9 +298,9 @@ func (w *wasmModel) UpdateFromMessageID(messageID message.ID,
// messageID, timestamp, round, pinned, and hidden are all nillable and may be // messageID, timestamp, round, pinned, and hidden are all nillable and may be
// updated based upon the UUID at a later date. If a nil value is passed, then // updated based upon the UUID at a later date. If a nil value is passed, then
// make no update. // make no update.
func (w *wasmModel) UpdateFromUUID(uuid uint64, func (w *wasmModel) UpdateFromUUID(uuid uint64, messageID *message.ID,
messageID *message.ID, timestamp *time.Time, timestamp *time.Time, round *rounds.Round, pinned, hidden *bool,
round *rounds.Round, pinned, hidden *bool, status *channels.SentStatus) { status *channels.SentStatus) {
parentErr := errors.New("failed to UpdateFromUUID") parentErr := errors.New("failed to UpdateFromUUID")
// FIXME: this is a bit of race condition without the mux. // FIXME: this is a bit of race condition without the mux.
...@@ -327,9 +329,8 @@ func (w *wasmModel) UpdateFromUUID(uuid uint64, ...@@ -327,9 +329,8 @@ func (w *wasmModel) UpdateFromUUID(uuid uint64,
} }
// updateMessage is a helper for updating a stored message. // updateMessage is a helper for updating a stored message.
func (w *wasmModel) updateMessage(currentMsgJson string, func (w *wasmModel) updateMessage(currentMsgJson string, messageID *message.ID,
messageID *message.ID, timestamp *time.Time, timestamp *time.Time, round *rounds.Round, pinned, hidden *bool,
round *rounds.Round, pinned, hidden *bool,
status *channels.SentStatus) (uint64, error) { status *channels.SentStatus) (uint64, error) {
newMessage := &Message{} newMessage := &Message{}
...@@ -380,9 +381,10 @@ func (w *wasmModel) updateMessage(currentMsgJson string, ...@@ -380,9 +381,10 @@ func (w *wasmModel) updateMessage(currentMsgJson string,
// autoincrement key by default. If you are trying to overwrite an existing // autoincrement key by default. If you are trying to overwrite an existing
// message, then you need to set it manually yourself. // message, then you need to set it manually yourself.
func buildMessage(channelID, messageID, parentID []byte, nickname string, func buildMessage(channelID, messageID, parentID []byte, nickname string,
text []byte, pubKey ed25519.PublicKey, dmToken uint32, codeset uint8, timestamp time.Time, text []byte, pubKey ed25519.PublicKey, dmToken uint32, codeset uint8,
lease time.Duration, round id.Round, mType channels.MessageType, timestamp time.Time, lease time.Duration, round id.Round,
pinned, hidden bool, status channels.SentStatus) *Message { mType channels.MessageType, pinned, hidden bool,
status channels.SentStatus) *Message {
return &Message{ return &Message{
MessageID: messageID, MessageID: messageID,
Nickname: nickname, Nickname: nickname,
...@@ -404,8 +406,8 @@ func buildMessage(channelID, messageID, parentID []byte, nickname string, ...@@ -404,8 +406,8 @@ func buildMessage(channelID, messageID, parentID []byte, nickname string,
} }
// receiveHelper is a private helper for receiving any sort of message. // receiveHelper is a private helper for receiving any sort of message.
func (w *wasmModel) receiveHelper(newMessage *Message, isUpdate bool) (uint64, func (w *wasmModel) receiveHelper(
error) { newMessage *Message, isUpdate bool) (uint64, error) {
// Convert to jsObject // Convert to jsObject
newMessageJson, err := json.Marshal(newMessage) newMessageJson, err := json.Marshal(newMessage)
if err != nil { if err != nil {
...@@ -437,7 +439,7 @@ func (w *wasmModel) receiveHelper(newMessage *Message, isUpdate bool) (uint64, ...@@ -437,7 +439,7 @@ func (w *wasmModel) receiveHelper(newMessage *Message, isUpdate bool) (uint64,
msgID := message.ID{} msgID := message.ID{}
copy(msgID[:], newMessage.MessageID) copy(msgID[:], newMessage.MessageID)
msg, errLookup := w.msgIDLookup(msgID) msg, errLookup := w.msgIDLookup(msgID)
if msg.ID != 0 && errLookup == nil { if errLookup == nil && msg.ID != 0 {
return msg.ID, nil return msg.ID, nil
} }
return 0, errors.Errorf("uuid lookup failure: %+v", err) return 0, errors.Errorf("uuid lookup failure: %+v", err)
...@@ -449,7 +451,8 @@ func (w *wasmModel) receiveHelper(newMessage *Message, isUpdate bool) (uint64, ...@@ -449,7 +451,8 @@ func (w *wasmModel) receiveHelper(newMessage *Message, isUpdate bool) (uint64,
} }
// GetMessage returns the message with the given [channel.MessageID]. // GetMessage returns the message with the given [channel.MessageID].
func (w *wasmModel) GetMessage(messageID message.ID) (channels.ModelMessage, error) { func (w *wasmModel) GetMessage(
messageID message.ID) (channels.ModelMessage, error) {
lookupResult, err := w.msgIDLookup(messageID) lookupResult, err := w.msgIDLookup(messageID)
if err != nil { if err != nil {
return channels.ModelMessage{}, err return channels.ModelMessage{}, err
...@@ -491,8 +494,7 @@ func (w *wasmModel) GetMessage(messageID message.ID) (channels.ModelMessage, err ...@@ -491,8 +494,7 @@ func (w *wasmModel) GetMessage(messageID message.ID) (channels.ModelMessage, err
} }
// msgIDLookup gets the UUID of the Message with the given messageID. // msgIDLookup gets the UUID of the Message with the given messageID.
func (w *wasmModel) msgIDLookup(messageID message.ID) (*Message, func (w *wasmModel) msgIDLookup(messageID message.ID) (*Message, error) {
error) {
msgIDStr := js.ValueOf(base64.StdEncoding.EncodeToString(messageID.Bytes())) msgIDStr := js.ValueOf(base64.StdEncoding.EncodeToString(messageID.Bytes()))
resultObj, err := indexedDb.GetIndex(w.db, messageStoreName, resultObj, err := indexedDb.GetIndex(w.db, messageStoreName,
messageStoreMessageIndex, msgIDStr) messageStoreMessageIndex, msgIDStr)
......
...@@ -40,7 +40,8 @@ func dummyCallback(uint64, *id.ID, bool) {} ...@@ -40,7 +40,8 @@ func dummyCallback(uint64, *id.ID, bool) {}
// Happy path, insert message and look it up // Happy path, insert message and look it up
func TestWasmModel_msgIDLookup(t *testing.T) { func TestWasmModel_msgIDLookup(t *testing.T) {
cipher, err := cryptoChannel.NewCipher([]byte("testpass"), []byte("testsalt"), 128, csprng.NewSystemRNG()) cipher, err := cryptoChannel.NewCipher(
[]byte("testpass"), []byte("testsalt"), 128, csprng.NewSystemRNG())
if err != nil { if err != nil {
t.Fatalf("Failed to create cipher") t.Fatalf("Failed to create cipher")
} }
...@@ -125,7 +126,8 @@ func TestWasmModel_DeleteMessage(t *testing.T) { ...@@ -125,7 +126,8 @@ func TestWasmModel_DeleteMessage(t *testing.T) {
// Test wasmModel.UpdateSentStatus happy path and ensure fields don't change. // Test wasmModel.UpdateSentStatus happy path and ensure fields don't change.
func Test_wasmModel_UpdateSentStatus(t *testing.T) { func Test_wasmModel_UpdateSentStatus(t *testing.T) {
cipher, err := cryptoChannel.NewCipher([]byte("testpass"), []byte("testsalt"), 128, csprng.NewSystemRNG()) cipher, err := cryptoChannel.NewCipher(
[]byte("testpass"), []byte("testsalt"), 128, csprng.NewSystemRNG())
if err != nil { if err != nil {
t.Fatalf("Failed to create cipher") t.Fatalf("Failed to create cipher")
} }
...@@ -134,10 +136,11 @@ func Test_wasmModel_UpdateSentStatus(t *testing.T) { ...@@ -134,10 +136,11 @@ func Test_wasmModel_UpdateSentStatus(t *testing.T) {
if c != nil { if c != nil {
cs = "_withCipher" cs = "_withCipher"
} }
t.Run(fmt.Sprintf("Test_wasmModel_UpdateSentStatus%s", cs), func(t *testing.T) { t.Run("Test_wasmModel_UpdateSentStatus"+cs, func(t *testing.T) {
storage.GetLocalStorage().Clear() storage.GetLocalStorage().Clear()
testString := "Test_wasmModel_UpdateSentStatus" + cs testString := "Test_wasmModel_UpdateSentStatus" + cs
testMsgId := message.DeriveChannelMessageID(&id.ID{1}, 0, []byte(testString)) testMsgId := message.DeriveChannelMessageID(
&id.ID{1}, 0, []byte(testString))
eventModel, err := newWASMModel(testString, c, dummyCallback) eventModel, err := newWASMModel(testString, c, dummyCallback)
if err != nil { if err != nil {
t.Fatalf("%+v", err) t.Fatalf("%+v", err)
...@@ -193,7 +196,8 @@ func Test_wasmModel_UpdateSentStatus(t *testing.T) { ...@@ -193,7 +196,8 @@ func Test_wasmModel_UpdateSentStatus(t *testing.T) {
// Smoke test wasmModel.JoinChannel/wasmModel.LeaveChannel happy paths. // Smoke test wasmModel.JoinChannel/wasmModel.LeaveChannel happy paths.
func Test_wasmModel_JoinChannel_LeaveChannel(t *testing.T) { func Test_wasmModel_JoinChannel_LeaveChannel(t *testing.T) {
cipher, err := cryptoChannel.NewCipher([]byte("testpass"), []byte("testsalt"), 128, csprng.NewSystemRNG()) cipher, err := cryptoChannel.NewCipher(
[]byte("testpass"), []byte("testsalt"), 128, csprng.NewSystemRNG())
if err != nil { if err != nil {
t.Fatalf("Failed to create cipher") t.Fatalf("Failed to create cipher")
} }
......
...@@ -99,10 +99,10 @@ func (w *wasmModel) Receive(messageID message.ID, nickname string, text []byte, ...@@ -99,10 +99,10 @@ func (w *wasmModel) Receive(messageID message.ID, nickname string, text []byte,
pubKey ed25519.PublicKey, dmToken uint32, codeset uint8, timestamp time.Time, pubKey ed25519.PublicKey, dmToken uint32, codeset uint8, timestamp time.Time,
round rounds.Round, mType dm.MessageType, status dm.Status) uint64 { round rounds.Round, mType dm.MessageType, status dm.Status) uint64 {
parentErr := errors.New("failed to Receive") parentErr := errors.New("failed to Receive")
var err error
// If there is no extant Conversation, create one. // If there is no extant Conversation, create one.
if _, err := indexedDb.Get(w.db, conversationStoreName, utils.CopyBytesToJS(pubKey)); err != nil { _, err := indexedDb.Get(w.db, conversationStoreName, utils.CopyBytesToJS(pubKey))
if err != nil {
if strings.Contains(err.Error(), indexedDb.ErrDoesNotExist) { if strings.Contains(err.Error(), indexedDb.ErrDoesNotExist) {
err = w.joinConversation(nickname, pubKey, dmToken, codeset) err = w.joinConversation(nickname, pubKey, dmToken, codeset)
if err != nil { if err != nil {
...@@ -141,10 +141,10 @@ func (w *wasmModel) ReceiveText(messageID message.ID, nickname, text string, ...@@ -141,10 +141,10 @@ func (w *wasmModel) ReceiveText(messageID message.ID, nickname, text string,
pubKey ed25519.PublicKey, dmToken uint32, codeset uint8, timestamp time.Time, pubKey ed25519.PublicKey, dmToken uint32, codeset uint8, timestamp time.Time,
round rounds.Round, status dm.Status) uint64 { round rounds.Round, status dm.Status) uint64 {
parentErr := errors.New("failed to ReceiveText") parentErr := errors.New("failed to ReceiveText")
var err error
// If there is no extant Conversation, create one. // If there is no extant Conversation, create one.
if _, err := indexedDb.Get(w.db, conversationStoreName, utils.CopyBytesToJS(pubKey)); err != nil { _, err := indexedDb.Get(w.db, conversationStoreName, utils.CopyBytesToJS(pubKey))
if err != nil {
if strings.Contains(err.Error(), indexedDb.ErrDoesNotExist) { if strings.Contains(err.Error(), indexedDb.ErrDoesNotExist) {
err = w.joinConversation(nickname, pubKey, dmToken, codeset) err = w.joinConversation(nickname, pubKey, dmToken, codeset)
if err != nil { if err != nil {
...@@ -182,13 +182,14 @@ func (w *wasmModel) ReceiveText(messageID message.ID, nickname, text string, ...@@ -182,13 +182,14 @@ func (w *wasmModel) ReceiveText(messageID message.ID, nickname, text string,
} }
func (w *wasmModel) ReceiveReply(messageID message.ID, reactionTo message.ID, func (w *wasmModel) ReceiveReply(messageID message.ID, reactionTo message.ID,
nickname, text string, pubKey ed25519.PublicKey, dmToken uint32, codeset uint8, nickname, text string, pubKey ed25519.PublicKey, dmToken uint32,
timestamp time.Time, round rounds.Round, status dm.Status) uint64 { codeset uint8, timestamp time.Time, round rounds.Round,
status dm.Status) uint64 {
parentErr := errors.New("failed to ReceiveReply") parentErr := errors.New("failed to ReceiveReply")
var err error
// If there is no extant Conversation, create one. // If there is no extant Conversation, create one.
if _, err := indexedDb.Get(w.db, conversationStoreName, utils.CopyBytesToJS(pubKey)); err != nil { _, err := indexedDb.Get(w.db, conversationStoreName, utils.CopyBytesToJS(pubKey))
if err != nil {
if strings.Contains(err.Error(), indexedDb.ErrDoesNotExist) { if strings.Contains(err.Error(), indexedDb.ErrDoesNotExist) {
err = w.joinConversation(nickname, pubKey, dmToken, codeset) err = w.joinConversation(nickname, pubKey, dmToken, codeset)
if err != nil { if err != nil {
...@@ -229,10 +230,10 @@ func (w *wasmModel) ReceiveReaction(messageID message.ID, reactionTo message.ID, ...@@ -229,10 +230,10 @@ func (w *wasmModel) ReceiveReaction(messageID message.ID, reactionTo message.ID,
nickname, reaction string, pubKey ed25519.PublicKey, dmToken uint32, nickname, reaction string, pubKey ed25519.PublicKey, dmToken uint32,
codeset uint8, timestamp time.Time, round rounds.Round, status dm.Status) uint64 { codeset uint8, timestamp time.Time, round rounds.Round, status dm.Status) uint64 {
parentErr := errors.New("failed to ReceiveText") parentErr := errors.New("failed to ReceiveText")
var err error
// If there is no extant Conversation, create one. // If there is no extant Conversation, create one.
if _, err := indexedDb.Get(w.db, conversationStoreName, utils.CopyBytesToJS(pubKey)); err != nil { _, err := indexedDb.Get(w.db, conversationStoreName, utils.CopyBytesToJS(pubKey))
if err != nil {
if strings.Contains(err.Error(), indexedDb.ErrDoesNotExist) { if strings.Contains(err.Error(), indexedDb.ErrDoesNotExist) {
err = w.joinConversation(nickname, pubKey, dmToken, codeset) err = w.joinConversation(nickname, pubKey, dmToken, codeset)
if err != nil { if err != nil {
......
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