decord/source/modules/messages/native/MessageSendFailureNotificationManager.tsx

98 lines
3.7 KiB
TypeScript
Raw Normal View History

2026-08-10 06:55:34 +00:00
// Module ID: 16903
// Function ID: 16904
2026-07-29 08:29:29 +00:00
// Name: handleMessageSendFailure
2026-08-10 06:55:34 +00:00
// Dependencies: [1960, 4124, 1903, 6876, 676, 12978, 9768, 9770, 10774, 1236, 5261, 2]
2026-07-20 16:05:17 +00:00
2026-08-10 06:55:34 +00:00
// Module 16903 (handleMessageSendFailure)
2026-07-29 08:29:29 +00:00
import handleConnectionOpen from "handleConnectionOpen";
import closure_4 from "handleConnectionOpen";
import mergeGuildAvatar from "mergeGuildAvatar";
import getState from "getState";
2026-07-23 10:11:24 +00:00
import ME from "ME";
import { LocalNotificationTypes } from "LocalNotificationTypes";
2026-07-29 08:29:29 +00:00
import "initialize";
2026-07-23 10:11:24 +00:00
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-20 16:05:17 +00:00
function handleMessageSendFailure(shouldNotify) {
let channelId;
let messageId;
({ channelId, messageId } = shouldNotify);
if (shouldNotify.shouldNotify) {
if ("active" !== state.getState()) {
2026-08-10 06:55:34 +00:00
let obj = importDefault(10774);
2026-07-29 08:29:29 +00:00
obj = { category: "local", alertTitle: null, alertBody: null, userInfo: null };
const intl = require(1236) /* getSystemLocale */.intl;
obj[1] = intl.string(require(1236) /* getSystemLocale */.t.LdlH2M);
const intl2 = require(1236) /* getSystemLocale */.intl;
obj[2] = intl2.string(require(1236) /* 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;
2026-07-20 16:05:17 +00:00
const result = obj.presentLocalNotification(obj);
} else if (channelId !== channelId.getChannelId(guildId.getGuildId())) {
2026-07-30 10:14:41 +00:00
const MESSAGE_FAILED_TO_SEND = constants.MESSAGE_FAILED_TO_SEND;
2026-08-10 06:55:34 +00:00
const notificationDuration = require(9768) /* extractMetadataFromNotification */.getNotificationDuration(MESSAGE_FAILED_TO_SEND);
const obj4 = require(9768) /* extractMetadataFromNotification */;
2026-07-30 10:14:41 +00:00
const obj1 = { type: null, channelId: null, messageId: null, key: null, duration: null, onDismiss: null, inAppNotificationId: null };
obj1[0] = MESSAGE_FAILED_TO_SEND;
2026-07-29 08:29:29 +00:00
obj1[1] = channelId;
obj1[2] = messageId;
obj1[3] = `${channelId}-${messageId}`;
2026-07-30 10:14:41 +00:00
obj1[4] = notificationDuration;
2026-07-29 08:29:29 +00:00
obj1[5] = function onDismiss() {
2026-07-30 10:14:41 +00:00
callback(table[7]).clearNotification();
2026-07-20 16:05:17 +00:00
};
2026-08-10 06:55:34 +00:00
const obj5 = importDefault(9770);
obj1[6] = require(9768) /* extractMetadataFromNotification */.generateInAppNotificationId();
2026-07-30 10:14:41 +00:00
obj5.enqueueNotification(obj1);
2026-08-10 06:55:34 +00:00
const obj7 = require(9768) /* extractMetadataFromNotification */;
2026-07-20 16:05:17 +00:00
}
}
}
function handleMessageCreate(message) {
message = message.message;
const sendMessageOptions = message.sendMessageOptions;
2026-07-29 08:29:29 +00:00
let prop;
if (sendMessageOptions != null) {
prop = sendMessageOptions.isHydratingExpiredPendingMessage;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (prop) {
prop = message.state === constants2.SEND_FAILED;
}
if (prop) {
2026-07-23 10:11:24 +00:00
currentUser = currentUser.getCurrentUser();
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (currentUser != null) {
2026-07-20 16:05:17 +00:00
id = currentUser.id;
}
const author = message.author;
let id1;
2026-07-29 08:29:29 +00:00
if (author != null) {
2026-07-20 16:05:17 +00:00
id1 = author.id;
}
2026-07-29 08:29:29 +00:00
prop = id === id1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (prop) {
2026-07-20 16:05:17 +00:00
const _setTimeout = setTimeout;
const timerId = setTimeout(() => {
2026-07-29 08:29:29 +00:00
outer1_10({ channelId: message.channel_id, messageId: message.id, shouldNotify: true });
2026-07-20 16:05:17 +00:00
}, 3000);
}
}
2026-07-29 08:29:29 +00:00
({ InAppNotificationTypes: error, MessageStates: metroImportAll } = ME);
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("mergeGuildAvatar").fileFinishedImporting("modules/messages/native/MessageSendFailureNotificationManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default prototype;