2026-09-10 19:12:31 +00:00
|
|
|
// Module ID: 13100
|
|
|
|
|
// Function ID: 13101
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: getChannelIcon
|
2026-09-05 10:56:28 +00:00
|
|
|
// Dependencies: [32, 1371, 1074, 1369, 1396, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: getChannelIconSource, getChannelIconURL
|
|
|
|
|
|
2026-09-10 19:12:31 +00:00
|
|
|
// Module 13100 (getChannelIcon)
|
2026-09-10 05:38:07 +00:00
|
|
|
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
|
|
|
|
2026-09-10 05:38:07 +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;
|
2026-09-10 05:38:07 +00:00
|
|
|
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) {
|
2026-09-10 05:38:07 +00:00
|
|
|
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;
|
2026-09-10 05:38:07 +00:00
|
|
|
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) {
|
2026-09-10 05:38:07 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
};
|