decord/source/modules/message_request/native/RestrictedMessagePreviewActions.tsx

186 lines
7.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 16211
// Function ID: 16212
2026-07-20 16:05:17 +00:00
// Name: RestrictedMessagePreviewActions
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 17, 4033, 676, 10633, 21, 4668, 712, 11810, 589, 9775, 9926, 11840, 4223, 4346, 10634, 2008, 8175, 4775, 4750, 1236, 4739, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 16211 (RestrictedMessagePreviewActions)
import ThemesDefault from "Themes" /* 712 */;
import closure_3 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import closure_5 from "markAllUserIdListsStale" /* 4033 */;
import ME from "ME" /* 676 */;
import { BLOCK_CONFIRMATION_ACTION_SHEET_KEY as closure_8 } from "IGNORE_CONFIRMATION_ACTION_SHEET_KEY" /* 10633 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ AnalyticsPages: closure_6, RelationshipTypes: error } = ME);
({ jsx: c9, jsxs: c10 } = jsxProd);
createCacheKey = { container: null, buttonRow: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { gap: ThemesDefault.space.PX_8, marginVertical: ThemesDefault.space.PX_12 };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
2026-08-24 06:08:38 +00:00
createCacheKey[1] = { flexDirection: "row", flexWrap: "wrap", gap: ThemesDefault.space.PX_8 };
let closure_11 = createCacheKey.createStyles(createCacheKey);
let obj1 = { flexDirection: "row", flexWrap: "wrap", gap: ThemesDefault.space.PX_8 };
let result = require("set").fileFinishedImporting("modules/message_request/native/RestrictedMessagePreviewActions.tsx");
2026-07-20 16:05:17 +00:00
export default function RestrictedMessagePreviewActions(channel) {
channel = channel.channel;
const user = channel.user;
2026-07-29 08:29:29 +00:00
let message;
2026-08-24 06:08:38 +00:00
const tmp = callback2();
2026-07-23 10:11:24 +00:00
let obj = channel(message[8]);
2026-07-20 16:05:17 +00:00
const dMMessageToReport = obj.useDMMessageToReport(channel, user.id, true === user.bot);
2026-07-23 10:11:24 +00:00
message = dMMessageToReport.message;
2026-07-20 16:05:17 +00:00
({ isReportable, isLoaded } = dMMessageToReport);
2026-08-24 06:08:38 +00:00
obj1 = channel(message[9]);
const items = [closure_5];
2026-07-20 16:05:17 +00:00
const items1 = [user.id];
2026-08-24 06:08:38 +00:00
const stateFromStores = obj1.useStateFromStores(items, () => closure_1_5.getRelationshipType(user.id), items1);
2026-07-20 16:05:17 +00:00
const items2 = [user.id];
const items3 = [user.id];
const callback = React.useCallback(() => {
let obj = user(message[10]);
obj = { userId: user.id, context: obj };
2026-08-24 06:08:38 +00:00
obj = { location: closure_1_6.DM_CHANNEL };
2026-07-20 16:05:17 +00:00
obj.addRelationship(obj);
}, items2);
const items4 = [user.id];
const callback1 = React.useCallback(() => {
let obj = user(message[11]);
2026-08-24 06:08:38 +00:00
obj = { userId: user.id, location: closure_1_6.DM_CHANNEL };
2026-07-20 16:05:17 +00:00
const result = obj.maybeConfirmFriendRequestAccept(obj);
}, items3);
const items5 = [user];
2026-08-24 06:08:38 +00:00
callback2 = React.useCallback(() => {
2026-07-20 16:05:17 +00:00
let obj = user(message[10]);
2026-08-24 06:08:38 +00:00
obj = { location: closure_1_6.DM_CHANNEL };
2026-07-20 16:05:17 +00:00
obj.cancelFriendRequest(user.id, obj);
}, items4);
const items6 = [user.id, channel.id];
const callback3 = React.useCallback(() => {
let obj = channel(message[12]);
2026-08-24 06:08:38 +00:00
obj = {
userDisplayName: user(message[13]).getName(user),
onConfirm() {
let obj = closure_1_1(closure_1_2[10]);
obj = { location: closure_1_6.DM_CHANNEL };
obj.removeFriend(id.id, obj);
}
2026-07-20 16:05:17 +00:00
};
obj.confirmRemoveFriend(obj);
}, items5);
const items7 = [user.id];
const callback4 = React.useCallback(() => {
let obj = user(message[14]);
obj = { userId: user.id, channelId: channel.id };
2026-08-24 06:08:38 +00:00
obj.openLazy(channel(message[16])(message[15], message.paths), closure_1_8, obj);
2026-07-20 16:05:17 +00:00
}, items6);
const items8 = [message, channel.id];
const callback5 = React.useCallback(() => {
let obj = user(message[10]);
2026-08-24 06:08:38 +00:00
obj = { location: closure_1_6.DM_CHANNEL };
2026-07-20 16:05:17 +00:00
obj.unblockUser(user.id, obj);
}, items7);
2026-07-29 08:29:29 +00:00
let tmp14 = null;
2026-07-20 16:05:17 +00:00
const callback6 = React.useCallback(() => {
if (null != message) {
2026-07-29 08:29:29 +00:00
const result = channel(message[17]).showReportModalForFirstDM(tmp, () => {
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_2[18]).closePrivateChannel(id.id, true);
2026-07-20 16:05:17 +00:00
});
const obj = channel(message[17]);
}
}, items8);
if (stateFromStores !== constants.BLOCKED) {
2026-07-29 08:29:29 +00:00
obj = { size: "sm", variant: "secondary", text: null, onPress: null };
const intl = tmp2(tmp3[20]).intl;
obj[2] = intl.string(tmp2(tmp3[20]).t.l4Emac);
obj[3] = callback4;
tmp14 = callback(tmp2(tmp3[19]).Button, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp16 = null;
2026-07-20 16:05:17 +00:00
if (isReportable) {
if (null != message) {
2026-07-29 08:29:29 +00:00
obj = { size: "sm", variant: "destructive", text: null, disabled: null, onPress: null };
const intl2 = tmp2(tmp3[20]).intl;
obj[2] = intl2.string(tmp2(tmp3[20]).t.HHZmDn);
obj[3] = null == message;
obj[4] = callback6;
tmp16 = callback(tmp2(tmp3[19]).Button, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp16 = null;
2026-07-20 16:05:17 +00:00
}
}
if (constants.NONE === stateFromStores) {
2026-07-29 08:29:29 +00:00
let tmp18 = null;
let tmp19 = null;
2026-07-20 16:05:17 +00:00
let formatResult = null;
if (!user.bot) {
2026-07-29 08:29:29 +00:00
obj1 = { size: "sm", variant: "active", text: null, onPress: null };
const intl8 = tmp2(tmp3[20]).intl;
obj1[2] = intl8.string(tmp2(tmp3[20]).t["PMsq/b"]);
obj1[3] = callback;
tmp19 = callback(tmp2(tmp3[19]).Button, obj1);
tmp18 = null;
2026-07-20 16:05:17 +00:00
formatResult = null;
}
2026-07-29 08:29:29 +00:00
} else if (tmp13.PENDING_INCOMING === stateFromStores) {
const intl5 = tmp2(tmp3[20]).intl;
const obj2 = { username: null };
let obj7 = user(tmp3[13]);
obj2[0] = obj7.getName(user);
formatResult = intl5.format(tmp2(tmp3[20]).t.uIomXw, obj2);
const obj3 = { size: "sm", variant: "active", text: null, onPress: null };
const intl6 = tmp2(tmp3[20]).intl;
obj3[2] = intl6.string(tmp2(tmp3[20]).t["+WbSn5"]);
obj3[3] = callback1;
tmp19 = callback(tmp2(tmp3[19]).Button, obj3);
const obj4 = { size: "sm", variant: "secondary", text: null, onPress: null };
const intl7 = tmp2(tmp3[20]).intl;
obj4[2] = intl7.string(tmp2(tmp3[20]).t.rQSndv);
obj4[3] = callback2;
tmp18 = callback(tmp2(tmp3[19]).Button, obj4);
} else if (tmp13.FRIEND === stateFromStores) {
const obj5 = { size: "sm", variant: "secondary", text: null, onPress: null };
const intl4 = tmp2(tmp3[20]).intl;
obj5[2] = intl4.string(tmp2(tmp3[20]).t.cvSt1J);
obj5[3] = callback3;
tmp19 = callback(tmp2(tmp3[19]).Button, obj5);
tmp18 = null;
2026-07-20 16:05:17 +00:00
formatResult = null;
2026-07-29 08:29:29 +00:00
} else if (tmp13.PENDING_OUTGOING === stateFromStores) {
2026-08-15 05:55:55 +00:00
const obj6 = { size: "sm", variant: "active", text: null, disabled: true, onPress: "a" };
2026-07-29 08:29:29 +00:00
const intl3 = tmp2(tmp3[20]).intl;
obj6[2] = intl3.string(tmp2(tmp3[20]).t.xMH6vD);
tmp19 = callback(tmp2(tmp3[19]).Button, obj6);
tmp18 = null;
2026-07-20 16:05:17 +00:00
formatResult = null;
} else {
2026-07-29 08:29:29 +00:00
tmp18 = null;
tmp19 = null;
2026-07-20 16:05:17 +00:00
formatResult = null;
2026-07-29 08:29:29 +00:00
if (tmp13.BLOCKED === stateFromStores) {
obj7 = { size: "sm", variant: "secondary", text: null, onPress: null };
const intl9 = tmp2(tmp3[20]).intl;
obj7[2] = intl9.string(tmp2(tmp3[20]).t.XyHpKH);
obj7[3] = callback5;
tmp19 = callback(tmp2(tmp3[19]).Button, obj7);
tmp18 = null;
2026-07-20 16:05:17 +00:00
formatResult = null;
}
}
2026-07-29 08:29:29 +00:00
const obj8 = { style: tmp.container, children: null };
let tmp28 = null != formatResult;
if (tmp28) {
const obj9 = { variant: "text-sm/normal", color: "text-default", children: null };
obj9[2] = formatResult;
tmp28 = callback(tmp2(tmp3[21]).Text, obj9);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const items9 = [tmp28, ];
const items10 = [tmp19, tmp18, tmp14, tmp16];
items9[1] = closure_10(View, { style: tmp.buttonRow, children: items10 });
obj8[1] = items9;
return closure_10(View, obj8);
2026-07-20 16:05:17 +00:00
};