no more mapMangledModule

This commit is contained in:
camila314 2023-11-25 17:13:19 -06:00
parent 5b647c307d
commit 59902a3729

View file

@ -21,7 +21,7 @@ const MenuHeader = findByCodeLazy("useInDesktopNotificationCenterExperiment)(");
const Popout = findByPropsLazy("ItemsPopout"); const Popout = findByPropsLazy("ItemsPopout");
const popoutClasses = findByPropsLazy("recentMentionsPopout"); const popoutClasses = findByPropsLazy("recentMentionsPopout");
const MessageObject = findByCodeLazy("}isFirstMessageInForumPost"); const MessageObject = findByCodeLazy("}isFirstMessageInForumPost");
const createMessageRecord = mapMangledModuleLazy("createMessageRecord:", {fn: filters.byCode("MessageTypes.THREAD_CREATED")}) const createMessageRecord = findByPropsLazy("createMessageRecord", "updateMessageRecord");
async function setRegexes(idx: number, reg: string) { async function setRegexes(idx: number, reg: string) {
@ -182,10 +182,10 @@ export default definePlugin({
}, },
addToLog(m) { addToLog(m) {
if (this.keywordLog.some((e) => e.id == m.id)) if (m == null || this.keywordLog.some((e) => e.id == m.id))
return; return;
let thing = createMessageRecord.fn(m); let thing = createMessageRecord.createMessageRecord(m);
this.keywordLog.push(thing); this.keywordLog.push(thing);
this.keywordLog.sort((a, b) => b.timestamp - a.timestamp); this.keywordLog.sort((a, b) => b.timestamp - a.timestamp);
@ -225,7 +225,6 @@ export default definePlugin({
}; };
let messageRender = (e, t) => { let messageRender = (e, t) => {
console.log("Message: ", e.content);
let msg = this.renderMsg({ let msg = this.renderMsg({
message: e, message: e,
gotoMessage: t, gotoMessage: t,