decord/alpha/source/modules/messages/isNewMessageGroup.tsx

148 lines
6.3 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 9583
// Function ID: 9584
2026-07-20 16:05:17 +00:00
// Name: isNewMessageGroup
2026-10-09 10:00:15 +00:00
// Dependencies: [1085, 1102, 6086, 11, 4752, 2]
2026-07-20 16:05:17 +00:00
// Exports: isNewGroupItem
2026-10-09 10:00:15 +00:00
// Module 9583 (isNewMessageGroup)
2026-10-03 08:58:59 +00:00
import DurationsDefault from "Durations" /* 1102 */;
2026-10-09 10:00:15 +00:00
import DateUtils from "DateUtils" /* 4752 */;
import isSystemMessageDefault from "isSystemMessage" /* 6086 */;
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let c3;
let closure_4;
let hasOwnProperty;
2026-07-20 16:05:17 +00:00
function isNewMessageGroup(isForumPost, content, hasFlag) {
2026-10-03 08:58:59 +00:00
const hasFlagResult = hasFlag.hasFlag(hasOwnProperty.HAS_THREAD);
const tmp3 = !hasFlagResult && !hasFlag.isCommandType();
2026-07-29 08:29:29 +00:00
let tmp4 = !tmp3;
if (tmp3) {
2026-10-03 08:58:59 +00:00
let tmp6 = content.blocked !== hasFlag.blocked || content.ignored !== hasFlag.ignored;
if (!tmp6) {
let tmp35;
if (hasFlag.type > constants.DEFAULT) {
const tmp38 = isSystemMessageDefault(content);
let tmp39 = !tmp38;
if (tmp38) {
tmp39 = hasFlag.type === tmp7.REPLY;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
tmp35 = tmp39;
2026-07-29 08:29:29 +00:00
} else {
2026-10-03 08:58:59 +00:00
tmp35 = isSystemMessageDefault(content);
const tmp40 = importDefault;
if (!tmp35) {
let tmp8 = content.author.id !== hasFlag.author.id;
if (!tmp8) {
const hasFlagResult1 = content.hasFlag(hasOwnProperty.EPHEMERAL);
let tmp10 = hasFlagResult1 !== hasFlag.hasFlag(tmp.EPHEMERAL);
if (!tmp10) {
const hasFlagResult2 = content.hasFlag(hasOwnProperty.IS_SCHEDULED);
let tmp12 = hasFlagResult2 !== hasFlag.hasFlag(tmp.IS_SCHEDULED);
if (!tmp12) {
let tmp14 = null != hasFlag.webhookId && content.author.username !== hasFlag.author.username;
if (!tmp14) {
2026-08-11 06:20:06 +00:00
let isForumPostResult;
if (isForumPost != null) {
isForumPostResult = isForumPost.isForumPost();
}
2026-10-03 08:58:59 +00:00
let tmp17 = !isForumPostResult;
2026-08-11 06:20:06 +00:00
if (isForumPostResult) {
2026-10-03 08:58:59 +00:00
const id = content.id;
2026-08-11 06:20:06 +00:00
const tmp40Result = tmp40(11);
2026-10-03 08:58:59 +00:00
tmp17 = id !== tmp40Result.castChannelIdAsMessageId(isForumPost.id);
2026-08-11 06:20:06 +00:00
}
2026-10-03 08:58:59 +00:00
let tmp18 = !tmp17;
if (tmp17) {
const obj2 = DateUtils;
const isSameDayResult = obj2.isSameDay(content.timestamp, hasFlag.timestamp);
let tmp21 = !isSameDayResult;
const tmp19 = require;
2026-08-11 06:20:06 +00:00
if (isSameDayResult) {
2026-10-09 10:00:15 +00:00
const tmp19Result = tmp19(4752);
2026-10-03 08:58:59 +00:00
const isWithinIntervalResult = tmp19Result.isWithinInterval(content.timestamp, hasFlag.timestamp, closure_6);
let tmp24 = !isWithinIntervalResult;
2026-08-11 06:20:06 +00:00
if (isWithinIntervalResult) {
2026-10-03 08:58:59 +00:00
const hasFlagResult3 = hasFlag.hasFlag(hasOwnProperty.SUPPRESS_NOTIFICATIONS);
2026-08-11 06:20:06 +00:00
let hasFlagResult4 = !hasFlagResult3;
if (hasFlagResult3) {
hasFlagResult4 = content.hasFlag(tmp.SUPPRESS_NOTIFICATIONS);
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
let tmp27 = !hasFlagResult4;
2026-08-11 06:20:06 +00:00
if (hasFlagResult4) {
2026-10-03 08:58:59 +00:00
const hasFlagResult5 = content.hasFlag(hasOwnProperty.SUPPRESS_NOTIFICATIONS);
2026-08-11 06:20:06 +00:00
let hasFlagResult6 = !hasFlagResult5;
if (hasFlagResult5) {
2026-10-03 08:58:59 +00:00
hasFlagResult6 = hasFlag.hasFlag(tmp.SUPPRESS_NOTIFICATIONS);
2026-08-11 06:20:06 +00:00
}
if (!hasFlagResult6) {
2026-10-03 08:58:59 +00:00
hasFlagResult6 = !(hasFlag.mentions.length > 0 || hasFlag.mentionRoles.length > 0 || hasFlag.mentionEveryone);
2026-08-11 06:20:06 +00:00
}
2026-10-03 08:58:59 +00:00
let tmp31 = !hasFlagResult6;
2026-08-11 06:20:06 +00:00
if (hasFlagResult6) {
2026-10-03 08:58:59 +00:00
let tmp32 = hasFlag.applicationId !== content.applicationId;
if (!tmp32) {
const additionalName = hasFlag.additionalName;
let tmp33 = null;
2026-08-11 06:20:06 +00:00
if (null != additionalName) {
2026-10-03 08:58:59 +00:00
tmp33 = null;
2026-08-11 06:20:06 +00:00
if ("" !== additionalName) {
2026-10-03 08:58:59 +00:00
tmp33 = additionalName;
2026-08-11 06:20:06 +00:00
}
2026-07-29 08:29:29 +00:00
}
2026-08-11 06:20:06 +00:00
const additionalName2 = content.additionalName;
2026-10-03 08:58:59 +00:00
let tmp34 = null;
2026-08-11 06:20:06 +00:00
if (null != additionalName2) {
2026-10-03 08:58:59 +00:00
tmp34 = null;
2026-08-11 06:20:06 +00:00
if ("" !== additionalName2) {
2026-10-03 08:58:59 +00:00
tmp34 = additionalName2;
2026-08-11 06:20:06 +00:00
}
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
tmp32 = tmp33 !== tmp34;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
tmp31 = tmp32;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
tmp27 = tmp31;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
tmp24 = tmp27;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp21 = tmp24;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp18 = tmp21;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp14 = tmp18;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp12 = tmp14;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp10 = tmp12;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp8 = tmp10;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp35 = tmp8;
2026-07-20 16:05:17 +00:00
}
}
2026-10-03 08:58:59 +00:00
tmp6 = tmp35;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp4 = tmp6;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp4;
2026-07-20 16:05:17 +00:00
}
({ MessageTypes: c3, ChannelStreamTypes: closure_4, MessageFlags: hasOwnProperty } = Constants);
let closure_6 = 7 * DurationsDefault.Millis.MINUTE;
const result = size.fileFinishedImporting("modules/messages/isNewMessageGroup.tsx");
2026-07-20 16:05:17 +00:00
export default isNewMessageGroup;
export const isNewGroupItem = function isNewGroupItem(isForumPost, type, hasFlag) {
let tmp = null == type;
if (!tmp) {
let tmp3 = type.type === constants2.MESSAGE && type.content.id === type.content.channel_id;
if (!tmp3) {
2026-10-03 08:58:59 +00:00
tmp3 = type.type !== tmp2.MESSAGE && type.type !== tmp2.THREAD_STARTER_MESSAGE || isNewMessageGroup(isForumPost, type.content, hasFlag);
const tmp4 = type.type !== tmp2.MESSAGE && type.type !== tmp2.THREAD_STARTER_MESSAGE || isNewMessageGroup(isForumPost, type.content, hasFlag);
2026-07-20 16:05:17 +00:00
}
tmp = tmp3;
}
return tmp;
};