decord/source/modules/channel/getChannelIcon.tsx

59 lines
2 KiB
TypeScript
Raw Normal View History

// Module ID: 13100
// Function ID: 13101
// Name: getChannelIcon
// Dependencies: [32, 1371, 1074, 1369, 1396, 2]
2026-07-20 16:05:17 +00:00
// Exports: getChannelIconSource, getChannelIconURL
// Module 13100 (getChannelIcon)
import GlobalUtils from "GlobalUtils" /* 1369 */;
import AvatarUtilsDefault from "AvatarUtils" /* 1396 */;
import _slicedToArray from "module_32" /* 32 */;
import UserStore from "UserStore" /* 1371 */;
2026-07-20 16:05:17 +00:00
require = fn;
const ChannelTypes = fn(1074).ChannelTypes;
const size = fn(2);
const result = size.fileFinishedImporting("modules/channel/getChannelIcon.tsx");
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
export const getChannelIconURL = function getChannelIconURL(type) {
let num = arg1;
if (arg1 === undefined) {
2026-07-20 16:05:17 +00:00
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];
2026-07-20 16:05:17 +00:00
let avatarURL = null;
if (null != first) {
2026-07-29 08:29:29 +00:00
avatarURL = first.getAvatarURL(undefined, num, arg2);
2026-07-20 16:05:17 +00:00
}
return avatarURL;
2026-07-29 08:29:29 +00:00
} 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);
2026-07-20 16:05:17 +00:00
}
};
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];
2026-07-20 16:05:17 +00:00
let avatarSource = null;
if (null != first) {
avatarSource = first.getAvatarSource(undefined);
}
return avatarSource;
2026-07-29 08:29:29 +00:00
} 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);
2026-07-20 16:05:17 +00:00
}
};