create new conversation on unknown accept #419

Merged
sarah merged 2 commits from newContact into master 2021-12-19 20:32:44 +00:00
1 changed files with 7 additions and 0 deletions
Showing only changes of commit c3a830628a - Show all commits

View File

@ -1169,6 +1169,13 @@ func (cp *cwtchPeer) eventHandler() {
}
}
case event.PeerStateChange:
handle := ev.Data[event.RemotePeer]
if connections.ConnectionStateToType()[ev.Data[event.ConnectionState]] == connections.AUTHENTICATED {
_, err := cp.FetchConversationInfo(handle)
if err != nil {
cp.NewContactConversation(handle, model.DefaultP2PAccessControl(), false)
}
}
cp.mutex.Lock()
cp.state[ev.Data[event.RemotePeer]] = connections.ConnectionStateToType()[ev.Data[event.ConnectionState]]
cp.mutex.Unlock()