decord/source/actions/ActivitiesActionCreators.tsx

168 lines
6.4 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 10520
// Function ID: 10521
// Dependencies: [5, 1391, 676, 4373, 709, 530, 7287, 7063, 4588, 10521, 10522, 4393, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 10520
import _modDef4393 from "module_4393" /* 4393 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "ensureGuildLoaded" /* 1391 */;
import ME from "ME" /* 676 */;
2026-08-25 06:04:03 +00:00
import { MessageSendLocation } from "MESSAGE_GROUP_SPACING" /* 4373 */;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
({ Endpoints: c5, ActivityTypes: closure_6, AnalyticEvents: error, LoggingInviteTypes: closure_8 } = ME);
const result = require("set").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) {
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-08-24 06:08:38 +00:00
let obj = closure_1_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-08-24 06:08:38 +00:00
if (activity.type === closure_1_6.LISTENING) {
let APPLICATION = closure_1_8.SPOTIFY;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
APPLICATION = closure_1_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-08-24 06:08:38 +00:00
obj.trackWithMetadata(closure_1_7.INVITE_SENT, obj);
2026-08-14 17:33:39 +00:00
const activitySessionKey = activity(channel[9]).getActivitySessionKey(tmp2);
if (null != activitySessionKey) {
activity(tmp[10]).markChannelInvited(activitySessionKey, tmp5.id);
const tmp8Result = activity(tmp[10]);
}
2026-07-20 16:05:17 +00:00
return Promise.resolve(channel);
}, (arg0) => Promise.reject(arg0));
}
},
sendActivityInviteUser(userId) {
2026-07-23 10:11:24 +00:00
const self = this;
2026-08-24 06:08:38 +00:00
({ type: importDefault, activity: dependencyMap, content: closure_3, location: require } = userId);
2026-08-25 06:04:03 +00:00
const obj = _modDef4393;
return _modDef4393.ensurePrivateChannel(userId.userId).then((channelId) => self.sendActivityInvite({ channelId, type: closure_1, activity: closure_2, content: closure_3, location: closure_0 }));
2026-07-20 16:05:17 +00:00
},
getJoinSecret(arg0, arg1, arg2, arg3, arg4) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
closure_2 = arg2;
2026-07-20 16:05:17 +00:00
const callback = arg3;
2026-08-24 06:08:38 +00:00
closure_4 = arg4;
2026-07-29 08:29:29 +00:00
return callback(function*() {
2026-08-24 06:08:38 +00:00
closure_0 = tmp4;
obj1 = {};
if (null != closure_1_3) {
obj1.channel_id = closure_1_3;
2026-08-04 21:03:28 +00:00
}
2026-08-24 06:08:38 +00:00
if (null != closure_1_4) {
obj1.message_id = closure_1_4;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
const HTTP = closure_1_0(530).HTTP;
2026-08-04 21:03:28 +00:00
const obj2 = { url: null, retries: 3, query: null, rejectWithError: null };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_1_5.USER_ACTIVITY_JOIN(closure_1_0, c1, dependencyMap);
2026-08-04 21:03:28 +00:00
obj2[2] = obj1;
2026-08-24 06:08:38 +00:00
const obj4 = closure_1_0(530);
2026-08-04 21:03:28 +00:00
obj2[3] = obj4.rejectWithMigratedError();
closure_0 = yield HTTP.get(obj2);
const obj = { secret: null, joinUrl: null };
obj[0] = closure_0.body.secret;
obj[1] = closure_0.body.join_url;
return obj;
2026-07-29 08:29:29 +00:00
})();
2026-07-20 16:05:17 +00:00
},
subscribeActivities(items) {
2026-08-24 06:08:38 +00:00
closure_0 = items;
2026-07-29 08:29:29 +00:00
return callback(function*() {
2026-08-04 21:03:28 +00:00
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 }));
2026-08-24 06:08:38 +00:00
const HTTP = v0(closure_1_2[5]).HTTP;
obj1 = { url: null, body: null, retries: 1, rejectWithError: null };
obj1[0] = closure_1_5.USER_ACTIVITY_SUBSCRIBE;
2026-08-04 21:03:28 +00:00
const obj2 = { subscriptions: null };
obj2[0] = mapped;
obj1[1] = obj2;
2026-08-24 06:08:38 +00:00
obj1[3] = v0(closure_1_2[5]).rejectWithMigratedError();
2026-08-04 21:03:28 +00:00
yield HTTP.post(obj1);
return arg1.body;
2026-07-29 08:29:29 +00:00
})();
2026-07-20 16:05:17 +00:00
}
};