Skip to content

Commit

Permalink
USRBG: support new simplified profile (#2501)
Browse files Browse the repository at this point in the history
Co-authored-by: vee <vendicated@riseup.net>
  • Loading branch information
AutumnVN and Vendicated committed May 28, 2024
1 parent 5b35d7c commit 8131ca8
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/plugins/usrbg/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import style from "./index.css?managed";
const API_URL = "https://usrbg.is-hardly.online/users";

interface UsrbgApiReturn {
endpoint: string
bucket: string
prefix: string
users: Record<string, string>
endpoint: string;
bucket: string;
prefix: string;
users: Record<string, string>;
}

const settings = definePluginSettings({
Expand Down Expand Up @@ -73,6 +73,19 @@ export default definePlugin({
}
]
},
{
find: /overrideBannerSrc:\i,profileType:/,
replacement: [
{
match: /(\i)\.premiumType/,
replace: "$self.premiumHook($1)||$&"
},
{
match: /(?<=function \i\((\i)\)\{)(?=var.{30,50},overrideBannerSrc:)/,
replace: "$1.overrideBannerSrc=$self.useBannerHook($1);"
}
]
},
{
find: "\"data-selenium-video-tile\":",
predicate: () => settings.store.voiceBackground,
Expand Down Expand Up @@ -123,7 +136,7 @@ export default definePlugin({
return !!this.data?.users[userId];
},

getImageUrl(userId: string): string|null {
getImageUrl(userId: string): string | null {
if (!this.userHasBackground(userId)) return null;

// We can assert that data exists because userHasBackground returned true
Expand Down

0 comments on commit 8131ca8

Please sign in to comment.