Skip to content

Commit

Permalink
MLv2 v1.8.29
Browse files Browse the repository at this point in the history
  • Loading branch information
1Lighty authored May 24, 2024
1 parent e648e4e commit 93f463d
Showing 1 changed file with 31 additions and 15 deletions.
46 changes: 31 additions & 15 deletions Plugins/MessageLoggerV2/MessageLoggerV2.plugin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @name MessageLoggerV2
* @version 1.8.28
* @version 1.8.29
* @invite NYvWdN5
* @donate https://paypal.me/lighty13
* @website https://1lighty.github.io/BetterDiscordStuff/?plugin=MessageLoggerV2
Expand Down Expand Up @@ -44,7 +44,7 @@ module.exports = class MessageLoggerV2 {
return 'MessageLoggerV2';
}
getVersion() {
return '1.8.28';
return '1.8.29';
}
getAuthor() {
return 'Lighty';
Expand Down Expand Up @@ -669,6 +669,20 @@ module.exports = class MessageLoggerV2 {

this.autoBackupSaveInterupts = 0;

// have to patch messageHasExpiredAttachmentUrl, otherwise Discord will needlessly reload the channel causing scrolling issues most likely
this.unpatches.push(
this.Patcher.instead(ZeresPluginLibrary.WebpackModules.getByProps('messageHasExpiredAttachmentUrl'), 'messageHasExpiredAttachmentUrl', (_, args, original) => {
const [message] = args;
// check if ID is in messageRecord and force return false
if (message.id && this.messageRecord[message.id]) return false;

// run original otherwise to not interfere
return original(...args);
})
);



this.dispatcher = ZeresPluginLibrary.WebpackModules.find(e => e.dispatch && e.subscribe);

this.unpatches.push(
Expand Down Expand Up @@ -3194,19 +3208,21 @@ module.exports = class MessageLoggerV2 {
hideOnClick: true
},
_ =>
ZeresPluginLibrary.DiscordModules.React.createElement(
'div',
{
..._,
className: XenoLib.joinClassNames({ [this.style.editedCompact]: props.compact && !isSingular, [this.style.edited]: !isSingular }),
editNum
},
parseContent({ channel_id: props.message.channel_id, mentionChannels: props.message.mentionChannels, content: edit.content, embeds: [], isCommandType: () => false, hasFlag: () => false }, {}).content,
noSuffix
? null
: ZeresPluginLibrary.DiscordModules.React.createElement(SuffixEdited, {
timestamp: new Date(edit.time)
})
ZeresPluginLibrary.DiscordModules.React.createElement(() =>
ZeresPluginLibrary.DiscordModules.React.createElement( // avoiding breaking the rules of react hooks :p
'div',
{
..._,
className: XenoLib.joinClassNames({ [this.style.editedCompact]: props.compact && !isSingular, [this.style.edited]: !isSingular }),
editNum
},
parseContent({ channel_id: props.message.channel_id, mentionChannels: props.message.mentionChannels, content: edit.content, embeds: [], isCommandType: () => false, hasFlag: () => false }, {}).content,
noSuffix
? null
: ZeresPluginLibrary.DiscordModules.React.createElement(SuffixEdited, {
timestamp: new Date(edit.time)
})
)
)
)
);
Expand Down

0 comments on commit 93f463d

Please sign in to comment.