Skip to content
Snippets Groups Projects
Commit 588de69e authored by Jake Taylor's avatar Jake Taylor :lips:
Browse files

fix compilation with new callbacks structure

parent 3c2fdd23
No related branches found
No related tags found
2 merge requests!136fix compilation with new callbacks structure,!109Project/haven beta
......@@ -11,7 +11,7 @@ require (
github.com/spf13/cobra v1.7.0
github.com/spf13/jwalterweatherman v1.1.0
github.com/stretchr/testify v1.8.2
gitlab.com/elixxir/client/v4 v4.6.4-0.20230627185732-24ba846899c6
gitlab.com/elixxir/client/v4 v4.6.4-0.20230627181021-98c72b18b83c
gitlab.com/elixxir/crypto v0.0.7-0.20230614183801-387e0cb8e76f
gitlab.com/elixxir/primitives v0.0.3-0.20230613193928-8cf8bdd777ef
gitlab.com/elixxir/wasm-utils v0.0.0-20230615222914-185dd3a6fa08
......
......@@ -411,8 +411,8 @@ github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo=
github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4=
gitlab.com/elixxir/bloomfilter v0.0.0-20230322223210-fa84f6842de8 h1:uAFCyBkXprQoPkcDDfxXtaMyL5x+xSGrAWzR907xROQ=
gitlab.com/elixxir/bloomfilter v0.0.0-20230322223210-fa84f6842de8/go.mod h1:1X8gRIAPDisS3W6Vtr/ymiUmZMJUIwDV1o5DEOo/pzw=
gitlab.com/elixxir/client/v4 v4.6.4-0.20230627185732-24ba846899c6 h1:fSvkUD3UfNjR1LcaQRqx+AzLjjQnVwwVzPUjkLbjBlM=
gitlab.com/elixxir/client/v4 v4.6.4-0.20230627185732-24ba846899c6/go.mod h1:wSeJ9pk+qqUrKHwhd4qZW1CnNlakK75n+1fOjJ7k1Ns=
gitlab.com/elixxir/client/v4 v4.6.4-0.20230627181021-98c72b18b83c h1:Mu1JezQryf4GjZXK4Xu08XDzXMydpVy8ujoCWLwvGmM=
gitlab.com/elixxir/client/v4 v4.6.4-0.20230627181021-98c72b18b83c/go.mod h1:wSeJ9pk+qqUrKHwhd4qZW1CnNlakK75n+1fOjJ7k1Ns=
gitlab.com/elixxir/comms v0.0.4-0.20230613220741-7de1d2ca4a1c h1:0TpLn4AdarrqCwUMvnz4Md+9gLyk9wrQ73J3W9U5zJo=
gitlab.com/elixxir/comms v0.0.4-0.20230613220741-7de1d2ca4a1c/go.mod h1:z+qW0D9VpY5QKTd7wRlb5SK4kBNqLYsa4DXBcUXue9Q=
gitlab.com/elixxir/crypto v0.0.7-0.20230614183801-387e0cb8e76f h1:T0Jvhq5nCELiwkVr07Ti/Ew9ICdexviYeCkFV19kk9A=
......
......@@ -21,7 +21,6 @@ import (
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/v4/bindings"
"gitlab.com/elixxir/client/v4/channels"
"gitlab.com/elixxir/client/v4/cmix/rounds"
cryptoBroadcast "gitlab.com/elixxir/crypto/broadcast"
......@@ -169,7 +168,7 @@ func (w *wasmModel) ReceiveMessage(channelID *id.ID, messageID message.ID,
return 0
}
go w.eventUpdate(bindings.MessageReceived, bindings.MessageReceivedJson{
go w.eventUpdate(channels.MessageReceived, channels.MessageReceivedJson{
Uuid: int64(uuid),
ChannelID: channelID,
Update: false,
......@@ -211,7 +210,7 @@ func (w *wasmModel) ReceiveReply(channelID *id.ID, messageID,
return 0
}
go w.eventUpdate(bindings.MessageReceived, bindings.MessageReceivedJson{
go w.eventUpdate(channels.MessageReceived, channels.MessageReceivedJson{
Uuid: int64(uuid),
ChannelID: channelID,
Update: false,
......@@ -253,7 +252,7 @@ func (w *wasmModel) ReceiveReaction(channelID *id.ID, messageID,
return 0
}
go w.eventUpdate(bindings.MessageReceived, bindings.MessageReceivedJson{
go w.eventUpdate(channels.MessageReceived, channels.MessageReceivedJson{
Uuid: int64(uuid),
ChannelID: channelID,
Update: false,
......@@ -410,7 +409,7 @@ func (w *wasmModel) updateMessage(currentMsg *Message, messageID *message.ID,
return 0, err
}
go w.eventUpdate(bindings.MessageReceived, bindings.MessageReceivedJson{
go w.eventUpdate(channels.MessageReceived, channels.MessageReceivedJson{
Uuid: int64(uuid),
ChannelID: channelID,
Update: true,
......@@ -532,8 +531,8 @@ func (w *wasmModel) DeleteMessage(messageID message.ID) error {
return err
}
go w.eventUpdate(bindings.MessageDeleted,
bindings.MessageDeletedJson{MessageID: messageID})
go w.eventUpdate(channels.MessageDeleted,
channels.MessageDeletedJson{MessageID: messageID})
return nil
}
......@@ -542,7 +541,7 @@ func (w *wasmModel) DeleteMessage(messageID message.ID) error {
func (w *wasmModel) MuteUser(
channelID *id.ID, pubKey ed25519.PublicKey, unmute bool) {
go w.eventUpdate(bindings.UserMuted, bindings.UserMutedJson{
go w.eventUpdate(channels.UserMuted, channels.UserMutedJson{
ChannelID: channelID,
PubKey: pubKey,
Unmute: unmute,
......
......@@ -16,7 +16,6 @@ import (
"github.com/hack-pad/go-indexeddb/idb"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/v4/bindings"
"gitlab.com/elixxir/client/v4/channels"
idbCrypto "gitlab.com/elixxir/crypto/indexedDb"
"gitlab.com/elixxir/xxdk-wasm/indexedDb/impl"
......@@ -30,13 +29,13 @@ const currentVersion uint = 1
// The name should be a base64 encoding of the users public key. Returns the
// EventModel based on IndexedDb and the database name as reported by IndexedDb.
func NewWASMEventModel(databaseName string, encryption idbCrypto.Cipher,
uiCallbacks bindings.ChannelUICallbacks) (channels.EventModel, error) {
uiCallbacks channels.ChannelUICallbacks) (channels.EventModel, error) {
return newWASMModel(databaseName, encryption, uiCallbacks)
}
// newWASMModel creates the given [idb.Database] and returns a wasmModel.
func newWASMModel(databaseName string, encryption idbCrypto.Cipher,
uiCallbacks bindings.ChannelUICallbacks) (*wasmModel, error) {
uiCallbacks channels.ChannelUICallbacks) (*wasmModel, error) {
// Attempt to open database object
ctx, cancel := impl.NewContext()
defer cancel()
......
......@@ -15,7 +15,6 @@ import (
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/v4/bindings"
"gitlab.com/elixxir/client/v4/channels"
idbCrypto "gitlab.com/elixxir/crypto/indexedDb"
"gitlab.com/elixxir/xxdk-wasm/logging"
......@@ -36,7 +35,7 @@ type eventUpdateCallback func(eventType int64, jsonData []byte)
// across the board.
func NewWASMEventModelBuilder(wasmJsPath string,
encryption idbCrypto.Cipher,
channelCbs bindings.ChannelUICallbacks) channels.EventModelBuilder {
channelCbs channels.ChannelUICallbacks) channels.EventModelBuilder {
fn := func(path string) (channels.EventModel, error) {
return NewWASMEventModel(path, wasmJsPath, encryption,
channelCbs)
......@@ -54,7 +53,7 @@ type NewWASMEventModelMessage struct {
// NewWASMEventModel returns a [channels.EventModel] backed by a wasmModel.
// The name should be a base64 encoding of the users public key.
func NewWASMEventModel(path, wasmJsPath string, encryption idbCrypto.Cipher,
channelCbs bindings.ChannelUICallbacks) (
channelCbs channels.ChannelUICallbacks) (
channels.EventModel, error) {
databaseName := path + databaseSuffix
......
......@@ -445,7 +445,7 @@ func NewChannelsManagerWithIndexedDbUnsafe(_ js.Value, args []js.Value) any {
func newChannelsManagerWithIndexedDb(cmixID int, wasmJsPath string,
privateIdentity, extensionBuilderIDsJSON []byte, notificationsID int,
channelsCbs bindings.ChannelUICallbacks,
channelsCbs channels.ChannelUICallbacks,
cipher *DbCipher) any {
model := channelsDb.NewWASMEventModelBuilder(
......@@ -558,7 +558,7 @@ func LoadChannelsManagerWithIndexedDbUnsafe(_ js.Value, args []js.Value) any {
}
func loadChannelsManagerWithIndexedDb(cmixID int, wasmJsPath, storageTag string,
extensionBuilderIDsJSON []byte, notificationsID int, channelsCbs bindings.ChannelUICallbacks,
extensionBuilderIDsJSON []byte, notificationsID int, channelsCbs channels.ChannelUICallbacks,
cipher *DbCipher) any {
model := channelsDb.NewWASMEventModelBuilder(
......
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