276 lines
12 KiB
TypeScript
276 lines
12 KiB
TypeScript
// Module ID: 9108
|
|
// Function ID: 9109
|
|
// Name: SecureFramesUserVerificationModal
|
|
// Dependencies: [32, 19, 17, 1372, 1874, 9105, 676, 1301, 21, 4255, 712, 589, 4444, 9109, 9110, 9084, 9111, 9103, 4460, 3956, 4216, 1236, 9112, 9113, 8817, 5595, 8677, 9114, 1297, 5257, 4797, 5227, 4251, 4663, 9115, 9117, 4665, 2]
|
|
// Exports: default
|
|
|
|
// Module 9108 (SecureFramesUserVerificationModal)
|
|
import Text from "Text";
|
|
import dispatcher from "dispatcher";
|
|
import get_ActivityIndicator from "getCurrentUserSigningKey";
|
|
import ensureGuildLoaded from "ensureGuildLoaded";
|
|
import mergeGuildAvatar from "mergeGuildAvatar";
|
|
import SECURE_FRAMES_LINKING_BOTTOM_SHEET_KEY from "SECURE_FRAMES_LINKING_BOTTOM_SHEET_KEY";
|
|
import ME from "ME";
|
|
import { ANDROID_FOREGROUND_RIPPLE } from "semanticColor";
|
|
import jsxProd from "getSystemLocale";
|
|
import createCacheKey from "createCacheKey";
|
|
|
|
let c10;
|
|
let c5;
|
|
let c9;
|
|
let closure_12;
|
|
let closure_14;
|
|
let closure_16;
|
|
let closure_17;
|
|
let closure_6;
|
|
let map1;
|
|
let unpackModuleId;
|
|
const require = arg1;
|
|
({ ActivityIndicator: c5, View: closure_6 } = get_ActivityIndicator);
|
|
({ USER_VERIFICATION_CHUNK_SIZE: c9, USER_VERIFICATION_LENGTH: c10, USER_VERIFICATION_NUM_COLUMNS: unpackModuleId, USER_VERIFIED_TOAST_KEY: closure_12 } = SECURE_FRAMES_LINKING_BOTTOM_SHEET_KEY);
|
|
({ AnalyticsLocations: map1, AnalyticsSections: closure_14 } = ME);
|
|
({ jsx: closure_16, jsxs: closure_17 } = jsxProd);
|
|
createCacheKey = { container: null, footer: null, footerText: null, header: null, subtitle: null, code: null, helpMessage: null };
|
|
createCacheKey = { flex: 1, padding: 16, flexDirection: "column", backgroundColor: require("Themes").colors.BACKGROUND_BASE_LOW };
|
|
createCacheKey[0] = createCacheKey;
|
|
createCacheKey[1] = { flex: 1, gap: 16, justifyContent: "flex-end" };
|
|
createCacheKey[2] = { textAlign: "center" };
|
|
createCacheKey[3] = { height: 56, flexDirection: "row", alignItems: "center", justifyContent: "space-between" };
|
|
createCacheKey[4] = { textAlign: "center" };
|
|
createCacheKey[5] = { marginTop: 24 };
|
|
createCacheKey[6] = { marginBottom: 16 };
|
|
createCacheKey = createCacheKey.createStyles(createCacheKey);
|
|
let result = require("get ActivityIndicator").fileFinishedImporting("modules/rtc/native/SecureFramesUserVerificationModal.tsx");
|
|
|
|
export default function SecureFramesUserVerificationModal(userId) {
|
|
let tmp18;
|
|
let tmp19;
|
|
userId = userId.userId;
|
|
const channelId = userId.channelId;
|
|
let name;
|
|
let fingerprint;
|
|
let userKey;
|
|
let readableSecureFramesFingerprint;
|
|
let isUserSecureFramesVerified;
|
|
let isCurrentUserKeyPersistent;
|
|
let isOtherUserKeyPersistent;
|
|
let enabled;
|
|
let analyticsLocations;
|
|
const tmp = createCacheKey();
|
|
let obj = userId(name[11]);
|
|
let items = [isOtherUserKeyPersistent];
|
|
const stateFromStores = obj.useStateFromStores(items, () => isOtherUserKeyPersistent.getUser(userId));
|
|
let obj1 = userId(name[11]);
|
|
let items1 = [isCurrentUserKeyPersistent];
|
|
const stateFromStores1 = obj1.useStateFromStores(items1, () => {
|
|
const channel = isCurrentUserKeyPersistent.getChannel(channelId);
|
|
let guildId;
|
|
if (channel != null) {
|
|
guildId = channel.getGuildId();
|
|
}
|
|
return guildId;
|
|
});
|
|
let obj2 = channelId(name[12]);
|
|
name = obj2.useName(stateFromStores1, null, stateFromStores);
|
|
let obj3 = userId(name[13]);
|
|
const secureFramesPairwiseFingerprint = obj3.useSecureFramesPairwiseFingerprint({ userId });
|
|
fingerprint = secureFramesPairwiseFingerprint.fingerprint;
|
|
userKey = secureFramesPairwiseFingerprint.userKey;
|
|
let obj4 = userId(name[14]);
|
|
obj = { fingerprintBase64: fingerprint, chunkSize: enabled, desiredLength: analyticsLocations };
|
|
readableSecureFramesFingerprint = obj4.useReadableSecureFramesFingerprint(obj);
|
|
let obj6 = userId(name[15]);
|
|
isUserSecureFramesVerified = obj6.useIsUserSecureFramesVerified({ userId, channelId });
|
|
let obj7 = userId(name[16]);
|
|
const isPersistentSecureFramesFingerprint = obj7.useIsPersistentSecureFramesFingerprint({ userId });
|
|
isCurrentUserKeyPersistent = isPersistentSecureFramesFingerprint.isCurrentUserKeyPersistent;
|
|
isOtherUserKeyPersistent = isPersistentSecureFramesFingerprint.isOtherUserKeyPersistent;
|
|
const items2 = [channelId, userKey, isOtherUserKeyPersistent, name, userId];
|
|
let callback = userKey.useCallback(() => {
|
|
if (null != userKey) {
|
|
let obj = userId(name[17]);
|
|
obj.addVerification(userId, tmp, isOtherUserKeyPersistent, channelId, outer1_13.E2EE_USER_VERIFY_MODAL);
|
|
let arr = channelId(name[18]);
|
|
arr = arr.pop();
|
|
obj = { key: null, iconColor: "text-feedback-positive", IconComponent: null, content: null };
|
|
obj[0] = outer1_12;
|
|
obj[2] = userId(name[20]).CircleCheckIcon;
|
|
const intl = userId(name[21]).intl;
|
|
obj = { username: null };
|
|
obj[0] = name;
|
|
obj[3] = intl.formatToPlainString(userId(name[21]).t.Gwu134, obj);
|
|
channelId(name[19]).open(obj);
|
|
const obj2 = channelId(name[19]);
|
|
}
|
|
}, items2);
|
|
const items3 = [userKey, isOtherUserKeyPersistent, userId];
|
|
const callback1 = userKey.useCallback(() => {
|
|
if (null != userKey) {
|
|
userId(name[17]).deleteVerification(userId, tmp, isOtherUserKeyPersistent);
|
|
let arr = channelId(name[18]);
|
|
arr = arr.pop();
|
|
const obj = userId(name[17]);
|
|
}
|
|
}, items3);
|
|
let obj8 = userId(name[22]);
|
|
enabled = obj8.useSecureFramesDeeplinkExperiment({ location: "SecureFramesUserVerificationModal" }).enabled;
|
|
const items4 = [channelId, readableSecureFramesFingerprint, fingerprint, enabled, userId];
|
|
const callback2 = userKey.useCallback(() => {
|
|
if (null != fingerprint) {
|
|
if (null != readableSecureFramesFingerprint) {
|
|
let obj = name;
|
|
let arr = channelId(name[18]);
|
|
arr = arr.pop();
|
|
let showShareActionSheet = userId;
|
|
obj = { userId: null, channelId: null };
|
|
obj[0] = userId;
|
|
obj[1] = channelId;
|
|
const result = userId(name[23]).trackE2EEUserVerificationShareClicked(obj);
|
|
if (enabled) {
|
|
let userVerificationDeeplink = showShareActionSheet(obj[17]).getUserVerificationDeeplink(tmp8, tmp);
|
|
const showShareActionSheetResult = showShareActionSheet(obj[17]);
|
|
} else {
|
|
userVerificationDeeplink = obj3.join(" ");
|
|
}
|
|
const obj4 = userId(name[23]);
|
|
tmp8 = userId;
|
|
showShareActionSheet = showShareActionSheet(obj[24]).showShareActionSheet;
|
|
obj = { message: null };
|
|
obj[0] = userVerificationDeeplink;
|
|
showShareActionSheet(obj, outer1_14.SECURE_FRAMES_VOICE_BOTTOM_SHEET);
|
|
const showShareActionSheetResult1 = showShareActionSheet(obj[24]);
|
|
}
|
|
obj3 = readableSecureFramesFingerprint;
|
|
}
|
|
}, items4);
|
|
analyticsLocations = channelId(name[25])().analyticsLocations;
|
|
const items5 = [analyticsLocations, channelId, userId];
|
|
const callback3 = userKey.useCallback(() => {
|
|
let arr = channelId(name[18]);
|
|
arr = arr.pop();
|
|
channelId(name[26])({ userId, channelId, isVoiceContext: true, sourceAnalyticsLocations: analyticsLocations });
|
|
}, items5);
|
|
let obj9 = userId(name[27]);
|
|
obj = { channelId, userId, nickname: name, onAlertOpen: channelId(name[18]).pop };
|
|
const alertIfSecureFramesKeyInconsistent = obj9.useAlertIfSecureFramesKeyInconsistent(obj);
|
|
const items6 = [isUserSecureFramesVerified];
|
|
const items7 = [isCurrentUserKeyPersistent, isOtherUserKeyPersistent, name];
|
|
[tmp18, tmp19] = fingerprint(userKey.useMemo(() => {
|
|
const intl = userId(name[21]).intl;
|
|
const string = intl.string;
|
|
const t = userId(name[21]).t;
|
|
if (isUserSecureFramesVerified) {
|
|
const items = [string(t.UNUuem), userId(name[28]).BadgeColors.INFO];
|
|
let items1 = items;
|
|
} else {
|
|
items1 = [string(t.y2b7CA), userId(name[28]).BadgeColors.DANGER];
|
|
}
|
|
return items1;
|
|
}, items6), 2);
|
|
const items8 = [channelId, userId];
|
|
const memo = userKey.useMemo(() => {
|
|
let obj = userId(name[17]);
|
|
obj = { isCurrentUserKeyPersistent, isOtherUserKeyPersistent, otherUserNickname: name };
|
|
return obj.getUserVerificationFooterText(obj);
|
|
}, items7);
|
|
const effect = userKey.useEffect(() => {
|
|
let obj = userId(name[23]);
|
|
obj = { userId, channelId };
|
|
const result = obj.trackE2EEUserVerificationViewed(obj);
|
|
}, items8);
|
|
obj1 = { top: true, bottom: true, style: tmp.container, children: null };
|
|
obj2 = { style: tmp.header, children: null };
|
|
obj3 = { accessibilityRole: "button", accessibilityLabel: null, androidRippleConfig: null, hitSlop: 8, onPress: null, children: null };
|
|
let intl = userId(name[21]).intl;
|
|
obj3[1] = intl.string(userId(name[21]).t.cpT0Cq);
|
|
obj3[2] = ANDROID_FOREGROUND_RIPPLE;
|
|
obj3[4] = callback3;
|
|
obj3[5] = callback(userId(name[31]).ArrowLargeLeftIcon, { size: "md" });
|
|
const items9 = [callback(userId(name[30]).PressableOpacity, obj3), ];
|
|
let tmp24Result = null != fingerprint && null != readableSecureFramesFingerprint;
|
|
if (tmp24Result) {
|
|
obj4 = { accessibilityRole: "button", accessibilityLabel: null, androidRippleConfig: null, hitSlop: 8, onPress: null, children: null };
|
|
const intl2 = tmp2(tmp3[21]).intl;
|
|
obj4[1] = intl2.string(tmp2(tmp3[21]).t.RDE0Sc);
|
|
obj4[2] = tmp25;
|
|
obj4[4] = callback2;
|
|
const obj5 = { variant: "text-md/semibold", color: "text-brand", children: null };
|
|
const intl3 = tmp2(tmp3[21]).intl;
|
|
obj5[2] = intl3.string(tmp2(tmp3[21]).t.RDE0Sc);
|
|
obj4[5] = tmp24(tmp2(tmp3[32]).Text, obj5);
|
|
tmp24Result = tmp24(tmp2(tmp3[30]).PressableOpacity, obj4);
|
|
}
|
|
items9[1] = tmp24Result;
|
|
obj2[1] = items9;
|
|
const items10 = [closure_17(isUserSecureFramesVerified, obj2), , , ];
|
|
obj6 = { spacing: 8, justify: "center", align: "center", direction: "vertical", children: null };
|
|
obj7 = { variant: "heading-xl/bold", color: "mobile-text-heading-primary", children: null };
|
|
const intl4 = tmp2(tmp3[21]).intl;
|
|
obj7[2] = intl4.string(userId(name[21]).t["/WPGnF"]);
|
|
const items11 = [callback(userId(name[32]).Text, obj7), ];
|
|
obj8 = { style: tmp.subtitle, variant: "text-md/medium", color: "text-default", children: null };
|
|
const intl5 = tmp2(tmp3[21]).intl;
|
|
obj8[3] = intl5.format(userId(name[21]).t.oc2kce, { username: name });
|
|
items11[1] = callback(userId(name[32]).Text, obj8);
|
|
obj6[4] = items11;
|
|
items10[1] = closure_17(userId(name[33]).Stack, obj6);
|
|
obj9 = { style: tmp.code, children: null };
|
|
const items12 = [callback(channelId(name[34]), { style: tmp.helpMessage, userId, userKey }), ];
|
|
const obj11 = { title: null, chunks: null, columns: null, trailing: null };
|
|
const obj10 = { style: tmp.helpMessage, userId, userKey };
|
|
const tmp17 = fingerprint(userKey.useMemo(() => {
|
|
const intl = userId(name[21]).intl;
|
|
const string = intl.string;
|
|
const t = userId(name[21]).t;
|
|
if (isUserSecureFramesVerified) {
|
|
const items = [string(t.UNUuem), userId(name[28]).BadgeColors.INFO];
|
|
let items1 = items;
|
|
} else {
|
|
items1 = [string(t.y2b7CA), userId(name[28]).BadgeColors.DANGER];
|
|
}
|
|
return items1;
|
|
}, items6), 2);
|
|
tmp25 = ANDROID_FOREGROUND_RIPPLE;
|
|
const intl6 = tmp2(tmp3[21]).intl;
|
|
obj11[0] = intl6.string(userId(name[21]).t["/WPGnF"]);
|
|
obj11[1] = readableSecureFramesFingerprint;
|
|
obj11[2] = closure_11;
|
|
if (null == readableSecureFramesFingerprint) {
|
|
tmp24Result = tmp24(readableSecureFramesFingerprint, {});
|
|
} else {
|
|
const obj12 = { color: null, text: null };
|
|
obj12[0] = tmp19;
|
|
obj12[1] = tmp18;
|
|
tmp24Result = tmp24(tmp2(tmp3[28]).TextBadge, obj12);
|
|
}
|
|
obj11[3] = tmp24Result;
|
|
items12[1] = callback(channelId(name[35]), obj11);
|
|
obj9[1] = items12;
|
|
items10[2] = closure_17(isUserSecureFramesVerified, obj9);
|
|
const obj13 = { style: tmp.footer, children: null };
|
|
const items13 = [callback(userId(name[32]).Text, { style: tmp.footerText, variant: "text-xs/normal", color: "text-default", children: memo }), ];
|
|
let loading = null == readableSecureFramesFingerprint;
|
|
if (!loading) {
|
|
loading = isPersistentSecureFramesFingerprint.loading;
|
|
}
|
|
const obj15 = { disabled: loading, variant: "primary", onPress: null, text: null };
|
|
if (isUserSecureFramesVerified) {
|
|
callback = callback1;
|
|
}
|
|
obj15[2] = callback;
|
|
const intl7 = tmp2(tmp3[21]).intl;
|
|
let string = intl7.string;
|
|
let t = tmp2(tmp3[21]).t;
|
|
if (isUserSecureFramesVerified) {
|
|
let stringResult = string(t["Osb+/n"]);
|
|
} else {
|
|
stringResult = string(t["0tvNAn"]);
|
|
}
|
|
obj15[3] = stringResult;
|
|
items13[1] = callback(userId(name[36]).Button, obj15);
|
|
obj13[1] = items13;
|
|
items10[3] = closure_17(isUserSecureFramesVerified, obj13);
|
|
obj1[3] = items10;
|
|
return closure_17(userId(name[29]).SafeAreaPaddingView, obj1);
|
|
};
|