Fixes InAppNotifications not working due to missing raw message module #398
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Hooks onto the
s(e)
function. I'm not that versed with the BD API, but I looked through the webpack and found that the following filters returned the appropriate function that fixed InAppNotifications for me. I haven't experienced any issues (yet), so I would appreciate it if someone else could also test this just to confirm things are in fact working for everyone.New hook:
Webpack.getModule(Webpack.Filters.byStrings("userId", "channelId", "mentionEveryone", "mentionUsers", "mentionRoles", "suppressEveryone", "suppressRoles"), { searchExports: true });
Additional Information
As I said, I'm not too familiar with hooking into functions so I wasn't sure how to make it such that I retrieve the parent function such that
SomethingHereShrug
changes fromisMentioned.isRawMessageMentioned
=>isRawMessageMentioned
, but I guess this PR works fine too albeit no proper#isRawMessageMentioned
definition via the parent (if that makes sense).Other potential hits:
Webpack.getModules(Webpack.Filters.byStrings("userId", "channelId", "mentionEveryone", "mentionUsers", "mentionRoles", "suppressEveryone", "suppressRoles"), { searchExports: true });
The workaround in #397 works just fine, but I figured I would take a shot at looking into the webpack to see if I can find the hook again after reading the comments mentioning how
isRawMessageMentioned
may have been removed. I thought by calling it directly there would be some performance increase albeit negligible, but it seems like both the workaround and directly calling is essentially the same judging by thel
function. Nonetheless, again, the performance is probably negligible.