From 86ae2a7c1aae74af01e715a88c108ef6da48521a Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Mon, 12 Jun 2023 11:45:20 -0700 Subject: [PATCH] Add additional information to DeleteContact event --- peer/cwtch_peer.go | 3 ++- testing/cwtch_peer_server_integration_test.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/peer/cwtch_peer.go b/peer/cwtch_peer.go index 3cebec5..aa15c2d 100644 --- a/peer/cwtch_peer.go +++ b/peer/cwtch_peer.go @@ -769,7 +769,8 @@ func (cp *cwtchPeer) DeleteConversation(id int) error { defer cp.mutex.Unlock() ci, err := cp.storage.GetConversation(id) if err == nil && ci != nil { - cp.eventBus.Publish(event.NewEventList(event.DeleteContact, event.RemotePeer, ci.Handle)) + log.Debugf("deleting %v", ci) + cp.eventBus.Publish(event.NewEventList(event.DeleteContact, event.RemotePeer, ci.Handle, event.ConversationID, id)) return cp.storage.DeleteConversation(id) } return fmt.Errorf("could not delete conversation, did not exist") diff --git a/testing/cwtch_peer_server_integration_test.go b/testing/cwtch_peer_server_integration_test.go index 93d0a56..73c53d7 100644 --- a/testing/cwtch_peer_server_integration_test.go +++ b/testing/cwtch_peer_server_integration_test.go @@ -383,6 +383,10 @@ func TestCwtchPeerIntegration(t *testing.T) { checkMessage(t, carol, carolGroupConversationID, 5, carolLines[0]) checkMessage(t, carol, carolGroupConversationID, 6, bobLines[2]) + // Have bob clean up some conversations... + log.Infof("Bob cleanup conversation") + bob.DeleteConversation(1) + log.Infof("Shutting down Bob...") app.ShutdownPeer(bob.GetOnion()) time.Sleep(time.Second * 3)