771 lines
24 KiB
TypeScript
771 lines
24 KiB
TypeScript
// Module ID: 8172
|
|
// Function ID: 8173
|
|
// Name: normalizeChannelPropertyForCompare
|
|
// Dependencies: [1395, 8083, 1930, 1391, 676, 1235, 4035, 4037, 1400, 1401, 530, 709, 12, 1430, 3978, 589, 2]
|
|
|
|
// Module 8172 (normalizeChannelPropertyForCompare)
|
|
import set from "set" /* 2 */;
|
|
import sendRequest from "sendRequest" /* 530 */;
|
|
import initializeDefault from "initialize" /* 589 */;
|
|
import dispatcherDefault from "dispatcher" /* 709 */;
|
|
import AbortCodes from "AbortCodes" /* 1235 */;
|
|
import createChannelRecord from "createChannelRecord" /* 1395 */;
|
|
import set2 from "set" /* 1400 */;
|
|
import set3 from "set" /* 1401 */;
|
|
import fromGuildPropertiesWithAdditionalFields from "fromGuildPropertiesWithAdditionalFields" /* 1430 */;
|
|
import tDefault from "t" /* 3978 */;
|
|
import MAX_REACTIONS from "MAX_REACTIONS" /* 4035 */;
|
|
import parseRawEmojiObjectDefault from "parseRawEmojiObject" /* 4037 */;
|
|
import closure_10 from "createFromServer" /* 8083 */;
|
|
import closure_11 from "createdAt" /* 1930 */;
|
|
import closure_12 from "ensureGuildLoaded" /* 1391 */;
|
|
import ME from "ME" /* 676 */;
|
|
import importDefaultResult from "apply" /* 12 */;
|
|
|
|
function normalizeChannelPropertyForCompare(arg0, arg1, arg2) {
|
|
let str = arg1;
|
|
if ("topic_" === arg0) {
|
|
if (str == null) {
|
|
str = "";
|
|
}
|
|
return str;
|
|
} else if ("defaultAutoArchiveDuration" === arg0) {
|
|
let tmp21 = str;
|
|
if (str == null) {
|
|
tmp21 = closure_17;
|
|
}
|
|
return tmp21;
|
|
} else if ("defaultSortOrder" === arg0) {
|
|
let LATEST_ACTIVITY = str;
|
|
if (str == null) {
|
|
LATEST_ACTIVITY = set2.ThreadSortOrder.LATEST_ACTIVITY;
|
|
}
|
|
return LATEST_ACTIVITY;
|
|
} else if ("defaultForumLayout" === arg0) {
|
|
if (arg2 === constants2.GUILD_MEDIA) {
|
|
return set3.ForumLayout.GRID;
|
|
} else {
|
|
if (null == str) {
|
|
let LIST = set3.ForumLayout.LIST;
|
|
} else {
|
|
LIST = str;
|
|
}
|
|
return LIST;
|
|
}
|
|
} else {
|
|
if ("rateLimitPerUser_" !== arg0) {
|
|
if ("defaultThreadRateLimitPerUser" !== arg0) {
|
|
if ("defaultReactionEmoji" === arg0) {
|
|
let tmp2 = null;
|
|
if (null != str) {
|
|
let obj = MAX_REACTIONS;
|
|
if (obj.isCustomReactionEmojiId(str.emojiId)) {
|
|
obj = { emojiId: null };
|
|
obj[0] = str.emojiId;
|
|
tmp2 = obj;
|
|
} else {
|
|
const emojiName = str.emojiName;
|
|
let tmp5 = null;
|
|
if (null != emojiName) {
|
|
tmp5 = null;
|
|
if ("" !== emojiName) {
|
|
obj = { emojiName: null };
|
|
obj[0] = parseRawEmojiObjectDefault.translateInlineEmojiToSurrogates(emojiName);
|
|
tmp5 = obj;
|
|
const obj3 = parseRawEmojiObjectDefault;
|
|
}
|
|
}
|
|
tmp2 = tmp5;
|
|
}
|
|
}
|
|
return tmp2;
|
|
} else {
|
|
return str;
|
|
}
|
|
}
|
|
}
|
|
let num = str;
|
|
if (str == null) {
|
|
num = 0;
|
|
}
|
|
return num;
|
|
}
|
|
}
|
|
function _createInvite(code) {
|
|
const obj = { code: code.code, temporary: code.temporary, revoked: code.revoked, inviter: null, channel: null, guild: null, uses: null, maxUses: null, maxAge: null, createdAt: null, type: null, roles: null };
|
|
let tmp2 = null;
|
|
let tmp = closure_10;
|
|
if (null != code.inviter) {
|
|
tmp2 = new closure_11(code.inviter);
|
|
}
|
|
obj[3] = tmp2;
|
|
obj[4] = callback(code.channel);
|
|
let fromInviteGuildResult = null;
|
|
if (null != code.guild) {
|
|
fromInviteGuildResult = fromGuildPropertiesWithAdditionalFields.fromInviteGuild(code.guild);
|
|
const obj2 = fromGuildPropertiesWithAdditionalFields;
|
|
}
|
|
obj[5] = fromInviteGuildResult;
|
|
({ uses: obj[6], max_uses: obj[7], max_age: obj[8] } = code);
|
|
obj[9] = tDefault(code.created_at);
|
|
({ type: obj[10], roles: obj[11] } = code);
|
|
tmp = new tmp(obj);
|
|
return tmp;
|
|
}
|
|
function _syncChannelUpdate(id) {
|
|
let flag = false;
|
|
if (null != channel1) {
|
|
flag = false;
|
|
if (channel1.id === id) {
|
|
if (channel1 === store) {
|
|
const channel = store2.getChannel(id);
|
|
flag = false;
|
|
if (null != channel) {
|
|
channel1 = channel;
|
|
store = channel;
|
|
let channel2 = obj2.getChannel(store.parent_id);
|
|
flag = true;
|
|
}
|
|
obj2 = store2;
|
|
} else {
|
|
channel1 = store2.getChannel(id);
|
|
flag = false;
|
|
if (null != channel1) {
|
|
flag = true;
|
|
if (null != store) {
|
|
const result = store.set("permissionOverwrites", channel1.permissionOverwrites);
|
|
store = result.set("availableTags", channel1.availableTags);
|
|
channel2 = obj3.getChannel(store.parent_id);
|
|
flag = true;
|
|
}
|
|
}
|
|
obj3 = store2;
|
|
}
|
|
}
|
|
}
|
|
let tmp10 = !flag;
|
|
if (flag) {
|
|
tmp10 = null == store;
|
|
}
|
|
let flag2 = !tmp10;
|
|
if (!tmp10) {
|
|
let tmp13 = null != guildId;
|
|
if (tmp13) {
|
|
tmp13 = null == store.permissionOverwrites[guildId];
|
|
}
|
|
flag2 = true;
|
|
if (tmp13) {
|
|
guildId = store.getGuildId();
|
|
flag2 = true;
|
|
}
|
|
}
|
|
return flag2;
|
|
}
|
|
function handleOverwriteUpdate(channelId) {
|
|
return _syncChannelUpdate(channelId.channelId);
|
|
}
|
|
let closure_9 = createChannelRecord.createChannelRecordFromInvite;
|
|
({ ChannelSettingsSections: map1, ChannelTypes: closure_14, Endpoints: closure_15, FormStates } = ME);
|
|
let closure_17 = AbortCodes.DEFAULT_AUTO_ARCHIVE_DURATION;
|
|
let CLOSED = FormStates.CLOSED;
|
|
let closure_19 = {};
|
|
let closure_20 = {};
|
|
let c21 = false;
|
|
let c22 = false;
|
|
let c23 = null;
|
|
let closure_24 = ["name", "type", "topic_", "bitrate_", "userLimit_", "nsfw_", "flags_", "rateLimitPerUser_", "defaultThreadRateLimitPerUser", "defaultAutoArchiveDuration", "template", "defaultReactionEmoji", "rtcRegion", "videoQualityMode", "threadMetadata", "banner", "availableTags", "defaultSortOrder", "defaultForumLayout", "defaultTagSetting", "iconEmoji", "themeColor"];
|
|
let closure_26 = importDefaultResult.debounce(() => {
|
|
if (null != store) {
|
|
if (null != closure_5) {
|
|
const toJSResult = store.toJS();
|
|
require = toJSResult;
|
|
closure_1 = closure_5.toJS();
|
|
const type = toJSResult.type;
|
|
let everyResult = closure_24.every((arg0) => {
|
|
const tmp = closure_1_25(arg0, toJSResult[arg0], type);
|
|
const tmp2 = closure_1_25(arg0, dependencyMap[arg0], type);
|
|
return dependencyMap(type[12]).isEqual(tmp, tmp2);
|
|
});
|
|
if (everyResult) {
|
|
everyResult = store !== closure_5;
|
|
}
|
|
if (everyResult) {
|
|
store = closure_5;
|
|
channelSettingsStore.emitChange();
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}, 500);
|
|
const Store = initializeDefault.Store;
|
|
class ChannelSettingsStore extends Store {
|
|
}
|
|
const prototype = ChannelSettingsStore.prototype;
|
|
prototype["initialize"] = function initialize() {
|
|
this.waitFor(closure_12);
|
|
};
|
|
prototype["hasChanges"] = function hasChanges() {
|
|
return closure_6 !== closure_5;
|
|
};
|
|
prototype["isOpen"] = function isOpen() {
|
|
return c22;
|
|
};
|
|
prototype["getSection"] = function getSection() {
|
|
return closure_3;
|
|
};
|
|
prototype["getInvites"] = function getInvites() {
|
|
return { invites: closure_20, loading: c21 };
|
|
};
|
|
prototype["showNotice"] = function showNotice() {
|
|
return this.hasChanges();
|
|
};
|
|
prototype["getChannel"] = function getChannel() {
|
|
return closure_6;
|
|
};
|
|
prototype["getFormState"] = function getFormState() {
|
|
return CLOSED;
|
|
};
|
|
prototype["getCategory"] = function getCategory() {
|
|
return closure_7;
|
|
};
|
|
prototype["getProps"] = function getProps() {
|
|
return { submitting: CLOSED === FormStates.SUBMITTING, errors: closure_19, channel: closure_6, section: closure_3, subsection: closure_4, invites: closure_20, selectedOverwriteId: closure_8, hasChanges: this.hasChanges(), analyticsLocation: c23 };
|
|
};
|
|
ChannelSettingsStore.displayName = "ChannelSettingsStore";
|
|
const channelSettingsStore = new ChannelSettingsStore(dispatcherDefault, {
|
|
CHANNEL_SETTINGS_INIT: function handleSettingsInit(channelId) {
|
|
let obj = store2;
|
|
let channel = store2.getChannel(channelId.channelId);
|
|
if (null == channel) {
|
|
c22 = false;
|
|
let OPEN = FormStates.CLOSED;
|
|
let OVERVIEW = null;
|
|
channel = null;
|
|
let store = null;
|
|
let channel2 = null;
|
|
closure_20 = {};
|
|
} else {
|
|
OPEN = FormStates.OPEN;
|
|
store = channel;
|
|
let _location = null;
|
|
if ("location" in channelId) {
|
|
_location = null;
|
|
if (null != channelId.location) {
|
|
_location = channelId.location;
|
|
}
|
|
}
|
|
let subsection = null;
|
|
if ("subsection" in channelId) {
|
|
subsection = channelId.subsection;
|
|
}
|
|
closure_4 = subsection;
|
|
if (null != store) {
|
|
store = store.set("nsfw", store.isNSFW());
|
|
}
|
|
channel2 = obj.getChannel(store.parent_id);
|
|
const guildId = store.getGuildId();
|
|
if (store.isModeratorReportChannel()) {
|
|
OVERVIEW = tmp10.PERMISSIONS;
|
|
let tmp11 = tmp10;
|
|
} else {
|
|
OVERVIEW = tmp10.OVERVIEW;
|
|
tmp11 = tmp10;
|
|
}
|
|
closure_19 = {};
|
|
let tmp12 = OVERVIEW;
|
|
if (OVERVIEW == null) {
|
|
tmp12 = OVERVIEW;
|
|
}
|
|
OVERVIEW = tmp12;
|
|
let tmp15 = null != store;
|
|
if (tmp15) {
|
|
tmp15 = OVERVIEW === tmp11.INSTANT_INVITES;
|
|
}
|
|
if (tmp15) {
|
|
c21 = true;
|
|
const HTTP = sendRequest.HTTP;
|
|
obj = { url: null, oldFormErrors: true, rejectWithError: true };
|
|
obj[0] = closure_15.INSTANT_INVITES(store.id);
|
|
const value = HTTP.get(obj);
|
|
value.then((body) => {
|
|
c21 = false;
|
|
let obj = callback(table[11]);
|
|
obj = { type: "CHANNEL_SETTINGS_LOADED_INVITES", invites: body.body };
|
|
obj.dispatch(obj);
|
|
}, () => {
|
|
c21 = false;
|
|
return false;
|
|
});
|
|
}
|
|
return true;
|
|
}
|
|
},
|
|
CHANNEL_SETTINGS_SUBMIT: function handleSettingsSubmit() {
|
|
const SUBMITTING = FormStates.SUBMITTING;
|
|
closure_19 = {};
|
|
},
|
|
CHANNEL_SETTINGS_SUBMIT_SUCCESS: function handleSettingsSubmitSuccess() {
|
|
closure_5 = closure_6;
|
|
const OPEN = FormStates.OPEN;
|
|
},
|
|
CHANNEL_SETTINGS_SUBMIT_FAILURE: function handleSettingsSubmitFailure(errors) {
|
|
closure_0 = errors;
|
|
const OPEN = FormStates.OPEN;
|
|
errors = errors.errors;
|
|
if (errors == null) {
|
|
errors = {};
|
|
}
|
|
const keys = Object.keys(errors);
|
|
closure_19 = keys.reduce((arg0, arg1) => {
|
|
if (obj2.isArray(errors.errors[arg1])) {
|
|
arg0[arg1] = obj.join("\n");
|
|
} else {
|
|
arg0[arg1] = obj;
|
|
}
|
|
return arg0;
|
|
}, {});
|
|
},
|
|
CHANNEL_SETTINGS_CLOSE: function handleSettingsClose() {
|
|
c22 = false;
|
|
CLOSED = FormStates.CLOSED;
|
|
c3 = null;
|
|
c5 = null;
|
|
c6 = null;
|
|
c7 = null;
|
|
closure_20 = {};
|
|
},
|
|
CHANNEL_PERMISSIONS_PUT_OVERWRITE_SUCCESS: handleOverwriteUpdate,
|
|
CHANNEL_PERMISSIONS_DELETE_OVERWRITE_SUCCESS: handleOverwriteUpdate,
|
|
CHANNEL_SETTINGS_OVERWRITE_SELECT: function handlePermissionOverwriteSelect(overwriteId) {
|
|
overwriteId = overwriteId.overwriteId;
|
|
},
|
|
CHANNEL_SETTINGS_UPDATE: function handleSettingsUpdate(arg0) {
|
|
({ name, channelType, topic, bitrate, userLimit, nsfw, flags, rateLimitPerUser, defaultThreadRateLimitPerUser, autoArchiveDuration, locked, invitable, defaultAutoArchiveDuration, template, defaultReactionEmoji, rtcRegion, videoQualityMode, availableTags, defaultSortOrder, defaultForumLayout, defaultTagSetting, iconEmoji, themeColor } = arg0);
|
|
if (null == store) {
|
|
return false;
|
|
} else {
|
|
if (null != name) {
|
|
store = store.set("name", name);
|
|
}
|
|
if (null != topic) {
|
|
store = store.set("topic", topic);
|
|
}
|
|
if (null != bitrate) {
|
|
store = store.set("bitrate", bitrate);
|
|
}
|
|
if (null != userLimit) {
|
|
store = store.set("userLimit", userLimit);
|
|
}
|
|
if (null != nsfw) {
|
|
store = store.set("nsfw", nsfw);
|
|
}
|
|
if (null != flags) {
|
|
store = store.set("flags", flags);
|
|
}
|
|
if (null != rateLimitPerUser) {
|
|
store = store.set("rateLimitPerUser", rateLimitPerUser);
|
|
}
|
|
if (null != defaultThreadRateLimitPerUser) {
|
|
store = store.set("defaultThreadRateLimitPerUser", defaultThreadRateLimitPerUser);
|
|
}
|
|
if (null != autoArchiveDuration) {
|
|
let obj = {};
|
|
const merged = Object.assign(store.threadMetadata);
|
|
obj.autoArchiveDuration = autoArchiveDuration;
|
|
store = store.set("threadMetadata", obj);
|
|
}
|
|
if (null != locked) {
|
|
obj = {};
|
|
const merged1 = Object.assign(store.threadMetadata);
|
|
obj.locked = locked;
|
|
store = store.set("threadMetadata", obj);
|
|
}
|
|
if (null != invitable) {
|
|
obj = {};
|
|
const merged2 = Object.assign(store.threadMetadata);
|
|
obj.invitable = invitable;
|
|
store = store.set("threadMetadata", obj);
|
|
}
|
|
if (null != defaultAutoArchiveDuration) {
|
|
store = store.set("defaultAutoArchiveDuration", defaultAutoArchiveDuration);
|
|
}
|
|
if (null != template) {
|
|
store = store.set("template", template);
|
|
}
|
|
if (null != channelType) {
|
|
store = store.set("type", channelType);
|
|
}
|
|
if (undefined !== rtcRegion) {
|
|
store = store.set("rtcRegion", rtcRegion);
|
|
}
|
|
if (null != videoQualityMode) {
|
|
store = store.set("videoQualityMode", videoQualityMode);
|
|
}
|
|
if (undefined !== defaultReactionEmoji) {
|
|
store = store.set("defaultReactionEmoji", defaultReactionEmoji);
|
|
}
|
|
if (null != availableTags) {
|
|
store = store.set("availableTags", availableTags);
|
|
}
|
|
if (null != defaultSortOrder) {
|
|
store = store.set("defaultSortOrder", defaultSortOrder);
|
|
}
|
|
if (null != defaultTagSetting) {
|
|
store = store.set("defaultTagSetting", defaultTagSetting);
|
|
}
|
|
if (null != defaultForumLayout) {
|
|
store = store.set("defaultForumLayout", defaultForumLayout);
|
|
}
|
|
if (undefined !== iconEmoji) {
|
|
store = store.set("iconEmoji", iconEmoji);
|
|
}
|
|
if (null != themeColor) {
|
|
store = store.set("themeColor", themeColor);
|
|
}
|
|
callback2();
|
|
}
|
|
},
|
|
CHANNEL_SETTINGS_SET_SECTION: function handleSetSection(arg0) {
|
|
({ section: closure_3, subsection: closure_4 } = arg0);
|
|
let tmp = null != store;
|
|
if (tmp) {
|
|
tmp = closure_3 === constants.INSTANT_INVITES;
|
|
}
|
|
if (tmp) {
|
|
c21 = true;
|
|
const HTTP = sendRequest.HTTP;
|
|
const obj = { url: null, oldFormErrors: true, rejectWithError: true };
|
|
obj[0] = closure_15.INSTANT_INVITES(store.id);
|
|
const value = HTTP.get(obj);
|
|
value.then((body) => {
|
|
c21 = false;
|
|
let obj = callback(table[11]);
|
|
obj = { type: "CHANNEL_SETTINGS_LOADED_INVITES", invites: body.body };
|
|
obj.dispatch(obj);
|
|
}, () => {
|
|
c21 = false;
|
|
return false;
|
|
});
|
|
}
|
|
},
|
|
CHANNEL_SETTINGS_LOADED_INVITES: function handleLoadedInvites(invites) {
|
|
closure_20 = {};
|
|
invites = invites.invites;
|
|
const item = invites.forEach((code) => {
|
|
closure_20[code.code] = callback(code);
|
|
});
|
|
},
|
|
CHANNEL_UPDATES: function handleChannelUpdates(channels) {
|
|
channels = channels.channels;
|
|
if (null == closure_6) {
|
|
return false;
|
|
} else {
|
|
let flag = false;
|
|
const tmp2 = channels[Symbol.iterator]();
|
|
while (tmp2 !== undefined) {
|
|
let tmp6 = _syncChannelUpdate;
|
|
let tmp7 = _syncChannelUpdate(tmp4.id) || flag;
|
|
flag = tmp7;
|
|
continue;
|
|
}
|
|
return flag;
|
|
}
|
|
},
|
|
THREAD_UPDATE: function handleThreadUpdate(arg0) {
|
|
let tmp2 = null != closure_6;
|
|
if (tmp2) {
|
|
tmp2 = _syncChannelUpdate(tmp.id);
|
|
}
|
|
return tmp2;
|
|
},
|
|
CHANNEL_DELETE: function handleChannelDelete(arg0) {
|
|
let tmp2 = null != store;
|
|
if (tmp2) {
|
|
if (store.id === tmp) {
|
|
CLOSED = FormStates.CLOSED;
|
|
}
|
|
tmp2 = tmp4;
|
|
}
|
|
return tmp2;
|
|
},
|
|
INSTANT_INVITE_REVOKE_SUCCESS: function handleInviteRevoke(arg0) {
|
|
const obj = {};
|
|
const merged = Object.assign(obj);
|
|
delete tmp2[tmp];
|
|
},
|
|
INSTANT_INVITE_CREATE_SUCCESS: function handleInviteCreateSuccess(invite) {
|
|
const obj = {};
|
|
const merged = Object.assign(obj);
|
|
obj[invite.invite.code] = _createInvite(invite.invite);
|
|
}
|
|
});
|
|
let obj = {
|
|
CHANNEL_SETTINGS_INIT: function handleSettingsInit(channelId) {
|
|
let obj = store2;
|
|
let channel = store2.getChannel(channelId.channelId);
|
|
if (null == channel) {
|
|
c22 = false;
|
|
let OPEN = FormStates.CLOSED;
|
|
let OVERVIEW = null;
|
|
channel = null;
|
|
let store = null;
|
|
let channel2 = null;
|
|
closure_20 = {};
|
|
} else {
|
|
OPEN = FormStates.OPEN;
|
|
store = channel;
|
|
let _location = null;
|
|
if ("location" in channelId) {
|
|
_location = null;
|
|
if (null != channelId.location) {
|
|
_location = channelId.location;
|
|
}
|
|
}
|
|
let subsection = null;
|
|
if ("subsection" in channelId) {
|
|
subsection = channelId.subsection;
|
|
}
|
|
closure_4 = subsection;
|
|
if (null != store) {
|
|
store = store.set("nsfw", store.isNSFW());
|
|
}
|
|
channel2 = obj.getChannel(store.parent_id);
|
|
const guildId = store.getGuildId();
|
|
if (store.isModeratorReportChannel()) {
|
|
OVERVIEW = tmp10.PERMISSIONS;
|
|
let tmp11 = tmp10;
|
|
} else {
|
|
OVERVIEW = tmp10.OVERVIEW;
|
|
tmp11 = tmp10;
|
|
}
|
|
closure_19 = {};
|
|
let tmp12 = OVERVIEW;
|
|
if (OVERVIEW == null) {
|
|
tmp12 = OVERVIEW;
|
|
}
|
|
OVERVIEW = tmp12;
|
|
let tmp15 = null != store;
|
|
if (tmp15) {
|
|
tmp15 = OVERVIEW === tmp11.INSTANT_INVITES;
|
|
}
|
|
if (tmp15) {
|
|
c21 = true;
|
|
const HTTP = sendRequest.HTTP;
|
|
obj = { url: null, oldFormErrors: true, rejectWithError: true };
|
|
obj[0] = closure_15.INSTANT_INVITES(store.id);
|
|
const value = HTTP.get(obj);
|
|
value.then((body) => {
|
|
c21 = false;
|
|
let obj = callback(table[11]);
|
|
obj = { type: "CHANNEL_SETTINGS_LOADED_INVITES", invites: body.body };
|
|
obj.dispatch(obj);
|
|
}, () => {
|
|
c21 = false;
|
|
return false;
|
|
});
|
|
}
|
|
return true;
|
|
}
|
|
},
|
|
CHANNEL_SETTINGS_SUBMIT: function handleSettingsSubmit() {
|
|
const SUBMITTING = FormStates.SUBMITTING;
|
|
closure_19 = {};
|
|
},
|
|
CHANNEL_SETTINGS_SUBMIT_SUCCESS: function handleSettingsSubmitSuccess() {
|
|
closure_5 = closure_6;
|
|
const OPEN = FormStates.OPEN;
|
|
},
|
|
CHANNEL_SETTINGS_SUBMIT_FAILURE: function handleSettingsSubmitFailure(errors) {
|
|
closure_0 = errors;
|
|
const OPEN = FormStates.OPEN;
|
|
errors = errors.errors;
|
|
if (errors == null) {
|
|
errors = {};
|
|
}
|
|
const keys = Object.keys(errors);
|
|
closure_19 = keys.reduce((arg0, arg1) => {
|
|
if (obj2.isArray(errors.errors[arg1])) {
|
|
arg0[arg1] = obj.join("\n");
|
|
} else {
|
|
arg0[arg1] = obj;
|
|
}
|
|
return arg0;
|
|
}, {});
|
|
},
|
|
CHANNEL_SETTINGS_CLOSE: function handleSettingsClose() {
|
|
c22 = false;
|
|
CLOSED = FormStates.CLOSED;
|
|
c3 = null;
|
|
c5 = null;
|
|
c6 = null;
|
|
c7 = null;
|
|
closure_20 = {};
|
|
},
|
|
CHANNEL_PERMISSIONS_PUT_OVERWRITE_SUCCESS: handleOverwriteUpdate,
|
|
CHANNEL_PERMISSIONS_DELETE_OVERWRITE_SUCCESS: handleOverwriteUpdate,
|
|
CHANNEL_SETTINGS_OVERWRITE_SELECT: function handlePermissionOverwriteSelect(overwriteId) {
|
|
overwriteId = overwriteId.overwriteId;
|
|
},
|
|
CHANNEL_SETTINGS_UPDATE: function handleSettingsUpdate(arg0) {
|
|
({ name, channelType, topic, bitrate, userLimit, nsfw, flags, rateLimitPerUser, defaultThreadRateLimitPerUser, autoArchiveDuration, locked, invitable, defaultAutoArchiveDuration, template, defaultReactionEmoji, rtcRegion, videoQualityMode, availableTags, defaultSortOrder, defaultForumLayout, defaultTagSetting, iconEmoji, themeColor } = arg0);
|
|
if (null == store) {
|
|
return false;
|
|
} else {
|
|
if (null != name) {
|
|
store = store.set("name", name);
|
|
}
|
|
if (null != topic) {
|
|
store = store.set("topic", topic);
|
|
}
|
|
if (null != bitrate) {
|
|
store = store.set("bitrate", bitrate);
|
|
}
|
|
if (null != userLimit) {
|
|
store = store.set("userLimit", userLimit);
|
|
}
|
|
if (null != nsfw) {
|
|
store = store.set("nsfw", nsfw);
|
|
}
|
|
if (null != flags) {
|
|
store = store.set("flags", flags);
|
|
}
|
|
if (null != rateLimitPerUser) {
|
|
store = store.set("rateLimitPerUser", rateLimitPerUser);
|
|
}
|
|
if (null != defaultThreadRateLimitPerUser) {
|
|
store = store.set("defaultThreadRateLimitPerUser", defaultThreadRateLimitPerUser);
|
|
}
|
|
if (null != autoArchiveDuration) {
|
|
let obj = {};
|
|
const merged = Object.assign(store.threadMetadata);
|
|
obj.autoArchiveDuration = autoArchiveDuration;
|
|
store = store.set("threadMetadata", obj);
|
|
}
|
|
if (null != locked) {
|
|
obj = {};
|
|
const merged1 = Object.assign(store.threadMetadata);
|
|
obj.locked = locked;
|
|
store = store.set("threadMetadata", obj);
|
|
}
|
|
if (null != invitable) {
|
|
obj = {};
|
|
const merged2 = Object.assign(store.threadMetadata);
|
|
obj.invitable = invitable;
|
|
store = store.set("threadMetadata", obj);
|
|
}
|
|
if (null != defaultAutoArchiveDuration) {
|
|
store = store.set("defaultAutoArchiveDuration", defaultAutoArchiveDuration);
|
|
}
|
|
if (null != template) {
|
|
store = store.set("template", template);
|
|
}
|
|
if (null != channelType) {
|
|
store = store.set("type", channelType);
|
|
}
|
|
if (undefined !== rtcRegion) {
|
|
store = store.set("rtcRegion", rtcRegion);
|
|
}
|
|
if (null != videoQualityMode) {
|
|
store = store.set("videoQualityMode", videoQualityMode);
|
|
}
|
|
if (undefined !== defaultReactionEmoji) {
|
|
store = store.set("defaultReactionEmoji", defaultReactionEmoji);
|
|
}
|
|
if (null != availableTags) {
|
|
store = store.set("availableTags", availableTags);
|
|
}
|
|
if (null != defaultSortOrder) {
|
|
store = store.set("defaultSortOrder", defaultSortOrder);
|
|
}
|
|
if (null != defaultTagSetting) {
|
|
store = store.set("defaultTagSetting", defaultTagSetting);
|
|
}
|
|
if (null != defaultForumLayout) {
|
|
store = store.set("defaultForumLayout", defaultForumLayout);
|
|
}
|
|
if (undefined !== iconEmoji) {
|
|
store = store.set("iconEmoji", iconEmoji);
|
|
}
|
|
if (null != themeColor) {
|
|
store = store.set("themeColor", themeColor);
|
|
}
|
|
callback2();
|
|
}
|
|
},
|
|
CHANNEL_SETTINGS_SET_SECTION: function handleSetSection(arg0) {
|
|
({ section: closure_3, subsection: closure_4 } = arg0);
|
|
let tmp = null != store;
|
|
if (tmp) {
|
|
tmp = closure_3 === constants.INSTANT_INVITES;
|
|
}
|
|
if (tmp) {
|
|
c21 = true;
|
|
const HTTP = sendRequest.HTTP;
|
|
const obj = { url: null, oldFormErrors: true, rejectWithError: true };
|
|
obj[0] = closure_15.INSTANT_INVITES(store.id);
|
|
const value = HTTP.get(obj);
|
|
value.then((body) => {
|
|
c21 = false;
|
|
let obj = callback(table[11]);
|
|
obj = { type: "CHANNEL_SETTINGS_LOADED_INVITES", invites: body.body };
|
|
obj.dispatch(obj);
|
|
}, () => {
|
|
c21 = false;
|
|
return false;
|
|
});
|
|
}
|
|
},
|
|
CHANNEL_SETTINGS_LOADED_INVITES: function handleLoadedInvites(invites) {
|
|
closure_20 = {};
|
|
invites = invites.invites;
|
|
const item = invites.forEach((code) => {
|
|
closure_20[code.code] = callback(code);
|
|
});
|
|
},
|
|
CHANNEL_UPDATES: function handleChannelUpdates(channels) {
|
|
channels = channels.channels;
|
|
if (null == closure_6) {
|
|
return false;
|
|
} else {
|
|
let flag = false;
|
|
const tmp2 = channels[Symbol.iterator]();
|
|
while (tmp2 !== undefined) {
|
|
let tmp6 = _syncChannelUpdate;
|
|
let tmp7 = _syncChannelUpdate(tmp4.id) || flag;
|
|
flag = tmp7;
|
|
continue;
|
|
}
|
|
return flag;
|
|
}
|
|
},
|
|
THREAD_UPDATE: function handleThreadUpdate(arg0) {
|
|
let tmp2 = null != closure_6;
|
|
if (tmp2) {
|
|
tmp2 = _syncChannelUpdate(tmp.id);
|
|
}
|
|
return tmp2;
|
|
},
|
|
CHANNEL_DELETE: function handleChannelDelete(arg0) {
|
|
let tmp2 = null != store;
|
|
if (tmp2) {
|
|
if (store.id === tmp) {
|
|
CLOSED = FormStates.CLOSED;
|
|
}
|
|
tmp2 = tmp4;
|
|
}
|
|
return tmp2;
|
|
},
|
|
INSTANT_INVITE_REVOKE_SUCCESS: function handleInviteRevoke(arg0) {
|
|
const obj = {};
|
|
const merged = Object.assign(obj);
|
|
delete tmp2[tmp];
|
|
},
|
|
INSTANT_INVITE_CREATE_SUCCESS: function handleInviteCreateSuccess(invite) {
|
|
const obj = {};
|
|
const merged = Object.assign(obj);
|
|
obj[invite.invite.code] = _createInvite(invite.invite);
|
|
}
|
|
};
|
|
let result = set.fileFinishedImporting("stores/ChannelSettingsStore.tsx");
|
|
|
|
export default channelSettingsStore;
|