diff --git a/picture-links/index.js b/picture-links/index.js index ed2d41e..d891347 100644 --- a/picture-links/index.js +++ b/picture-links/index.js @@ -1 +1 @@ -(function(m,a,s,B){"use strict";const{Pressable:f}=a.findByProps("Button","Text","View"),I=a.findByName("ProfileBanner",!1),E=a.findByName("HeaderAvatar",!1),{openMediaModal:P}=a.findByProps("openMediaModal"),{hideActionSheet:S}=a.findByProps("hideActionSheet"),{getChannelId:b}=a.findByStoreName("SelectedChannelStore"),{getGuildId:R}=a.findByStoreName("SelectedGuildStore");function $(r){return new Promise(function(t,e){B.ReactNative.Image.getSize(r,function(i,n){return t({width:i,height:n})},function(i){return e(i)})})}async function c(r,t){const{width:e,height:i}=await $(r);S(),P({initialSources:[{uri:r,sourceURI:r,width:e,height:i,guildId:R(),channelId:b()}],initialIndex:0,originLayout:{width:0,height:0,x:t.pageX,y:t.pageY,resizeMode:"fill"}})}const w=s.after("default",E,function(r,t){let[{user:e,style:i,guildId:n}]=r;var o,d,l,u="png";!((o=e.guildMemberAvatars)===null||o===void 0)&&o[n].includes("a_")&&(u="gif");const v=((d=e.guildMemberAvatars)===null||d===void 0?void 0:d[n])&&`https://cdn.discordapp.com/guilds/${n}/users/${e.id}/avatars/${e.guildMemberAvatars[n]}.${u}?size=4096`,g=e==null||(l=e.getAvatarURL)===null||l===void 0?void 0:l.call(e,!1,4096,!0);if(!g)return t;const M=typeof g=="number"?`https://cdn.discordapp.com/embed/avatars/${Number(BigInt(e.id)>>22n)%6}.png`:g?.replace(".webp",".png");return delete t.props.style,React.createElement(f,{onPress:function(h){let{nativeEvent:y}=h;return c(M,y)},onLongPress:function(h){let{nativeEvent:y}=h;return v&&c(v,y)},style:i},t)}),z=s.after("default",I,function(r,t){let[{bannerSource:e}]=r;if(typeof e?.uri!="string"||!t)return t;const i=e.uri.replace(/(?:\?size=\d{3,4})?$/,"?size=4096").replace(".webp",".png");return React.createElement(f,{onPress:function(n){let{nativeEvent:o}=n;return c(i,o)}},t)});var p;if(typeof a.findByName("GuildIcon").prototype.render<"u"){const r=a.findByName("GuildIcon");p=s.after("render",r.prototype,function(t,e){var i,n,o,d;if(((i=this.props)===null||i===void 0?void 0:i.size)!=="XLARGE")return;const l=(d=this.props)===null||d===void 0||(o=d.guild)===null||o===void 0||(n=o.getIconURL)===null||n===void 0?void 0:n.call(o,4096);return l?React.createElement(f,{onPress:function(u){let{nativeEvent:v}=u;return c(l,v)}},e):e})}else{const r=a.findByName("GuildIcon",!1);p=s.after("default",r,function(t,e){let[{size:i,guild:n}]=t;if(i!=="XLARGE"||n?.icon==null)return;var o="png";n?.icon.includes("a_")&&(o="gif");const d=`https://cdn.discordapp.com/icons/${n?.id}/${n?.icon}.${o}?size=4096`;return React.createElement(f,{onPress:function(l){let{nativeEvent:u}=l;return c(d,u)}},e)})}function A(){w(),z(),p()}return m.onUnload=A,m})({},vendetta.metro,vendetta.patcher,vendetta.metro.common); +(function(y,d,s,m){"use strict";const{Pressable:f}=d.findByProps("Button","Text","View"),B=d.findByName("ProfileBanner",!1),I=d.findByName("HeaderAvatar",!1),{openMediaModal:E}=d.findByProps("openMediaModal"),{hideActionSheet:P}=d.findByProps("hideActionSheet"),{getChannelId:S}=d.findByStoreName("SelectedChannelStore"),{getGuildId:R}=d.findByStoreName("SelectedGuildStore");function b(r){return new Promise(function(t,e){m.ReactNative.Image.getSize(r,function(i,n){return t({width:i,height:n})},function(i){return e(i)})})}async function c(r,t){const{width:e,height:i}=await b(r);P(),E({initialSources:[{uri:r,sourceURI:r,width:e,height:i,guildId:R(),channelId:S()}],initialIndex:0,originLayout:{width:0,height:0,x:t.pageX,y:t.pageY,resizeMode:"fill"}})}const w=s.after("default",I,function(r,t){let[{user:e,style:i,guildId:n}]=r;var o,a;const l=((o=e.guildMemberAvatars)===null||o===void 0?void 0:o[n])&&`https://cdn.discordapp.com/guilds/${n}/users/${e.id}/avatars/${e.guildMemberAvatars[n]}.png?size=4096`,u=e==null||(a=e.getAvatarURL)===null||a===void 0?void 0:a.call(e,!1,4096,!0);if(!u)return t;const v=typeof u=="number"?`https://cdn.discordapp.com/embed/avatars/${Number(BigInt(e.id)>>22n)%6}.png`:u?.replace(".webp",".png");return delete t.props.style,React.createElement(f,{onPress:function(g){let{nativeEvent:h}=g;return c(v,h)},onLongPress:function(g){let{nativeEvent:h}=g;return l&&c(l,h)},style:i},t)}),z=s.after("default",B,function(r,t){let[{bannerSource:e}]=r;if(typeof e?.uri!="string"||!t)return t;const i=e.uri.replace(/(?:\?size=\d{3,4})?$/,"?size=4096").replace(".webp",".png");return React.createElement(f,{onPress:function(n){let{nativeEvent:o}=n;return c(i,o)}},t)});var p;if(typeof d.findByName("GuildIcon").prototype.render<"u"){const r=d.findByName("GuildIcon");p=s.after("render",r.prototype,function(t,e){var i,n,o,a;if(((i=this.props)===null||i===void 0?void 0:i.size)!=="XLARGE")return;const l=(a=this.props)===null||a===void 0||(o=a.guild)===null||o===void 0||(n=o.getIconURL)===null||n===void 0?void 0:n.call(o,4096);return l?React.createElement(f,{onPress:function(u){let{nativeEvent:v}=u;return c(l,v)}},e):e})}else{const r=d.findByName("GuildIcon",!1);p=s.after("default",r,function(t,e){let[{size:i,guild:n}]=t;if(i!=="XLARGE"||n?.icon==null)return;var o="png";n?.icon.includes("a_")&&(o="gif");const a=`https://cdn.discordapp.com/icons/${n?.id}/${n?.icon}.${o}?size=4096`;return React.createElement(f,{onPress:function(l){let{nativeEvent:u}=l;return c(a,u)}},e)})}function A(){w(),z(),p()}return y.onUnload=A,y})({},vendetta.metro,vendetta.patcher,vendetta.metro.common); diff --git a/picture-links/manifest.json b/picture-links/manifest.json index 02e35f7..831c5e2 100644 --- a/picture-links/manifest.json +++ b/picture-links/manifest.json @@ -1 +1 @@ -{"name":"Picture Links","description":"Allows you to click on profile pictures and banners.","authors":[{"name":"redstonekasi","id":"265064055490871297"},{"name":"Rico040","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"ic_link"},"hash":"807aaab06e0310a576ead7ee6456bd2bf1b83d3e787221665c194c61e9a51fe3"} \ No newline at end of file +{"name":"Picture Links","description":"Allows you to click on profile pictures and banners.","authors":[{"name":"redstonekasi","id":"265064055490871297"},{"name":"Rico040","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"ic_link"},"hash":"1ac9a01662f047d2157d2517d35dc656209df98deea1a75b016e118b3d1e1cb2"} \ No newline at end of file