Pre-upload icons before diffing
This commit is contained in:
@@ -401,6 +401,7 @@ async function _syncRoom(channelID, shouldActuallySync) {
|
|||||||
console.log(`[room sync] to matrix: ${channel.name}`)
|
console.log(`[room sync] to matrix: ${channel.name}`)
|
||||||
|
|
||||||
const {spaceID, channelKState} = await channelToKState(channel, guild, {api}) // calling this in both branches because we don't want to calculate this if not syncing
|
const {spaceID, channelKState} = await channelToKState(channel, guild, {api}) // calling this in both branches because we don't want to calculate this if not syncing
|
||||||
|
await ks.kstateUploadMxc(channelKState) // pre-upload icons before diffing
|
||||||
|
|
||||||
// sync channel state to room
|
// sync channel state to room
|
||||||
const roomKState = await ks.roomToKState(roomID)
|
const roomKState = await ks.roomToKState(roomID)
|
||||||
|
|||||||
@@ -124,6 +124,8 @@ async function _syncSpace(guild, shouldActuallySync) {
|
|||||||
console.log(`[space sync] to matrix: ${guild.name}`)
|
console.log(`[space sync] to matrix: ${guild.name}`)
|
||||||
|
|
||||||
const guildKState = await guildToKState(guild, privacy_level) // calling this in both branches because we don't want to calculate this if not syncing
|
const guildKState = await guildToKState(guild, privacy_level) // calling this in both branches because we don't want to calculate this if not syncing
|
||||||
|
ks.kstateStripConditionals(guildKState) // pre-upload icons before diffing
|
||||||
|
await ks.kstateUploadMxc(guildKState)
|
||||||
|
|
||||||
// sync guild state to space
|
// sync guild state to space
|
||||||
const spaceKState = await ks.roomToKState(spaceID)
|
const spaceKState = await ks.roomToKState(spaceID)
|
||||||
@@ -185,6 +187,8 @@ async function syncSpaceFully(guildID) {
|
|||||||
console.log(`[space sync] to matrix: ${guild.name}`)
|
console.log(`[space sync] to matrix: ${guild.name}`)
|
||||||
|
|
||||||
const guildKState = await guildToKState(guild, privacy_level)
|
const guildKState = await guildToKState(guild, privacy_level)
|
||||||
|
ks.kstateStripConditionals(guildKState) // pre-upload icons before diffing
|
||||||
|
await ks.kstateUploadMxc(guildKState)
|
||||||
|
|
||||||
// sync guild state to space
|
// sync guild state to space
|
||||||
const spaceKState = await ks.roomToKState(spaceID)
|
const spaceKState = await ks.roomToKState(spaceID)
|
||||||
|
|||||||
Reference in New Issue
Block a user