Add additional information to DeleteContact event
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
cff2a8cafe
commit
86ae2a7c1a
|
@ -769,7 +769,8 @@ func (cp *cwtchPeer) DeleteConversation(id int) error {
|
||||||
defer cp.mutex.Unlock()
|
defer cp.mutex.Unlock()
|
||||||
ci, err := cp.storage.GetConversation(id)
|
ci, err := cp.storage.GetConversation(id)
|
||||||
if err == nil && ci != nil {
|
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 cp.storage.DeleteConversation(id)
|
||||||
}
|
}
|
||||||
return fmt.Errorf("could not delete conversation, did not exist")
|
return fmt.Errorf("could not delete conversation, did not exist")
|
||||||
|
|
|
@ -383,6 +383,10 @@ func TestCwtchPeerIntegration(t *testing.T) {
|
||||||
checkMessage(t, carol, carolGroupConversationID, 5, carolLines[0])
|
checkMessage(t, carol, carolGroupConversationID, 5, carolLines[0])
|
||||||
checkMessage(t, carol, carolGroupConversationID, 6, bobLines[2])
|
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...")
|
log.Infof("Shutting down Bob...")
|
||||||
app.ShutdownPeer(bob.GetOnion())
|
app.ShutdownPeer(bob.GetOnion())
|
||||||
time.Sleep(time.Second * 3)
|
time.Sleep(time.Second * 3)
|
||||||
|
|
Loading…
Reference in New Issue