decord/source/actions/GamesActionCreators.native.tsx

272 lines
10 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10967
// Function ID: 10968
2026-07-20 16:05:17 +00:00
// Name: fetchJoinSecret
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 676, 4485, 8746, 691, 7298, 4093, 709, 530, 8741, 8742, 8768, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 10967 (fetchJoinSecret)
import _modDef4093 from "module_4093" /* 4093 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import ME from "ME" /* 676 */;
import { ActivityIntent } from "items3" /* 4485 */;
import { MAIN_SURFACE } from "FrameLayoutModes" /* 8746 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function fetchJoinSecret(application) {
2026-07-23 10:11:24 +00:00
const _require = arg1;
2026-07-20 16:05:17 +00:00
({ channelId, messageId } = application);
const id = application.application.id;
let tmp = null != channelId;
({ userId, sessionId, remotePartyId } = application);
if (tmp) {
tmp = null != messageId;
}
let tmp2;
if (tmp) {
2026-07-29 08:29:29 +00:00
let obj = { channel_id: null, message_id: null, headless: true };
obj[0] = channelId;
obj[1] = messageId;
2026-07-20 16:05:17 +00:00
tmp2 = obj;
}
2026-07-29 08:29:29 +00:00
id(709).dispatch({ type: "ACTIVITY_JOIN_LOADING", applicationId: id, remotePartyId });
const HTTP = _require(530).HTTP;
2026-07-23 10:11:24 +00:00
obj = { url: closure_4.USER_ACTIVITY_JOIN(userId, sessionId, id), retries: 3, query: tmp2, oldFormErrors: true, rejectWithError: true };
2026-07-20 16:05:17 +00:00
const value = HTTP.get(obj);
2026-08-24 06:08:38 +00:00
return value.then((arg0) => f121181(arg0), () => {
2026-08-06 08:05:19 +00:00
let obj = id(application[7]);
2026-07-20 16:05:17 +00:00
obj = { type: "ACTIVITY_JOIN_FAILED", applicationId: id };
obj.dispatch(obj);
return false;
});
}
2026-07-29 08:29:29 +00:00
({ Endpoints: c4, DiscordConnectDeeplinks: c5, WebBrowserType: closure_6, ActivityFlags: error } = ME);
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("actions/GamesActionCreators.native.tsx");
2026-07-23 10:11:24 +00:00
export default {
2026-07-20 16:05:17 +00:00
addGame() {
},
toggleOverlay() {
},
editName() {
},
identifyGame() {
2026-08-24 06:08:38 +00:00
error = new Error("not supported");
2026-07-20 16:05:17 +00:00
return Promise.reject(error);
},
getDetectableGames() {
},
reportUnverifiedGame() {
},
uploadIcon() {
},
deleteEntry() {
},
launch() {
return Promise.resolve();
},
join(arg0) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-29 08:29:29 +00:00
return callback(function*() {
if (table === 2) {
table = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
table = 2;
if (0 === c3) {
if (arg0 === 1) {
table = 3;
throw arg1;
} else if (arg0 === 2) {
table = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
({ application, channelId, locationObject } = closure_1_0);
({ embedded, source } = closure_1_0);
2026-07-29 08:29:29 +00:00
if (undefined === locationObject) {
locationObject = {};
}
2026-08-06 08:05:19 +00:00
let analyticsLocations = tmp25.analyticsLocations;
2026-07-29 08:29:29 +00:00
if (undefined === analyticsLocations) {
analyticsLocations = [];
}
if (embedded) {
2026-08-24 06:08:38 +00:00
let obj2 = closure_1_0(table[9]);
2026-07-29 08:29:29 +00:00
if (obj2.canLaunchFrame(application)) {
2026-08-06 08:05:19 +00:00
let tmp14Result = tmp14(tmp13[10]);
2026-08-24 06:08:38 +00:00
obj1 = { applicationId: null, surface: null };
2026-07-29 08:29:29 +00:00
obj1[0] = application.id;
2026-08-24 06:08:38 +00:00
obj1[1] = closure_1_9;
2026-07-29 08:29:29 +00:00
c3 = 1;
table = 1;
obj2 = { value: null, done: false };
obj2[0] = tmp14Result.launchFrame(obj1);
return obj2;
} else {
let obj3 = { applicationId: null, activityChannelId: null, source: null, locationObject: null, analyticsLocations: null };
obj3[0] = application.id;
2026-08-24 06:08:38 +00:00
c1 = channelId;
2026-08-06 08:05:19 +00:00
tmp14Result = tmp14(tmp13[11]);
2026-07-29 08:29:29 +00:00
if (channelId == null) {
c1 = undefined;
}
obj3[1] = c1;
obj3[2] = source;
obj3[3] = locationObject;
obj3[4] = analyticsLocations;
c3 = 2;
table = 1;
let obj4 = { value: null, done: false };
obj4[0] = tmp14Result(obj3);
return obj4;
}
} else if (null != tmp7) {
2026-08-24 06:08:38 +00:00
let tmp9 = closure_1_10(tmp25, () => true);
2026-07-29 08:29:29 +00:00
} else {
tmp9 = (function joinViaDeeplink(application) {
2026-08-24 06:08:38 +00:00
let f121181 = application;
2026-07-29 08:29:29 +00:00
application = application.application;
2026-08-24 06:08:38 +00:00
if (application.id === f121181(application[4]).DISCORD_CONNECT_EXAMPLE_APP_APPLICATION_ID) {
2026-08-06 08:05:19 +00:00
let deeplink_uri = tmp(tmp2[4]).DISCORD_CONNECT_EXAMPLE_APP_DEEPLINK_URI;
2026-07-29 08:29:29 +00:00
} else {
deeplink_uri = application.deeplink_uri;
}
let id = deeplink_uri;
if (null == deeplink_uri) {
2026-08-06 08:05:19 +00:00
if (!id(tmp2[5])(application.applicationActivity, constants.SUPPORTS_JOIN_URL)) {
2026-07-29 08:29:29 +00:00
let resolved = Promise.resolve(false);
}
return resolved;
}
2026-08-24 06:08:38 +00:00
f121181 = (body) => {
2026-07-29 08:29:29 +00:00
const join_url = body.body.join_url;
const secret = body.body.secret;
if (null != join_url) {
2026-08-24 06:08:38 +00:00
id(application[6]).openURL(join_url, closure_1_6.SAFARI);
2026-08-06 08:05:19 +00:00
const obj3 = id(application[6]);
2026-07-29 08:29:29 +00:00
let obj = { type: "ACTIVITY_JOIN", applicationId: null, parentApplicationId: null, secret: null, intent: null, embedded: null };
({ id: obj5[1], parent_id: obj5[2] } = application);
obj[3] = secret;
2026-08-24 06:08:38 +00:00
obj[4] = closure_1_8.PLAY;
let flag3 = f121181.embedded;
2026-07-29 08:29:29 +00:00
if (flag3 == null) {
flag3 = false;
}
obj[5] = flag3;
2026-08-06 08:05:19 +00:00
id(application[7]).dispatch(obj);
2026-07-29 08:29:29 +00:00
let flag2 = true;
2026-08-06 08:05:19 +00:00
const obj4 = id(application[7]);
2026-07-29 08:29:29 +00:00
} else {
if (null == id) {
2026-08-06 08:05:19 +00:00
obj = id(application[7]);
2026-07-29 08:29:29 +00:00
obj = { type: "ACTIVITY_JOIN_FAILED", applicationId: null };
obj[1] = application.id;
obj.dispatch(obj);
flag2 = false;
} else {
const _HermesInternal = HermesInternal;
2026-08-24 06:08:38 +00:00
const combined = "" + str.replace(/\/+$/, "") + closure_1_5.GAME_INVITE_FRAGMENT + secret;
id(application[6]).openURL(combined, closure_1_6.SAFARI);
2026-08-06 08:05:19 +00:00
const obj6 = id(application[6]);
2026-08-24 06:08:38 +00:00
obj1 = { type: "ACTIVITY_JOIN", applicationId: null, parentApplicationId: null, secret: null, intent: null, embedded: null };
2026-07-29 08:29:29 +00:00
({ id: obj8[1], parent_id: obj8[2] } = application);
obj1[3] = secret;
2026-08-24 06:08:38 +00:00
obj1[4] = closure_1_8.PLAY;
let flag = f121181.embedded;
2026-07-29 08:29:29 +00:00
if (flag == null) {
flag = false;
}
obj1[5] = flag;
2026-08-06 08:05:19 +00:00
id(application[7]).dispatch(obj1);
2026-07-29 08:29:29 +00:00
flag2 = true;
2026-08-06 08:05:19 +00:00
const obj7 = id(application[7]);
2026-07-29 08:29:29 +00:00
}
str = id;
}
return flag2;
};
({ channelId, messageId } = application);
id = application.application.id;
let tmp7 = null != channelId;
({ userId, sessionId, remotePartyId } = application);
if (tmp7) {
tmp7 = null != messageId;
}
let tmp8;
if (tmp7) {
let obj = { channel_id: null, message_id: null, headless: true };
obj[0] = channelId;
obj[1] = messageId;
tmp8 = obj;
}
2026-08-06 08:05:19 +00:00
id(application[7]).dispatch({ type: "ACTIVITY_JOIN_LOADING", applicationId: id, remotePartyId });
const HTTP = tmp(tmp2[8]).HTTP;
2026-07-29 08:29:29 +00:00
obj = { url: closure_4.USER_ACTIVITY_JOIN(userId, sessionId, id), retries: 3, query: tmp8, oldFormErrors: true, rejectWithError: true };
const value = HTTP.get(obj);
2026-08-24 06:08:38 +00:00
resolved = value.then((arg0) => f121181(arg0), () => {
2026-08-06 08:05:19 +00:00
let obj = id(application[7]);
2026-07-29 08:29:29 +00:00
obj = { type: "ACTIVITY_JOIN_FAILED", applicationId: id };
obj.dispatch(obj);
return false;
});
2026-08-06 08:05:19 +00:00
})(tmp25);
2026-07-29 08:29:29 +00:00
}
}
} else {
if (1 === tmp4) {
if (arg0 === 1) {
table = 3;
throw arg1;
} else {
table = 3;
const obj5 = { value: null, done: true };
obj5[0] = arg1;
return obj5;
}
} else if (arg0 === 1) {
table = 3;
throw arg1;
} else if (arg0 === 2) {
table = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
c0 = arg1;
2026-07-29 08:29:29 +00:00
if (arg1 == null) {
c0 = false;
}
}
table = 3;
}
2026-08-06 08:05:19 +00:00
} catch (tmp19) {
2026-07-29 08:29:29 +00:00
table = tmp;
2026-08-06 08:05:19 +00:00
throw tmp19;
2026-07-29 08:29:29 +00:00
}
}
})();
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
joinWithSecret(str) {
const combined = "" + str.replace(/\/+$/, "") + constants.GAME_INVITE_FRAGMENT + arg1;
2026-08-24 06:08:38 +00:00
_modDef4093.openURL(combined, constants2.SAFARI);
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
};