Fix: direct s2s connection not always possible
Trying to connect to a remote instance using direct s2s won't work if local instance has not the feature enabled, and if the remote instance does not know the local one. So using Websocket S2S in such case (that embed a discovery mecanism).
This commit is contained in:
@ -52,14 +52,9 @@ function compatibleRemoteAuthenticatedConnectionEnabled (
|
||||
if (!('xmppserver' in livechatInfos)) { return false }
|
||||
if (!livechatInfos.xmppserver) { return false }
|
||||
|
||||
// FIXME: these tests does not really represent what Prosody will do.
|
||||
// Prosody can use Websocket in one way and Direct S2S in the other.
|
||||
// I don't really know what to test here.
|
||||
// In real case scenario, we should always have Websocket S2S on both side...
|
||||
// They are rare cases where Websocket is disabled on an entire server.
|
||||
// In such case, we indeed need direct S2S on both side.
|
||||
// So these tests should work.
|
||||
if (canWebsocketS2S && livechatInfos.xmppserver.websockets2s) { return true }
|
||||
// Note: see comments neer option s2s_peertubelivechat_no_outgoing_directs2s_to_peertube
|
||||
// to understand why we need both to be true.
|
||||
if (canDirectS2S && livechatInfos.xmppserver.directs2s) { return true }
|
||||
|
||||
return false
|
||||
|
Reference in New Issue
Block a user