new plugin MentionAvatars: Shows user avatars inside mentions (#2691)

This commit is contained in:
vee 2024-07-13 19:14:22 +02:00 committed by GitHub
parent 0057ab42e8
commit 92ae62602b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 75 additions and 33 deletions

View file

@ -186,12 +186,10 @@ export default definePlugin({
// Avatar component used in User DMs "User Profile" popup in the right and Profiles Modal pfp
{
find: ".overlay:void 0,status:",
replacement: [
...[/"PRESS_VIEW_PROFILE".+?(?=children:)(?<=avatarSrc:(\i).+?)/, /avatarSrc:(\i),eventHandlers:(\i).+?"div",{...\2,/].map(match => ({
match,
replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openImage($1)},"
}))
]
replacement: {
match: /avatarSrc:(\i),eventHandlers:(\i).+?"div",{...\2,/,
replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openImage($1)},"
}
},
// Old Profiles Modal pfp
{