Skip to content

Commit c4d0b92

Browse files
authored
Merge pull request #13 from Vendicated/main
Bug fixes
2 parents 46fc837 + 9de18ac commit c4d0b92

File tree

11 files changed

+92
-230
lines changed

11 files changed

+92
-230
lines changed

src/plugins/_api/badges/index.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,13 @@ export default definePlugin({
9393
{
9494
find: ".PANEL]:14",
9595
replacement: {
96-
match: /(?<=\i=\(0,\i\.default\)\(\i\);)return 0===\i.length/,
97-
replace: "$& && $self.getBadges(arguments[0]?.displayProfile).length===0"
96+
match: /(?<=(\i)=\(0,\i\.default\)\(\i\);)return 0===\i.length\?/,
97+
replace: "$1.unshift(...$self.getBadges(arguments[0].displayProfile));$&"
9898
}
9999
},
100100
{
101101
find: ".description,delay:",
102102
replacement: [
103-
{
104-
match: /...(\i)\}=\(0,\i\.useUserProfileAnalyticsContext\)\(\);/,
105-
replace: "$&arguments[0].badges?.unshift(...$self.getBadges($1));"
106-
},
107103
{
108104
// alt: "", aria-hidden: false, src: originalSrc
109105
match: /alt:" ","aria-hidden":!0,src:(?=.{0,20}(\i)\.icon)/,

src/plugins/_core/settings.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export default definePlugin({
6060
// FIXME: remove once change merged to stable
6161
{
6262
find: "Messages.ACTIVITY_SETTINGS",
63+
noWarn: true,
6364
replacement: {
6465
get match() {
6566
switch (Settings.plugins.Settings.settingsLocation) {

src/plugins/experiments/index.tsx

+23-1
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,29 @@
1616
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*/
1818

19+
import { definePluginSettings } from "@api/Settings";
1920
import { disableStyle, enableStyle } from "@api/Styles";
2021
import ErrorBoundary from "@components/ErrorBoundary";
2122
import { ErrorCard } from "@components/ErrorCard";
2223
import { Devs } from "@utils/constants";
2324
import { Margins } from "@utils/margins";
24-
import definePlugin from "@utils/types";
25+
import definePlugin, { OptionType } from "@utils/types";
2526
import { findByPropsLazy } from "@webpack";
2627
import { Forms, React } from "@webpack/common";
2728

2829
import hideBugReport from "./hideBugReport.css?managed";
2930

3031
const KbdStyles = findByPropsLazy("key", "removeBuildOverride");
3132

33+
const settings = definePluginSettings({
34+
toolbarDevMenu: {
35+
type: OptionType.BOOLEAN,
36+
description: "Change the Help (?) toolbar button (top right in chat) to Discord's developer menu",
37+
default: false,
38+
restartNeeded: true
39+
}
40+
});
41+
3242
export default definePlugin({
3343
name: "Experiments",
3444
description: "Enable Access to Experiments & other dev-only features in Discord!",
@@ -40,6 +50,8 @@ export default definePlugin({
4050
Devs.Nuckyz
4151
],
4252

53+
settings,
54+
4355
patches: [
4456
{
4557
find: "Object.defineProperties(this,{isDeveloper",
@@ -68,6 +80,16 @@ export default definePlugin({
6880
replacement: {
6981
match: /\i\.isStaff\(\)/,
7082
replace: "true"
83+
},
84+
predicate: () => settings.store.toolbarDevMenu
85+
},
86+
87+
// makes the Favourites Server experiment allow favouriting DMs and threads
88+
{
89+
find: "useCanFavoriteChannel",
90+
replacement: {
91+
match: /!\(\i\.isDM\(\)\|\|\i\.isThread\(\)\)/,
92+
replace: "true",
7193
}
7294
}
7395
],

src/plugins/messageLogger/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ export default definePlugin({
302302
replace: "$1" +
303303
".update($3,m =>" +
304304
" (($2.message.flags & 64) === 64 || $self.shouldIgnore($2.message, true)) ? m :" +
305-
" $2.message.content !== m.editHistory?.[0]?.content && $2.message.content !== m.content ?" +
305+
" $2.message.edited_timestamp && $2.message.content !== m.content ?" +
306306
" m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($2.message, m)]) :" +
307307
" m" +
308308
")" +

src/plugins/resurrectHome/README.md

-5
This file was deleted.

src/plugins/resurrectHome/index.tsx

-195
This file was deleted.

src/plugins/roleColorEverywhere/index.tsx

+15
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,16 @@ const settings = definePluginSettings({
4040
default: true,
4141
description: "Show role colors in the voice chat user list",
4242
restartNeeded: true
43+
},
44+
reactorsList: {
45+
type: OptionType.BOOLEAN,
46+
default: true,
47+
description: "Show role colors in the reactors list",
48+
restartNeeded: true
4349
}
4450
});
4551

52+
4653
export default definePlugin({
4754
name: "RoleColorEverywhere",
4855
authors: [Devs.KingFish, Devs.lewisakura, Devs.AutumnVN],
@@ -99,6 +106,14 @@ export default definePlugin({
99106
}
100107
],
101108
predicate: () => settings.store.voiceUsers,
109+
},
110+
{
111+
find: ".reactorDefault",
112+
replacement: {
113+
match: /\.openUserContextMenu\)\((\i),(\i),\i\).{0,250}tag:"strong"/,
114+
replace: "$&,style:{color:$self.getColor($2?.id,$1)}"
115+
},
116+
predicate: () => settings.store.reactorsList,
102117
}
103118
],
104119
settings,

0 commit comments

Comments
 (0)