decord/source/utils/NicknameUtils.tsx

78 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 4573
// Function ID: 4574
2026-07-20 16:05:17 +00:00
// Name: getNickname
2026-08-25 06:04:03 +00:00
// Dependencies: [1391, 1992, 4034, 1236, 4224, 589, 2]
2026-07-29 08:29:29 +00:00
// Exports: getNickname, useName
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 4573 (getNickname)
2026-08-24 06:08:38 +00:00
import getSystemLocale from "getSystemLocale" /* 1236 */;
2026-08-25 06:04:03 +00:00
import nameFromUserDefault from "nameFromUser" /* 4224 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "ensureGuildLoaded" /* 1391 */;
2026-08-25 06:04:03 +00:00
import closure_4 from "trackCommunicationDisabled" /* 1992 */;
import closure_5 from "markAllUserIdListsStale" /* 4034 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
function getNickname(id, arg1, id) {
if (null == id) {
2026-07-20 16:05:17 +00:00
return null;
} else if (null != id) {
2026-07-29 08:29:29 +00:00
return store2.getNick(id, id.id);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if (null != arg1) {
const channel = store.getChannel(arg1);
let isPrivateResult;
if (channel != null) {
isPrivateResult = channel.isPrivate();
}
if (isPrivateResult) {
return store3.getNickname(id.id);
2026-07-20 16:05:17 +00:00
}
}
return null;
}
}
2026-07-29 08:29:29 +00:00
function getName(id, arg1, id) {
if (null == id) {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
let stringResult = intl.string(getSystemLocale.t.sKdZ6U);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
stringResult = null;
if (null != id) {
if (null != id) {
stringResult = store2.getNick(id, id.id);
} else {
stringResult = null;
if (null != arg1) {
const channel = store.getChannel(arg1);
let isPrivateResult;
if (channel != null) {
isPrivateResult = channel.isPrivate();
}
stringResult = null;
if (isPrivateResult) {
stringResult = store3.getNickname(id.id);
}
}
}
}
if (stringResult == null) {
2026-08-24 06:08:38 +00:00
stringResult = nameFromUserDefault.getName(id);
const obj2 = nameFromUserDefault;
2026-07-20 16:05:17 +00:00
}
}
return stringResult;
}
function useName(arg0, arg1, arg2) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
dependencyMap = arg2;
const items = [closure_4, closure_3, closure_5];
return _require(589).useStateFromStores(items, () => closure_1_6(closure_0, closure_1, closure_2));
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("utils/NicknameUtils.tsx");
2026-07-20 16:05:17 +00:00
export default { getNickname, getName, useName };
export { getNickname };
export { getName };
export { useName };