From 8967d2e85c80ca8b05fa185950823f3b3a3427e8 Mon Sep 17 00:00:00 2001 From: Jake Taylor <jake@elixxir.io> Date: Thu, 8 Sep 2022 12:29:11 -0500 Subject: [PATCH] fix eventModel interface --- channels/eventModel.go | 7 ++++--- channels/eventModel_test.go | 26 ++++++++++++++++++++++++++ channels/joinedChannel_test.go | 26 ++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 3 deletions(-) diff --git a/channels/eventModel.go b/channels/eventModel.go index df9f8708f..403287adb 100644 --- a/channels/eventModel.go +++ b/channels/eventModel.go @@ -54,9 +54,10 @@ type EventModel interface { // it is incumbent on the user of the API to filter such called by message ID // 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. - ReceiveReply(ChannelID *id.ID, messageID cryptoChannel.MessageID, - SenderUsername string, text string, timestamp time.Time, - lease time.Duration, round rounds.Round) + ReceiveReply(channelID *id.ID, messageID cryptoChannel.MessageID, + reactionTo cryptoChannel.MessageID, senderUsername string, + text string, timestamp time.Time, lease time.Duration, + round rounds.Round) // ReceiveReaction is called whenever a reaction to a message is received // on a given channel. It may be called multiple times on the same reaction, diff --git a/channels/eventModel_test.go b/channels/eventModel_test.go index 866e2b761..a144be353 100644 --- a/channels/eventModel_test.go +++ b/channels/eventModel_test.go @@ -37,6 +37,32 @@ type MockEvent struct { eventReceive } +func (m *MockEvent) MessageSent(channelID *id.ID, messageID cryptoChannel.MessageID, + myUsername string, text string, timestamp time.Time, lease time.Duration, round rounds.Round) { + //TODO implement me + panic("implement me") +} + +func (m *MockEvent) ReplySent(channelID *id.ID, messageID cryptoChannel.MessageID, + replyTo cryptoChannel.MessageID, myUsername string, text string, + timestamp time.Time, lease time.Duration, round rounds.Round) { + //TODO implement me + panic("implement me") +} + +func (m *MockEvent) ReactionSent(channelID *id.ID, messageID cryptoChannel.MessageID, + reactionTo cryptoChannel.MessageID, senderUsername string, reaction string, + timestamp time.Time, lease time.Duration, round rounds.Round) { + //TODO implement me + panic("implement me") +} + +func (m *MockEvent) UpdateSentStatus(messageID cryptoChannel.MessageID, + status SentStatus) { + //TODO implement me + panic("implement me") +} + func (*MockEvent) JoinChannel(channel *cryptoBroadcast.Channel) {} func (*MockEvent) LeaveChannel(channelID *id.ID) {} func (m *MockEvent) ReceiveMessage(channelID *id.ID, messageID cryptoChannel.MessageID, diff --git a/channels/joinedChannel_test.go b/channels/joinedChannel_test.go index cebec207d..e3bcbb011 100644 --- a/channels/joinedChannel_test.go +++ b/channels/joinedChannel_test.go @@ -500,6 +500,32 @@ type mockEventModel struct { leftCh *id.ID } +func (m *mockEventModel) MessageSent(channelID *id.ID, messageID cryptoChannel.MessageID, + myUsername string, text string, timestamp time.Time, lease time.Duration, round rounds.Round) { + //TODO implement me + panic("implement me") +} + +func (m *mockEventModel) ReplySent(channelID *id.ID, messageID cryptoChannel.MessageID, + replyTo cryptoChannel.MessageID, myUsername string, text string, + timestamp time.Time, lease time.Duration, round rounds.Round) { + //TODO implement me + panic("implement me") +} + +func (m *mockEventModel) ReactionSent(channelID *id.ID, messageID cryptoChannel.MessageID, + reactionTo cryptoChannel.MessageID, senderUsername string, reaction string, + timestamp time.Time, lease time.Duration, round rounds.Round) { + //TODO implement me + panic("implement me") +} + +func (m *mockEventModel) UpdateSentStatus(messageID cryptoChannel.MessageID, + status SentStatus) { + //TODO implement me + panic("implement me") +} + func (m *mockEventModel) JoinChannel(c *cryptoBroadcast.Channel) { m.joinedCh = c } -- GitLab