2026-09-28 16:18:32 +00:00
|
|
|
// Module ID: 10882
|
|
|
|
|
// Function ID: 10883
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: ChatView
|
2026-09-28 16:18:32 +00:00
|
|
|
// Dependencies: [19, 17, 5589, 2049, 2045, 5056, 1074, 21, 4836, 576, 4701, 504, 1115, 5046, 6747, 5910, 10883, 10884, 6895, 6732, 10886, 6531, 10891, 10904, 10968, 11440, 11961, 1364, 12134, 12135, 11749, 12139, 12142, 11027, 12145, 5437, 9, 9757, 12160, 1177, 12162, 12164, 12165, 12276, 2]
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-28 16:18:32 +00:00
|
|
|
// Module 10882 (ChatView)
|
2026-10-01 14:13:23 +00:00
|
|
|
import react_native from "react-native" /* 17 */;
|
2026-09-26 17:57:22 +00:00
|
|
|
import nativeDefault from "native" /* 576 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import Constants from "Constants" /* 1074 */;
|
|
|
|
|
import intl3 from "intl" /* 1115 */;
|
2026-09-26 17:57:22 +00:00
|
|
|
import PlatformUtils from "PlatformUtils" /* 1364 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import ChannelRecord from "ChannelRecord" /* 2049 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import ChatInputUtils from "ChatInputUtils" /* 4701 */;
|
|
|
|
|
import LazyLoadedThreadManagerDefault from "LazyLoadedThreadManager" /* 6732 */;
|
|
|
|
|
import SummaryActionCreators from "SummaryActionCreators" /* 10886 */;
|
|
|
|
|
import ChatViewWrapperDefault from "ChatViewWrapper" /* 10891 */;
|
|
|
|
|
import ChatViewStickyHeaderDefault from "ChatViewStickyHeader" /* 10904 */;
|
|
|
|
|
import MessagesDefault from "Messages" /* 10968 */;
|
|
|
|
|
import ChatInputDefault from "ChatInput" /* 11440 */;
|
|
|
|
|
import ChatBeginningRowDefault from "ChatBeginningRow" /* 11961 */;
|
|
|
|
|
import ChannelSafeAreaBottomDefault from "ChannelSafeAreaBottom" /* 12139 */;
|
|
|
|
|
import VoiceMessageOverlayDefault from "VoiceMessageOverlay" /* 12142 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import react from "react" /* 19 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import GatewayConnectionStore from "GatewayConnectionStore" /* 5589 */;
|
|
|
|
|
import ChannelStore from "ChannelStore" /* 2045 */;
|
|
|
|
|
import MessageStore from "MessageStore" /* 5056 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import Fragment from "Fragment" /* 21 */;
|
|
|
|
|
import createStyles_mod from "createStyles" /* 4836 */;
|
|
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
let c10;
|
|
|
|
|
let c9;
|
|
|
|
|
let obj2;
|
|
|
|
|
let obj3;
|
|
|
|
|
let unpackModuleId;
|
|
|
|
|
const StyleSheet = react_native.StyleSheet;
|
|
|
|
|
const createChannelRecord = ChannelRecord.createChannelRecord;
|
|
|
|
|
const ChannelTypes = Constants.ChannelTypes;
|
|
|
|
|
({ jsx: c9, jsxs: c10, Fragment: unpackModuleId } = Fragment);
|
|
|
|
|
let createStyles = createStyles_mod;
|
|
|
|
|
let obj = { empty: obj2, messages: { flex: 1, overflow: "hidden" }, chat: obj3 };
|
|
|
|
|
obj2 = { flex: 1, borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: nativeDefault.colors.BORDER_SUBTLE };
|
|
|
|
|
createStyles = createStyles.createStyles;
|
|
|
|
|
obj3 = { backgroundColor: nativeDefault.colors.CHANNEL_BACKGROUND_DEFAULT, justifyContent: "flex-start", overflow: "hidden", flex: 1 };
|
|
|
|
|
let closure_12 = createStyles(obj);
|
|
|
|
|
const memoResult = react.memo(function ChatView(alwaysRespectKeyboard) {
|
|
|
|
|
let HACK_fixModalInteraction;
|
|
|
|
|
let c15;
|
|
|
|
|
let c16;
|
|
|
|
|
let channel;
|
|
|
|
|
let channelIsLoading;
|
|
|
|
|
let guildId;
|
|
|
|
|
let intl;
|
|
|
|
|
let intl2;
|
|
|
|
|
let items10;
|
|
|
|
|
let screenIndex;
|
|
|
|
|
let secondaryTextFieldRef;
|
|
|
|
|
let setNoExtractUI;
|
|
|
|
|
let shouldRender;
|
|
|
|
|
let tmp20Result3;
|
2026-09-18 19:45:33 +00:00
|
|
|
let flag = alwaysRespectKeyboard.alwaysRespectKeyboard;
|
|
|
|
|
if (flag === undefined) {
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
|
|
|
|
const channelId = alwaysRespectKeyboard.channelId;
|
|
|
|
|
const chatInputRef = alwaysRespectKeyboard.chatInputRef;
|
|
|
|
|
let flag2 = alwaysRespectKeyboard.disableGradient;
|
|
|
|
|
if (flag2 === undefined) {
|
|
|
|
|
flag2 = false;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
({ guildId, HACK_fixModalInteraction: react, screenIndex: GatewayConnectionStore, secondaryTextFieldRef: createChannelRecord, setNoExtractUI: ChannelStore } = alwaysRespectKeyboard);
|
2026-09-18 19:45:33 +00:00
|
|
|
channel = undefined;
|
2026-10-01 14:13:23 +00:00
|
|
|
let closure_10;
|
2026-09-18 19:45:33 +00:00
|
|
|
let ref;
|
2026-10-01 14:13:23 +00:00
|
|
|
let visibleMessagesWindowHandler;
|
2026-09-18 19:45:33 +00:00
|
|
|
let isResourceChannel;
|
|
|
|
|
c15 = undefined;
|
|
|
|
|
c16 = undefined;
|
|
|
|
|
let onScroll;
|
|
|
|
|
let onPressKey;
|
|
|
|
|
let scrollToNewMessages;
|
|
|
|
|
let onJumpToPresent;
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp = ref();
|
|
|
|
|
let closure_7 = tmp;
|
|
|
|
|
let obj = react;
|
2026-09-18 19:45:33 +00:00
|
|
|
let items = [channelId, flag];
|
2026-10-01 14:13:23 +00:00
|
|
|
const effect = react.useEffect(() => {
|
|
|
|
|
const tmp = flag;
|
|
|
|
|
if (!tmp) {
|
|
|
|
|
const obj = ChatInputUtils;
|
|
|
|
|
obj.dismissKeyboard();
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}, items);
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp3 = flag;
|
|
|
|
|
let obj2 = flag(chatInputRef[11]);
|
2026-09-18 19:45:33 +00:00
|
|
|
let items1 = [ChannelStore];
|
2026-10-01 14:13:23 +00:00
|
|
|
let stateFromStores = obj2.useStateFromStores(items1, () => ChannelStore.getChannel(channelId));
|
2026-09-18 19:45:33 +00:00
|
|
|
let items2 = [stateFromStores, channelId];
|
2026-10-01 14:13:23 +00:00
|
|
|
const memo = react.useMemo(() => {
|
|
|
|
|
let intl;
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp2 = stateFromStores;
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp = stateFromStores;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null == stateFromStores) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = { id: channelId, type: ChannelTypes.GUILD_TEXT, name: intl.string(intl3.t.ZTNur7) };
|
|
|
|
|
intl = intl3.intl;
|
2026-09-18 19:45:33 +00:00
|
|
|
tmp2 = createChannelRecord(obj);
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return { channel: tmp2, channelIsLoading: null == tmp };
|
2026-09-18 19:45:33 +00:00
|
|
|
}, items2);
|
|
|
|
|
({ channelIsLoading, channel } = memo);
|
2026-09-26 17:57:22 +00:00
|
|
|
let obj3 = flag(chatInputRef[13]);
|
2026-10-01 14:13:23 +00:00
|
|
|
const isChannelContentGated = obj3.useIsChannelContentGated(channel);
|
|
|
|
|
let tmp8 = flag(chatInputRef[14]);
|
|
|
|
|
const useGetSpoilerGatingChannelId = tmp8.useGetSpoilerGatingChannelId;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (stateFromStores == null) {
|
|
|
|
|
stateFromStores = null;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const getSpoilerGatingChannelId = useGetSpoilerGatingChannelId(stateFromStores);
|
2026-09-18 19:45:33 +00:00
|
|
|
closure_10 = obj.useRef(channelId);
|
|
|
|
|
obj.useRef(null);
|
|
|
|
|
ref = obj.useRef(null);
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp11 = channelId;
|
|
|
|
|
visibleMessagesWindowHandler = channelId(tmp4[15])(() => {
|
|
|
|
|
const tmp = new channelId(chatInputRef[16])();
|
|
|
|
|
return tmp;
|
|
|
|
|
});
|
|
|
|
|
let tmp12 = channelId(tmp4[17])(channelId);
|
|
|
|
|
isResourceChannel = tmp12;
|
|
|
|
|
const items3 = [closure_7];
|
|
|
|
|
const items4 = [channelId, tmp12];
|
|
|
|
|
const tmp3Result = tmp3(chatInputRef[11]);
|
|
|
|
|
const stateFromStoresObject = tmp3Result.useStateFromStoresObject(items3, () => {
|
2026-09-18 19:45:33 +00:00
|
|
|
const messages = MessageStore.getMessages(channelId);
|
|
|
|
|
let tmp = 0 === messages.length;
|
|
|
|
|
if (tmp) {
|
|
|
|
|
tmp = messages.loadingMore || !messages.ready;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = { shouldRenderPlaceholder: tmp, shouldRenderBegginingRow: tmp3 };
|
2026-09-18 19:45:33 +00:00
|
|
|
return obj;
|
|
|
|
|
}, items4);
|
|
|
|
|
({ shouldRenderPlaceholder: c15, shouldRenderBegginingRow: c16 } = stateFromStoresObject);
|
2026-09-26 17:57:22 +00:00
|
|
|
onScroll = obj.useCallback((isFirstMessageVisible) => {
|
2026-09-18 19:45:33 +00:00
|
|
|
const current = ref.current;
|
|
|
|
|
if (current != null) {
|
2026-09-26 17:57:22 +00:00
|
|
|
current.onChatViewScrolled(isFirstMessageVisible);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}, []);
|
|
|
|
|
const items5 = [chatInputRef];
|
|
|
|
|
onPressKey = obj.useCallback((arg0) => {
|
|
|
|
|
const current = chatInputRef.current;
|
|
|
|
|
if (current != null) {
|
|
|
|
|
current.handlePressKey(tmp);
|
|
|
|
|
}
|
|
|
|
|
}, items5);
|
|
|
|
|
const items6 = [ref];
|
|
|
|
|
scrollToNewMessages = obj.useCallback(() => {
|
|
|
|
|
const current = ref.current;
|
|
|
|
|
if (current != null) {
|
|
|
|
|
current.scrollToNewMessages();
|
|
|
|
|
}
|
|
|
|
|
}, items6);
|
|
|
|
|
const items7 = [ref];
|
|
|
|
|
onJumpToPresent = obj.useCallback(() => {
|
|
|
|
|
const current = ref.current;
|
|
|
|
|
if (current != null) {
|
|
|
|
|
current.jumpToPresent();
|
|
|
|
|
}
|
|
|
|
|
}, items7);
|
2026-10-01 14:13:23 +00:00
|
|
|
const layoutEffect = obj.useLayoutEffect(() => {
|
|
|
|
|
const obj = flag(chatInputRef[18]);
|
|
|
|
|
return obj.trackAppUIViewed();
|
|
|
|
|
}, []);
|
2026-09-18 19:45:33 +00:00
|
|
|
const items8 = [channelId];
|
|
|
|
|
const effect1 = obj.useEffect(() => {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = LazyLoadedThreadManagerDefault;
|
|
|
|
|
const thread = obj.loadThread(channelId);
|
|
|
|
|
const obj2 = SummaryActionCreators;
|
|
|
|
|
const summaries = obj2.fetchSummaries(channelId);
|
2026-09-18 19:45:33 +00:00
|
|
|
}, items8);
|
|
|
|
|
const items9 = [channel.id];
|
|
|
|
|
const effect2 = obj.useEffect(() => {
|
|
|
|
|
closure_10.current = channel.id;
|
|
|
|
|
}, items9);
|
|
|
|
|
const effect3 = obj.useEffect(() => () => {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = flag(chatInputRef[21]);
|
|
|
|
|
const result = obj.clearOldestUnreadMessageId(ref.current);
|
2026-09-18 19:45:33 +00:00
|
|
|
}, []);
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj4 = { profile: tmp3(tmp4[33]).Profiles.ChatView, children: items10 };
|
|
|
|
|
const tmp19 = channelId(chatInputRef[33]);
|
|
|
|
|
items10 = [channel(channelId(tmp4[34]), { channelId, guildId }), , ];
|
|
|
|
|
let tmp20Result = null;
|
|
|
|
|
const tmp18 = closure_10;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (!flag2) {
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp20Result = tmp20(tmp11(tmp4[35]), { absolute: true });
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
items10[1] = tmp20Result;
|
|
|
|
|
const tmp3Result2 = tmp3(chatInputRef[37]);
|
|
|
|
|
if (tmp3Result2.shouldNSFWGateGuild(guildId)) {
|
|
|
|
|
tmp20Result3 = tmp20(tmp11(tmp4[38]), {});
|
|
|
|
|
const tmp11Result = tmp11(chatInputRef[36]);
|
|
|
|
|
tmp11Result.setInterstitial("NsfwGateChat");
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp20Result4;
|
2026-09-18 19:45:33 +00:00
|
|
|
function renderMessagesWrapper() {
|
2026-10-01 14:13:23 +00:00
|
|
|
let items;
|
|
|
|
|
let items1;
|
|
|
|
|
let items2;
|
|
|
|
|
let obj2;
|
|
|
|
|
const obj = { style: closure_7.messages, channelId, stickyHeader: React4(ChatViewStickyHeaderDefault, obj2), children: items1 };
|
|
|
|
|
obj2 = { channel, ref, scrollToNewMessages };
|
|
|
|
|
const obj3 = { alwaysRespectKeyboard: flag, channel, screenIndex: GatewayConnectionStore, chatInputRef, HACK_fixModalInteraction: react, isResourceChannel, onPressKey, onScroll, ref, style: closure_7.chat, visibleMessagesWindowHandler, children: items };
|
|
|
|
|
items = [, ];
|
|
|
|
|
const obj4 = { ref: chatInputRef, channel, isResourceChannel, screenIndex: GatewayConnectionStore, secondaryTextFieldRef: createChannelRecord, setNoExtractUI: ChannelStore, onJumpToPresent };
|
2026-09-18 19:45:33 +00:00
|
|
|
const tmp5 = ChatViewWrapperDefault;
|
|
|
|
|
const tmp9 = MessagesDefault;
|
2026-10-01 14:13:23 +00:00
|
|
|
items[0] = React4(ChatInputDefault, obj4);
|
|
|
|
|
const obj5 = { channelId, guildId: channel.getGuildId(), shouldRender };
|
|
|
|
|
const tmp13 = ChatBeginningRowDefault;
|
|
|
|
|
items[1] = React4(tmp13, obj5);
|
|
|
|
|
items1 = [authStore(tmp9, obj3), , , ];
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp7Result = null;
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj6 = PlatformUtils;
|
|
|
|
|
const tmp11 = ref;
|
|
|
|
|
const tmp12 = onJumpToPresent;
|
|
|
|
|
const tmp2 = unpackModuleId;
|
|
|
|
|
const tmp8 = channel;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (!obj6.isAndroid()) {
|
|
|
|
|
const obj7 = { channelId: tmp8.id, messagesRef: tmp11 };
|
2026-09-28 16:18:32 +00:00
|
|
|
tmp7Result = tmp7(tmp3(12134), obj7);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
items1[1] = tmp7Result;
|
|
|
|
|
let tmp7Result3 = null;
|
|
|
|
|
if (c15) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj8 = { screenIndex: GatewayConnectionStore };
|
2026-09-28 16:18:32 +00:00
|
|
|
tmp7Result3 = tmp7(tmp3(12135), obj8);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
items1[2] = tmp7Result3;
|
|
|
|
|
let tmp7Result4 = null;
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp14Result = PlatformUtils;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (tmp14Result.isAndroid()) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj9 = { channelId, screenIndex: GatewayConnectionStore, onJumpToPresent: tmp12 };
|
2026-09-28 16:18:32 +00:00
|
|
|
tmp7Result4 = tmp7(tmp3(11749), obj9);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj10 = { children: items2 };
|
2026-09-18 19:45:33 +00:00
|
|
|
items1[3] = tmp7Result4;
|
2026-10-01 14:13:23 +00:00
|
|
|
items2 = [authStore(tmp5, obj), React4(ChannelSafeAreaBottomDefault, { channelId }), React4(VoiceMessageOverlayDefault, { channelId })];
|
|
|
|
|
return authStore(tmp2, obj10);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (channelIsLoading) {
|
|
|
|
|
if (!GatewayConnectionStore.isConnected()) {
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp20Result3 = renderMessagesWrapper();
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (channelIsLoading) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj5 = { style: tmp.empty, title: intl.string(tmp3(tmp4[12]).t.ai6Lbr), body: intl2.string(tmp3(tmp4[12]).t["LTr+x9"]) };
|
|
|
|
|
const EmptyState = tmp3(tmp4[39]).EmptyState;
|
|
|
|
|
intl = tmp3(tmp4[12]).intl;
|
|
|
|
|
intl2 = tmp3(tmp4[12]).intl;
|
|
|
|
|
tmp20Result4 = tmp20(EmptyState, obj5);
|
|
|
|
|
const tmp11Result6 = tmp11(chatInputRef[36]);
|
|
|
|
|
tmp11Result6.setInterstitial("EmptyState");
|
2026-09-18 19:45:33 +00:00
|
|
|
} else if (isChannelContentGated) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj6 = { guildId, channelId };
|
|
|
|
|
tmp20Result4 = tmp20(tmp11(tmp4[40]), obj6);
|
|
|
|
|
const tmp11Result7 = tmp11(chatInputRef[36]);
|
|
|
|
|
tmp11Result7.setInterstitial("GuildNSFW");
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
|
|
|
|
if (null != getSpoilerGatingChannelId) {
|
|
|
|
|
if (null != getSpoilerGatingChannelId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj7 = { guildId, channelId: getSpoilerGatingChannelId };
|
|
|
|
|
tmp20Result4 = tmp20(tmp11(tmp4[41]), obj7, channelId);
|
|
|
|
|
const tmp11Result8 = tmp11(chatInputRef[36]);
|
|
|
|
|
tmp11Result8.setInterstitial("ChannelSpoiler");
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (channel.isDirectory()) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj8 = { channel, guildId };
|
|
|
|
|
tmp20Result4 = tmp20(tmp11(tmp4[42]), obj8);
|
|
|
|
|
const tmp11Result9 = tmp11(chatInputRef[36]);
|
|
|
|
|
tmp11Result9.setInterstitial("GuildDirectory");
|
2026-09-18 19:45:33 +00:00
|
|
|
} else if (channel.isForumLikeChannel()) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj9 = { channel };
|
|
|
|
|
tmp20Result4 = tmp20(tmp11(tmp4[43]), obj9);
|
|
|
|
|
const tmp11Result10 = tmp11(chatInputRef[36]);
|
|
|
|
|
tmp11Result10.setInterstitial("ForumChannel");
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp20Result4 = renderMessagesWrapper();
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp20Result3 = tmp20Result4;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
items10[2] = tmp20Result3;
|
|
|
|
|
return tmp18(tmp19, obj4);
|
2026-09-26 17:57:22 +00:00
|
|
|
});
|
2026-10-01 14:13:23 +00:00
|
|
|
let result = size.fileFinishedImporting("modules/chat/native/ChatView.tsx");
|
|
|
|
|
|
|
|
|
|
export default memoResult;
|