Custom channel emoticons WIP (#130)

This commit is contained in:
John Livingston
2024-06-04 16:39:25 +02:00
parent 607a71b8cb
commit 688ab4f029
15 changed files with 469 additions and 48 deletions

View File

@ -15,6 +15,7 @@ import { getBaseRouterRoute, getBaseStaticRoute } from '../helpers'
import { getProsodyDomain } from '../prosody/config/domain'
import { getBoshUri, getWSUri } from '../uri/webchat'
import { ExternalAuthOIDC } from '../external-auth/oidc'
import { Emojis } from '../emojis'
interface GetConverseJSParamsParams {
readonly?: boolean | 'noscroll'
@ -284,10 +285,11 @@ async function _connectionInfos (
params.forcetype ?? false
)
if (!settings['disable-channel-configuration'] && video?.channelId) {
if (video?.channelId && await Emojis.singletonSafe()?.channelHasCustomEmojis(video.channelId)) {
customEmojisUrl = getBaseRouterRoute(options) +
'api/configuration/channel/emojis/' +
encodeURIComponent(video.channelId)
'emojis/channel/' +
encodeURIComponent(video.channelId) +
'/definition'
}
} catch (err) {
options.peertubeHelpers.logger.error(err)