From 3dc5dbb38ea5ecc31b7f234b3cdfe3a3a1b657fa Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Sat, 30 Jul 2022 00:19:16 -0700 Subject: [PATCH] fix errs --- peer/cwtch_peer.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/peer/cwtch_peer.go b/peer/cwtch_peer.go index 78fe9ac..99c4ffa 100644 --- a/peer/cwtch_peer.go +++ b/peer/cwtch_peer.go @@ -483,10 +483,10 @@ func (cp *cwtchPeer) ImportGroup(exportedInvite string) (int, error) { return -1, err } cp.mutex.Lock() - conversationInfo, err := cp.storage.GetConversationByHandle(gci.GroupID) + conversationInfo, _ := cp.storage.GetConversationByHandle(gci.GroupID) if conversationInfo != nil { cp.mutex.Unlock() - return -1, err + return -1, fmt.Errorf("group already exists") } groupConversationID, err := cp.storage.NewConversation(gci.GroupID, map[string]string{}, model.AccessControlList{}, true) cp.mutex.Unlock() @@ -506,13 +506,13 @@ func (cp *cwtchPeer) ImportGroup(exportedInvite string) (int, error) { func (cp *cwtchPeer) NewContactConversation(handle string, acl model.AccessControl, accepted bool) (int, error) { cp.mutex.Lock() defer cp.mutex.Unlock() - conversationInfo, err := cp.storage.GetConversationByHandle(handle) + conversationInfo, _ := cp.storage.GetConversationByHandle(handle) if conversationInfo == nil { conversationID, err := cp.storage.NewConversation(handle, model.Attributes{event.SaveHistoryKey: event.DeleteHistoryDefault}, model.AccessControlList{handle: acl}, accepted) cp.eventBus.Publish(event.NewEvent(event.ContactCreated, map[event.Field]string{event.ConversationID: strconv.Itoa(conversationID), event.RemotePeer: handle})) return conversationID, err } - return -1, err + return -1, fmt.Errorf("contact conversation already exists") } // AcceptConversation looks up a conversation by `handle` and sets the Accepted status to `true`