Chat Federation: using S2S if available.
* if both local and remote instance have external XMPP connections enabled, the user joins the remote room with his local account * some code refactoring (builtin.ts) Note: documentation and settings descriptions are to do. Related to #112
This commit is contained in:
@ -31,6 +31,17 @@ function anonymousConnectionInfos (livechatInfos: LiveChatJSONLDAttribute | fals
|
||||
return r
|
||||
}
|
||||
|
||||
export {
|
||||
anonymousConnectionInfos
|
||||
function remoteAuthenticatedConnectionEnabled (livechatInfos: LiveChatJSONLDAttribute | false): boolean {
|
||||
if (!livechatInfos) { return false }
|
||||
if (!livechatInfos.links) { return false }
|
||||
if (livechatInfos.type !== 'xmpp') { return false }
|
||||
for (const link of livechatInfos.links) {
|
||||
if (link.type === 'xmpp-s2s') { return true }
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
export {
|
||||
anonymousConnectionInfos,
|
||||
remoteAuthenticatedConnectionEnabled
|
||||
}
|
||||
|
Reference in New Issue
Block a user