This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,46 @@
// Metro module 6174 (f6175).
import ChannelStore from "../../stores/ChannelStore";
import RelationshipStore from "../../stores/RelationshipStore";
import UserStore from "../../stores/UserStore";
import { AutocompleterResultTypes } from "./AutocompleterConstants";
import { ChannelTypes } from "../../Constants";
import { computeChannelName } from "../channel/useChannelName";
export default function createAutocompleterResultForChannelId(a0, r7 = ChannelStore, r5 = UserStore, r4 = RelationshipStore) {
const channel = r7.getChannel(a0);
if (channel == null) {
return null;
}
const comparator = computeChannelName(channel, r5, r4);
const type = channel.type;
if (ChannelTypes.DM === type) {
const user = r5.getUser(channel.getRecipientId());
return user == null ? null : {
type: AutocompleterResultTypes.USER,
record: user,
score: 0,
comparator
};
}
if (ChannelTypes.GROUP_DM === type) {
return {
type: AutocompleterResultTypes.GROUP_DM,
record: channel,
score: 0,
comparator
};
}
if (ChannelTypes.GUILD_VOICE !== type && ChannelTypes.GUILD_STAGE_VOICE !== type) {
return {
type: AutocompleterResultTypes.TEXT_CHANNEL,
record: channel,
score: 0,
comparator
};
}
return {
type: AutocompleterResultTypes.VOICE_CHANNEL,
record: channel,
score: 0,
comparator
};
};