decord/source/actions/ActivitiesActionCreators.tsx

274 lines
9.2 KiB
TypeScript
Raw Normal View History

2026-07-30 10:14:41 +00:00
// Module ID: 10479
// Function ID: 10480
// Dependencies: [5, 1372, 676, 4182, 709, 530, 5965, 5713, 4384, 4199, 2]
2026-07-20 16:05:17 +00:00
2026-07-30 10:14:41 +00:00
// Module 10479
2026-07-29 08:29:29 +00:00
import sendRequest from "sendRequest";
import ensureGuildLoaded from "ensureGuildLoaded";
2026-07-23 10:11:24 +00:00
import ME from "ME";
import { MessageSendLocation } from "MESSAGE_GROUP_SPACING";
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
let c5;
2026-07-23 10:11:24 +00:00
let closure_6;
2026-07-29 08:29:29 +00:00
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ Endpoints: c5, ActivityTypes: closure_6, AnalyticEvents: error, LoggingInviteTypes: metroImportAll } = ME);
2026-07-23 10:11:24 +00:00
const result = require("ME").fileFinishedImporting("actions/ActivitiesActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export default {
2026-07-29 08:29:29 +00:00
updateActivity(share_activity) {
const applicationId = share_activity.applicationId;
const distributor = share_activity.distributor;
let token = share_activity.token;
2026-07-20 16:05:17 +00:00
if (token === undefined) {
token = null;
}
2026-07-29 08:29:29 +00:00
let num = share_activity.duration;
2026-07-20 16:05:17 +00:00
if (num === undefined) {
num = 0;
}
2026-07-29 08:29:29 +00:00
let flag = share_activity.closed;
2026-07-20 16:05:17 +00:00
if (flag === undefined) {
flag = false;
}
2026-07-29 08:29:29 +00:00
let exePath = share_activity.exePath;
2026-07-20 16:05:17 +00:00
if (exePath === undefined) {
exePath = null;
}
2026-07-29 08:29:29 +00:00
let voiceChannelId = share_activity.voiceChannelId;
2026-07-20 16:05:17 +00:00
if (voiceChannelId === undefined) {
voiceChannelId = null;
}
2026-07-29 08:29:29 +00:00
let sessionId = share_activity.sessionId;
2026-07-20 16:05:17 +00:00
if (sessionId === undefined) {
sessionId = null;
}
2026-07-29 08:29:29 +00:00
let mediaSessionId = share_activity.mediaSessionId;
2026-07-20 16:05:17 +00:00
if (mediaSessionId === undefined) {
mediaSessionId = null;
}
2026-07-23 10:11:24 +00:00
let obj = distributor(num[4]);
2026-07-20 16:05:17 +00:00
obj.wait(() => {
let obj = distributor(num[4]);
obj = { type: "ACTIVITY_UPDATE_START", applicationId, duration: num, distributor };
return obj.dispatch(obj);
});
2026-07-23 10:11:24 +00:00
const HTTP = applicationId(num[5]).HTTP;
2026-07-29 08:29:29 +00:00
obj = { url: constants.ACTIVITIES, body: { application_id: applicationId, token, duration: num, share_activity: share_activity.shareActivity, distributor, closed: flag, exePath, voice_channel_id: voiceChannelId, session_id: sessionId, media_session_id: mediaSessionId }, retries: 1, oldFormErrors: true, rejectWithError: true };
2026-07-20 16:05:17 +00:00
const postResult = HTTP.post(obj);
HTTP.post(obj).then((body) => {
let obj = distributor(num[4]);
obj = { type: "ACTIVITY_UPDATE_SUCCESS", applicationId, token: body.body.token, duration: num, distributor };
obj.dispatch(obj);
}).catch(() => {
let obj = distributor(num[4]);
obj = { type: "ACTIVITY_UPDATE_FAIL", applicationId };
obj.dispatch(obj);
});
},
sendActivityInvite(activity) {
let content;
2026-07-23 10:11:24 +00:00
let importDefault;
2026-07-20 16:05:17 +00:00
let targetUserId;
let type;
activity = activity.activity;
2026-07-23 10:11:24 +00:00
({ content, location: importDefault } = activity);
2026-07-29 08:29:29 +00:00
let channel;
2026-07-20 16:05:17 +00:00
({ type, targetUserId } = activity);
2026-07-23 10:11:24 +00:00
channel = channel.getChannel(activity.channelId);
2026-07-20 16:05:17 +00:00
if (null == channel) {
return Promise.resolve(null);
} else {
2026-07-29 08:29:29 +00:00
if (content == null) {
content = "";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const parsed = importDefault(channel[6]).parse(channel, content);
const tmp7Result = importDefault(channel[7]);
let obj = { activityAction: null, location: null };
obj = { type: null, activity: null, targetUserId: null };
obj[0] = type;
obj[1] = activity;
obj[2] = targetUserId;
obj[0] = obj;
obj[1] = MessageSendLocation.ACTIVITY_SHARE;
2026-07-23 10:11:24 +00:00
const obj4 = importDefault(channel[6]);
2026-07-29 08:29:29 +00:00
const tmp7 = importDefault;
const tmp8 = channel;
return tmp7Result.sendMessage(channel.id, parsed, false, obj).then((body) => {
2026-07-23 10:11:24 +00:00
let obj = outer1_1(channel[8]);
2026-07-29 08:29:29 +00:00
obj = { location: closure_1, invite_type: null, application_id: null, guild_id: null, channel_id: null, message_id: null };
2026-07-23 10:11:24 +00:00
if (activity.type === outer1_6.LISTENING) {
let APPLICATION = outer1_8.SPOTIFY;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
APPLICATION = outer1_8.APPLICATION;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = APPLICATION;
obj[2] = activity.application_id;
obj[3] = channel.getGuildId();
obj[4] = channel.id;
2026-07-20 16:05:17 +00:00
let id = null;
if (null != body) {
id = body.body.id;
}
2026-07-29 08:29:29 +00:00
obj[5] = id;
2026-07-23 10:11:24 +00:00
obj.trackWithMetadata(outer1_7.INVITE_SENT, obj);
2026-07-20 16:05:17 +00:00
return Promise.resolve(channel);
}, (arg0) => Promise.reject(arg0));
}
},
sendActivityInviteUser(userId) {
2026-07-29 08:29:29 +00:00
let sendRequest;
2026-07-23 10:11:24 +00:00
let dependencyMap;
let importDefault;
2026-07-29 08:29:29 +00:00
let require;
2026-07-23 10:11:24 +00:00
const self = this;
2026-07-29 08:29:29 +00:00
({ type: importDefault, activity: dependencyMap, content: sendRequest, location: require } = userId);
const obj = importDefault(4199);
return importDefault(4199).ensurePrivateChannel(userId.userId).then((channelId) => self.sendActivityInvite({ channelId, type: closure_1, activity: closure_2, content: sendRequest, location: closure_0 }));
2026-07-20 16:05:17 +00:00
},
getJoinSecret(arg0, arg1, arg2, arg3, arg4) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
let closure_1 = arg1;
let closure_2 = arg2;
2026-07-20 16:05:17 +00:00
const callback = arg3;
2026-07-29 08:29:29 +00:00
let ensureGuildLoaded = arg4;
return callback(function*() {
if (dependencyMap === 2) {
dependencyMap = 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 {
return { value: "HermesInternal", done: null };
}
} else {
try {
dependencyMap = 2;
if (0 === c1) {
if (arg0 === 1) {
dependencyMap = 3;
throw arg1;
} else if (arg0 === 2) {
dependencyMap = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let closure_0 = tmp4;
closure_0 = undefined;
const obj1 = {};
if (null != outer1_3) {
obj1.channel_id = outer1_3;
}
if (null != outer1_4) {
obj1.message_id = outer1_4;
}
const HTTP = outer1_0(530).HTTP;
const obj2 = { url: null, retries: 3, query: null, rejectWithError: null };
obj2[0] = outer1_5.USER_ACTIVITY_JOIN(outer1_0, c1, dependencyMap);
obj2[2] = obj1;
let obj4 = outer1_0(530);
obj2[3] = obj4.rejectWithMigratedError();
c1 = 1;
dependencyMap = 1;
const obj3 = { value: null, done: false };
obj3[0] = HTTP.get(obj2);
return obj3;
}
} else if (arg0 === 1) {
dependencyMap = 3;
throw arg1;
} else if (arg0 === 2) {
dependencyMap = 3;
obj4 = { value: null, done: true };
obj4[0] = arg1;
return obj4;
} else {
closure_0 = arg1;
obj = { secret: null, joinUrl: null };
obj[0] = closure_0.body.secret;
obj[1] = closure_0.body.join_url;
dependencyMap = 3;
const obj5 = { value: null, done: true };
obj5[0] = obj;
return obj5;
}
} catch (tmp14) {
dependencyMap = tmp;
throw tmp14;
}
}
})();
2026-07-20 16:05:17 +00:00
},
subscribeActivities(items) {
2026-07-23 10:11:24 +00:00
let closure_0 = items;
2026-07-29 08:29:29 +00:00
return callback(function*() {
if (v0 === 2) {
v0 = 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 {
return { value: "HermesInternal", done: null };
}
} else {
try {
v0 = 2;
if (0 === c1) {
if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
const mapped = v0.map((userId) => ({ user_id: userId.userId, application_id: userId.applicationId, party_id: userId.partyId, message_id: userId.messageId, channel_id: userId.channelId }));
const HTTP = v0(outer1_2[5]).HTTP;
const obj1 = { url: null, body: null, retries: 1, rejectWithError: null };
obj1[0] = outer1_5.USER_ACTIVITY_SUBSCRIBE;
const obj2 = { subscriptions: null };
obj2[0] = mapped;
obj1[1] = obj2;
obj1[3] = v0(outer1_2[5]).rejectWithMigratedError();
c1 = 1;
v0 = 1;
const obj3 = { value: null, done: false };
obj3[0] = HTTP.post(obj1);
return obj3;
}
} else if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 3;
const obj4 = { value: null, done: true };
obj4[0] = arg1;
return obj4;
} else {
v0 = 3;
obj = { value: null, done: true };
obj[0] = arg1.body;
return obj;
}
} catch (tmp5) {
v0 = tmp;
throw tmp5;
}
}
})();
2026-07-20 16:05:17 +00:00
}
};