create new conversation on unknown accept
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Dan Ballard 2021-12-19 15:01:21 -05:00
parent e07b3e5259
commit c3a830628a
1 changed files with 7 additions and 0 deletions

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()