Files
discord-decomp/sources/modules/applications/getApplicationInstallURL.tsx
T
2026-07-27 16:20:00 +03:00

59 lines
3.0 KiB
TypeScript

/* Metro module 8809; source: modules/applications/getApplicationInstallURL.tsx; dependencies: [661, 2] */
function _fun68859(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8994:6, offset: 0x01c5f8a3, size: 122 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = (require(661) /* metro dependency 661: Constants */).Routes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/applications/getApplicationInstallURL.tsx');
exports.getActivityLaunchURL = getActivityLaunchURL;
exports.getApplicationInstallURL = getApplicationInstallURL;
}
function getActivityLaunchURL({applicationId, customId, referrerId, linkId}) { // fn#68860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8994:219, offset: 0x01c5f91d, size: 203 bytes, params: 2, frame: 20
const URL = global.URL;
const uRL = new URL(Routes.ACTIVITY_DETAILS(applicationId),
'' + global.location.protocol + '//' + global.location.host);
const searchParams = uRL.searchParams;
if (linkId != null) {
searchParams.set('link_id', linkId);
}
if (referrerId != null) {
searchParams.set('referrer_id', referrerId);
}
if (customId != null) {
searchParams.set('custom_id', customId);
}
return uRL.toString();
}
function getApplicationInstallURL({id, customInstallUrl, installParams, integrationTypesConfig}) { // fn#68861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8994:534, offset: 0x01c5f9e8, size: 275 bytes, params: 2, frame: 22
var permissions;
var scopes;
if (customInstallUrl != null) {
return customInstallUrl;
}
const URLSearchParams = global.URLSearchParams;
let uRLSearchParams = new URLSearchParams();
uRLSearchParams.set('client_id', id);
if (installParams != null) {
if (!(integrationTypesConfig != null && global.Object.values(integrationTypesConfig).some(function(a0) {
var value = undefined;
return (a0 == null ? value : a0.oauth2_install_params) != null || (a0 == null ? value : a0.oauth2InstallParams) != null;
}))) {
permissions = installParams.permissions;
scopes = installParams.scopes;
if (permissions != null) {
uRLSearchParams.set('permissions', permissions);
}
if (scopes != null) {
uRLSearchParams.set('scope', scopes.join(' '));
}
}
}
const protocol = global.location.protocol;
const host = global.location.host;
const OAUTH2_AUTHORIZE = Routes.OAUTH2_AUTHORIZE;
uRLSearchParams = uRLSearchParams.toString();
return '' + protocol + '//' + host + OAUTH2_AUTHORIZE + '?' + uRLSearchParams;
}