decord/beta/source/modules/channel/getChannelIcon.tsx
github-actions e7a050048e chore: update source for beta 347.7
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
2026-09-21 19:31:18 +00:00

58 lines
2 KiB
TypeScript

// Module ID: 13326
// Function ID: 13327
// Name: getChannelIcon
// Dependencies: [32, 1376, 1078, 1374, 1401, 2]
// Exports: getChannelIconSource, getChannelIconURL
// Module 13326 (getChannelIcon)
import GlobalUtils from "GlobalUtils" /* 1374 */;
import AvatarUtilsDefault from "AvatarUtils" /* 1401 */;
import _slicedToArray from "module_32" /* 32 */;
import UserStore from "UserStore" /* 1376 */;
require = fn;
const ChannelTypes = fn(1078).ChannelTypes;
const size = fn(2);
const result = size.fileFinishedImporting("modules/channel/getChannelIcon.tsx");
export const getChannelIconURL = function getChannelIconURL(type) {
let num = arg1;
if (arg1 === undefined) {
num = 32;
}
type = type.type;
if (ChannelTypes.DM === type) {
const recipients = type.recipients;
const mapped = recipients.map(UserStore.getUser);
const first = _slicedToArray(mapped.filter(GlobalUtils.isNotNullish), 1)[0];
let avatarURL = null;
if (null != first) {
avatarURL = first.getAvatarURL(undefined, num, arg2);
}
return avatarURL;
} else if (tmp.GROUP_DM === type) {
const obj3 = { id: null, icon: null, applicationId: null, size: null };
({ id: obj2.id, icon: obj2.icon } = type);
obj3.applicationId = type.getApplicationId();
obj3.size = num;
return AvatarUtilsDefault.getChannelIconURL(obj3);
}
};
export const getChannelIconSource = function getChannelIconSource(type) {
type = type.type;
if (ChannelTypes.DM === type) {
const recipients = type.recipients;
const mapped = recipients.map(UserStore.getUser);
const first = _slicedToArray(mapped.filter(GlobalUtils.isNotNullish), 1)[0];
let avatarSource = null;
if (null != first) {
avatarSource = first.getAvatarSource(undefined);
}
return avatarSource;
} else if (tmp.GROUP_DM === type) {
const obj3 = { id: null, icon: null, applicationId: null, size: 128 };
({ id: obj2.id, icon: obj2.icon } = type);
obj3.applicationId = type.getApplicationId();
return AvatarUtilsDefault.getChannelIconSource(obj3);
}
};