decord/source/modules/messages/native/MessageSendFailureNotificationManager.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

98 lines
3.9 KiB
TypeScript

// Module ID: 17816
// Function ID: 17817
// Name: handleMessageSendFailure
// Dependencies: [2011, 4381, 1371, 1895, 1074, 13716, 10094, 10096, 9687, 1114, 7118, 2]
// Module 17816 (handleMessageSendFailure)
import getSystemLocale from "getSystemLocale" /* 1114 */;
import initializeDefault from "initialize" /* 7118 */;
import NativeModulesDefault from "NativeModules" /* 9687 */;
import isReactionMilestoneNotification from "isReactionMilestoneNotification" /* 10094 */;
import dispatcherDefault from "dispatcher" /* 10096 */;
import closure_3 from "handleConnectionOpen" /* 2011 */;
import closure_4 from "handleConnectionOpen" /* 4381 */;
import closure_5 from "mergeGuildAvatar" /* 1371 */;
import closure_6 from "getState" /* 1895 */;
import ME from "ME" /* 1074 */;
import { LocalNotificationTypes } from "LocalNotificationTypes" /* 13716 */;
require = arg1;
function handleMessageSendFailure(shouldNotify) {
({ channelId, messageId } = shouldNotify);
if (shouldNotify.shouldNotify) {
if ("active" !== state.getState()) {
let obj = NativeModulesDefault;
obj = { category: "local", alertTitle: null, alertBody: null, userInfo: null };
const intl = getSystemLocale.intl;
obj[1] = intl.string(getSystemLocale.t.LdlH2M);
const intl2 = getSystemLocale.intl;
obj[2] = intl2.string(getSystemLocale.t.xxRPOT);
obj = { channelId: null, messageId: null, type: null };
obj[0] = channelId;
obj[1] = messageId;
obj[2] = LocalNotificationTypes.MESSAGE_SEND_FAILED;
obj[3] = obj;
const result = obj.presentLocalNotification(obj);
} else if (channelId !== channelId.getChannelId(guildId.getGuildId())) {
const MESSAGE_FAILED_TO_SEND = constants.MESSAGE_FAILED_TO_SEND;
const notificationDuration = isReactionMilestoneNotification.getNotificationDuration(MESSAGE_FAILED_TO_SEND);
const obj4 = isReactionMilestoneNotification;
obj1 = { type: null, channelId: null, messageId: null, key: null, duration: null, onDismiss: null, inAppNotificationId: null };
obj1[0] = MESSAGE_FAILED_TO_SEND;
obj1[1] = channelId;
obj1[2] = messageId;
obj1[3] = `${channelId}-${messageId}`;
obj1[4] = notificationDuration;
obj1[5] = function onDismiss() {
callback(table[7]).clearNotification();
};
const obj5 = dispatcherDefault;
obj1[6] = isReactionMilestoneNotification.generateInAppNotificationId();
obj5.enqueueNotification(obj1);
const obj7 = isReactionMilestoneNotification;
}
}
}
function handleMessageCreate(message) {
message = message.message;
const sendMessageOptions = message.sendMessageOptions;
let prop;
if (sendMessageOptions != null) {
prop = sendMessageOptions.isHydratingExpiredPendingMessage;
}
if (prop) {
prop = message.state === constants2.SEND_FAILED;
}
if (prop) {
currentUser = currentUser.getCurrentUser();
let id;
if (currentUser != null) {
id = currentUser.id;
}
const author = message.author;
let id1;
if (author != null) {
id1 = author.id;
}
prop = id === id1;
}
if (prop) {
const _setTimeout = setTimeout;
const timerId = setTimeout(() => {
closure_1_10({ channelId: message.channel_id, messageId: message.id, shouldNotify: true });
}, 3000);
}
}
({ InAppNotificationTypes: error, MessageStates: closure_8 } = ME);
initializeDefault;
let prototype = function MessageSendFailureNotificationManager() {
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
applyArgumentsResult.actions = { MESSAGE_CREATE: handleMessageCreate, MESSAGE_SEND_FAILED: handleMessageSendFailure };
return applyArgumentsResult;
}.prototype;
class prototype extends tmp3 {
}
prototype = new prototype();
let result = require("set").fileFinishedImporting("modules/messages/native/MessageSendFailureNotificationManager.tsx");
export default prototype;