decord/alpha/source/utils/NicknameUtils.tsx
github-actions 1224ea86fd chore: update source for alpha 348.5
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5021.js (118.4 MB)
2026-09-26 08:31:33 +00:00

77 lines
2.2 KiB
TypeScript

// Module ID: 4988
// Function ID: 4989
// Name: NicknameUtils
// Dependencies: [2045, 2108, 4479, 1115, 4678, 504, 2]
// Exports: getNickname, useName
// Module 4988 (NicknameUtils)
import util from "util" /* 1115 */;
import UserUtilsDefault from "UserUtils" /* 4678 */;
import ChannelStore from "ChannelStore" /* 2045 */;
import GuildMemberStore from "GuildMemberStore" /* 2108 */;
import RelationshipStore from "RelationshipStore" /* 4479 */;
require = fn;
function getNickname(id, arg1, id) {
if (null == id) {
return null;
} else if (null != id) {
return GuildMemberStore.getNick(id, id.id);
} else {
if (null != arg1) {
const channel = ChannelStore.getChannel(arg1);
let isPrivateResult;
if (channel != null) {
isPrivateResult = channel.isPrivate();
}
if (isPrivateResult) {
return RelationshipStore.getNickname(id.id);
}
}
return null;
}
}
function getName(id, arg1, id) {
if (null == id) {
const intl = util.intl;
let stringResult = intl.string(util.t.sKdZ6U);
} else {
stringResult = null;
if (null != id) {
if (null != id) {
stringResult = GuildMemberStore.getNick(id, id.id);
} else {
stringResult = null;
if (null != arg1) {
const channel = ChannelStore.getChannel(arg1);
let isPrivateResult;
if (channel != null) {
isPrivateResult = channel.isPrivate();
}
stringResult = null;
if (isPrivateResult) {
stringResult = RelationshipStore.getNickname(id.id);
}
}
}
}
if (stringResult == null) {
stringResult = UserUtilsDefault.getName(id);
}
}
return stringResult;
}
function useName(arg0, arg1, arg2) {
_require = arg0;
closure_1 = arg1;
dependencyMap = arg2;
const items = [GuildMemberStore, ChannelStore, RelationshipStore];
return require("initialize").useStateFromStores(items, () => getName(closure_0, closure_1, closure_2));
}
const size = fn(2);
const result = size.fileFinishedImporting("utils/NicknameUtils.tsx");
export default { getNickname, getName, useName };
export { getNickname };
export { getName };
export { useName };