From 72aa85f631dbabad41fae7cc63e549a8f8e2a1b9 Mon Sep 17 00:00:00 2001 From: Angelix1 Date: Thu, 8 Feb 2024 17:03:14 +0000 Subject: [PATCH] deploy: ef8f3f299ccc0d9e4422c5665dc901e1976f76c1 --- antied/index.js | 2 +- antied/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/antied/index.js b/antied/index.js index bade8e2..004f701 100644 --- a/antied/index.js +++ b/antied/index.js @@ -5,6 +5,6 @@ ${h}`),e.clipboard.setString(s),H.showToast("Log content copied")},style:L.text_ `;const fe=a?.message||T;let K=`${T?.content}`;if(!(t.storage===null||t.storage===void 0||(Me=t.storage.switches)===null||Me===void 0)&&Me.addTimestampForEdits){var nt;const he=Date.now(),re=``;K+=` (${re}) ${ee}${(a==null||(nt=a.message)===null||nt===void 0?void 0:nt.content)??""}`}else{var rt;K+=` ${ee}${(a==null||(rt=a.message)===null||rt===void 0?void 0:rt.content)??""}`}return r[0]={type:"MESSAGE_UPDATE",message:{...fe,content:K,guild_id:($e=W.getChannel(a?.channelId||(a==null||(xe=a.message)===null||xe===void 0?void 0:xe.channel_id)||T?.channel_id))===null||$e===void 0?void 0:$e.guild_id,edited_timestamp:"invalid_timestamp"}},t.storage.log.push({type:"MessageUpdate",author:{id:a==null||(Oe=a.message)===null||Oe===void 0||(Ue=Oe.author)===null||Ue===void 0?void 0:Ue.id,username:`${(a==null||(ze=a.message)===null||ze===void 0||(ke=ze.author)===null||ke===void 0?void 0:ke.discriminator)=="0"?`@${a==null||(Ge=a.message)===null||Ge===void 0||(Ve=Ge.author)===null||Ve===void 0?void 0:Ve.username}`:`${a==null||(Ye=a.message)===null||Ye===void 0||(He=Ye.author)===null||He===void 0?void 0:He.username}#${a==null||(We=a.message)===null||We===void 0||(Xe=We.author)===null||Xe===void 0?void 0:Xe.discriminator}`}`,avatar:a==null||(Je=a.message)===null||Je===void 0||(je=Je.author)===null||je===void 0?void 0:je.avatar,bot:a==null||(Qe=a.message)===null||Qe===void 0||(Ke=Qe.author)===null||Ke===void 0?void 0:Ke.bot},content:T?.content,edited:a==null||(qe=a.message)===null||qe===void 0?void 0:qe.content,where:{channel:a?.channelId||(a==null||(Ze=a.message)===null||Ze===void 0?void 0:Ze.channel_id)||T?.channel_id,guild:W==null||(et=W.getChannel(a?.channelId||(a==null||(tt=a.message)===null||tt===void 0?void 0:tt.channel_id)||T?.channel_id))===null||et===void 0?void 0:et.guild_id,messageLink:a==null||(at=a.message)===null||at===void 0?void 0:at.id}}),r}return r})}const Ra=v.findByProps("startEditMessage");function ya(){return B.before("startEditMessage",Ra,function(n){var r;let a=(t.storage===null||t.storage===void 0||(r=t.storage.inputs)===null||r===void 0?void 0:r.editedMessageBuffer)||"`[ EDITED ]`";a=a+` -`;const[f,u,E]=n,c=E.split(a);return n[2]=c[c.length-1],n})}const{DCDChatManager:ma}=e.ReactNative.NativeModules;function ba(n){return B.before("updateRows",ma,function(r){var a;let f=JSON.parse(r[1]);const{textColor:u,backgroundColor:E,backgroundColorAlpha:c,gutterColor:S,gutterColorAlpha:_}=t.storage.colors,R=(a=t.storage.inputs)===null||a===void 0?void 0:a.deletedMessageBuffer,{useBackgroundColor:w,minimalistic:d,removeDismissButton:y}=t.storage.switches;function h(l,b){l||(l=b);const m=l?.trim();if(m.startsWith("#")){const C=m.slice(1);if(/^[0-9A-Fa-f]{6}$/.test(C))return"#"+C.toUpperCase()}else if(/^[0-9A-Fa-f]{6}$/.test(m))return"#"+m.toUpperCase();return b||"#000"}function i(l,b){const m=b?.toString(),C=["text","heading","s","u","em","strong","list","blockQuote"];if(Array.isArray(l))return l.map(function(D){return i(D,m)});if(typeof l=="object"&&l!==null){const{content:D,type:o,target:I,items:F}=l;if(!C.includes(o))return l;if(o==="text"&&D&&D.length>=1)return{content:[{content:D,type:"text"}],target:"usernameOnClick",type:"link",context:{username:1,medium:!0,usernameOnClick:{action:"0",userId:"0",linkColor:e.ReactNative.processColor(m),messageChannelId:"0"}}};const M=i(D,m),$=F?F.map(i,m):void 0;if(M!==D||$!==F||!C.includes(o)){const A={...l,content:M};return o==="blockQuote"&&I&&(A.content=M,A.target=I),o==="list"&&A?.content&&delete A.content,F&&(A.items=$),A}}return l}function s(l,b,m){return l&&(b!=null&&(l.content[0].content[0].content=b+" "),m==null&&l.content[0].content.splice(1)),l}return f.forEach(function(l){if(l?.type==1){var b;if(n[l==null||(b=l.message)===null||b===void 0?void 0:b.id]){if((R?.length>0||R!="")&&(l.message.edited=R),d==!1){var m;const C=h(u,"#E40303"),D=i(l==null||(m=l.message)===null||m===void 0?void 0:m.content,C);l.message.content=D}if(y&&(l.message.ephemeralIndication=s(l.message.ephemeralIndication,void 0,void 0)),d==!1&&w==!0){const C=h(`${E}`,"#FF2C2F"),D=h(`${S}`,"#FF2C2F");l.backgroundHighlight??={},l.backgroundHighlight={backgroundColor:e.ReactNative.processColor(`${C}${c}`),gutterColor:e.ReactNative.processColor(`${D}${_}`)}}}}}),r[1]=JSON.stringify(f),r[1]})}const pa=v.findByProps("updateMessageRecord","createMessageRecord");function Sa(){return B.after("createMessageRecord",pa,function(n,r){let[a]=n;r.was_deleted=a.was_deleted})}const _a=v.findByName("MessageRecord",!1);function Ca(){return B.after("default",_a,function(n,r){let[a]=n;r.was_deleted=!!a.was_deleted})}const At=v.findByProps("updateMessageRecord","createMessageRecord");function Ia(){return B.instead("updateMessageRecord",At,function(n,r){let[a,f]=n;return f.was_deleted?At.createMessageRecord(f,a.reactions):r.apply(this,[a,f])})}const{FormSection:Aa}=P.Forms,wa=v.findByName("getScreens"),Da=v.findByName("UserSettingsOverviewWrapper",!1),Ta=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:N.semanticColors.BACKGROUND_MOBILE_PRIMARY}});function wt(n,r,a){const f=[],u=B.after("default",Da,function(E,c){u();const S=oe.findInReactTree(c.props.children,function(_){return _.type&&_.type.name==="UserSettingsOverview"});f.push(B.after("render",S.type.prototype,function(_,R){let{props:{children:w}}=R;const d=[e.i18n.Messages.BILLING_SETTINGS,e.i18n.Messages.PREMIUM_SETTINGS];w=oe.findInReactTree(w,function(h){return h.children[1].type===Aa}).children;const y=w.findIndex(function(h){return d.includes(h?.props.label)});n()&&w.splice(y===-1?4:y,0,r({}))}))},!0);if(f.push(u),wa&&a){const E=`VENDETTA_PLUGIN_${e.lodash.snakeCase(a.key).toUpperCase()}`,c=a.page.render,S=e.React.memo(function(d){let{navigation:y}=d;const h=y.addListener("focus",function(){h(),y.setOptions(oe.without(a.page,"noErrorBoundary","render"))});return e.React.createElement(e.ReactNative.View,{style:Ta.container},a.page.noErrorBoundary?e.React.createElement(c,null):e.React.createElement(P.ErrorBoundary,null,e.React.createElement(c,null)))}),_={[E]:{type:"route",title:function(){return a.title},icon:a.icon,parent:null,screen:{route:`VendettaPlugin${e.lodash.chain(a.key).camelCase().upperFirst().value()}`,getComponent:function(){return S}}}},R=function(d,y){var h,i;const s=[...d],l=y?s==null||(h=s[0])===null||h===void 0?void 0:h.sections:s;if(!Array.isArray(l))return l;const b="Vendetta",m=l.find(function(C){return C?.title===b||C?.label===b});return m&&!(!(m==null||(i=m.settings)===null||i===void 0)&&i.includes(E))&&m.settings.push(E),s},w=function(){const d=v.findByProps("useOverviewSettings"),y=v.findByProps("getSettingTitleConfig"),h=v.findByProps("SETTING_RELATIONSHIPS","SETTING_RENDERER_CONFIGS"),i="getSettingSearchListItems",s="getSettingListItems",l=v.findByProps(i),b=l?i:s,m=l??v.findByProps(s);if(!m||!d)return!1;f.push(B.after("useOverviewSettings",d,function(o,I){return R(I)})),f.push(B.after("getSettingTitleConfig",y,function(o,I){return{...I,[E]:a.title}})),f.push(B.after(b,m,function(o,I){let[F]=o;return[...F.includes(E)?[{type:"setting_search_result",ancestorRendererData:_[E],setting:E,title:function(){return a.title},breadcrumbs:["Vendetta"],icon:_[E].icon}]:[],...I]}));const C=h.SETTING_RELATIONSHIPS,D=h.SETTING_RENDERER_CONFIGS;return h.SETTING_RELATIONSHIPS={...C,[E]:null},h.SETTING_RENDERER_CONFIGS={...D,..._},f.push(function(){h.SETTING_RELATIONSHIPS=C,h.SETTING_RENDERER_CONFIGS=C}),!0};(function(){const d=v.findByProps("SearchableSettingsList"),y=v.findByProps("SETTING_RENDERER_CONFIG"),h=v.findByProps("getSettingListItems");if(!h||!d||!y)return!1;f.push(B.before("type",d.SearchableSettingsList,function(s){return R(s,!0)})),f.push(B.after("getSettingListSearchResultItems",h,function(s,l){for(const b of l)b.setting===E&&(b.breadcrumbs=["Vendetta"])}));const i=y.SETTING_RENDERER_CONFIG;return y.SETTING_RENDERER_CONFIG={...i,..._},f.push(function(){y.SETTING_RENDERER_CONFIG=i}),!0})()||w()}return function(){return f.forEach(function(E){return E()})}}const{FormRow:Ae}=P.Forms;function Na(){const n=e.NavigationNative.useNavigation();return React.createElement(P.ErrorBoundary,null,React.createElement(Ae,{label:"Antied",leading:React.createElement(Ae.Icon,{source:p.getAssetIDByName("ic_edit_24px")}),trailing:Ae.Arrow,onPress:function(){return n.push("VendettaCustomPage",{title:"Anti Edit & Delete Setting",render:Ie})}}))}const{FormRow:we}=P.Forms;function Fa(){const n=e.NavigationNative.useNavigation();return React.createElement(P.ErrorBoundary,null,React.createElement(we,{label:"Anti Edit & Delete Logs",leading:React.createElement(we.Icon,{source:p.getAssetIDByName("ic_edit_24px")}),trailing:we.Arrow,onPress:function(){return n.push("VendettaCustomPage",{title:"Anti Edit & Delete Logs",render:Ce})}}))}function La(){const n=[];return n.push(wt(function(){return!0},function(){return React.createElement(Na,null)},{key:Ee.plugin.manifest.name,icon:p.getAssetIDByName("ic_edit_24px"),title:"Anti Edit & Delete",page:{title:"Anti Edit & Delete",render:Ie}}),wt(function(){return!0},function(){return React.createElement(Fa,null)},{key:Ee.plugin.manifest.name,icon:p.getAssetIDByName("ic_message_delete"),title:"Anti Edit & Delete Logs",page:{title:"Anti Edit & Delete Logs",render:Ce}})),function(){return n.forEach(function(r){return r()})}}const Dt=v.findByProps("openLazy","hideActionSheet"),Pa=v.findByProps("getMessage","getMessages"),Ba=v.findByProps("getChannel","getDMFromUserId"),Tt=v.findByProps("_channelMessages"),{FormRow:Ma,FormIcon:$a}=P.Forms;Re(t.storage,{switches:{customizeable:!1,enableMD:!0,enableMU:!0,useBackgroundColor:!1,ignoreBots:!1,minimalistic:!0,alwaysAdd:!1,darkMode:!0,removeDismissButton:!1,addTimestampForEdits:!1,timestampStyle:"R"},colors:{textColor:"#E40303",backgroundColor:"#FF2C2F",backgroundColorAlpha:"33",gutterColor:"#FF2C2F",gutterColorAlpha:"CC"},inputs:{deletedMessageBuffer:"This message is deleted",editedMessageBuffer:"`[ EDITED ]`",historyToast:"History Removed",logLength:60,ignoredUserList:[]},log:[],logCount:1e3,logWarning:!1});let Nt=[],Ft={};var xa={onLoad:function(){Nt.push(La(),Ea(Ft),ba(Ft),ya(),Sa(),Ca(),Ia(),B.before("openLazy",Dt,function(n){let[r,a,f]=n;const u=f?.message;a!=="MessageLongPressActionSheet"||!u||r.then(function(E){const c=B.after("default",E,function(S,_){var R;e.React.useEffect(function(){return function(){c()}},[]);const w=oe.findInReactTree(_,function(i){var s,l;return(i==null||(l=i[0])===null||l===void 0||(s=l.type)===null||s===void 0?void 0:s.name)==="ButtonRow"});if(!w)return _;const d=Math.max(w.findIndex(function(i){var s,l;return(i==null||(s=i.props)===null||s===void 0?void 0:s.message)===(e.i18n===null||e.i18n===void 0||(l=e.i18n.Messages)===null||l===void 0?void 0:l.MESSAGE_ACTION_REPLY)}),0),y=Pa.getMessage(u.channel_id,u?.id),h=function(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}((t.storage===null||t.storage===void 0||(R=t.storage.inputs)===null||R===void 0?void 0:R.editedMessageBuffer)||"`[ EDITED ]`");if(new RegExp(h,"gmi").test(u.content)){const i=d||1;w.splice(i,0,e.React.createElement(Ma,{label:"Remove Edit History",leading:e.React.createElement($a,{style:{opacity:1},source:p.getAssetIDByName("ic_edit_24px")}),onPress:function(){var s,l,b,m,C,D;let o=(t.storage===null||t.storage===void 0||(s=t.storage.inputs)===null||s===void 0?void 0:s.editedMessageBuffer)||"`[ EDITED ]`";o=o+` +`;const[f,u,E]=n,c=E.split(a);return n[2]=c[c.length-1],n})}const{DCDChatManager:ma}=e.ReactNative.NativeModules;function ba(n){return B.before("updateRows",ma,function(r){var a;let f=JSON.parse(r[1]);const{textColor:u,backgroundColor:E,backgroundColorAlpha:c,gutterColor:S,gutterColorAlpha:_}=t.storage.colors,R=(a=t.storage.inputs)===null||a===void 0?void 0:a.deletedMessageBuffer,{useBackgroundColor:w,minimalistic:d,removeDismissButton:y}=t.storage.switches;function h(l,b){l||(l=b);const m=l?.trim();if(m.startsWith("#")){const C=m.slice(1);if(/^[0-9A-Fa-f]{6}$/.test(C))return"#"+C.toUpperCase()}else if(/^[0-9A-Fa-f]{6}$/.test(m))return"#"+m.toUpperCase();return b||"#000"}function i(l,b){const m=b?.toString(),C=["text","heading","s","u","em","strong","list","blockQuote"];if(Array.isArray(l))return l.map(function(D){return i(D,m)});if(typeof l=="object"&&l!==null){const{content:D,type:o,target:I,items:F}=l;if(!C.includes(o))return l;if(o==="text"&&D&&D.length>=1)return{content:[{content:D,type:"text"}],target:"usernameOnClick",type:"link",context:{username:1,medium:!0,usernameOnClick:{action:"0",userId:"0",linkColor:e.ReactNative.processColor(m),messageChannelId:"0"}}};const M=i(D,m),$=F?F.map(i,m):void 0;if(M!==D||$!==F||!C.includes(o)){const A={...l,content:M};return o==="blockQuote"&&I&&(A.content=M,A.target=I),o==="list"&&A?.content&&delete A.content,F&&(A.items=$),A}}return l}function s(l,b,m){return l&&(b!=null&&(l.content[0].content[0].content=b+" "),m==null&&l.content[0].content.splice(1)),l}return f.forEach(function(l){if(l?.type==1){var b;if(n[l==null||(b=l.message)===null||b===void 0?void 0:b.id]){if((R?.length>0||R!="")&&(l.message.edited=R),d==!1){var m;const C=h(u,"#E40303"),D=i(l==null||(m=l.message)===null||m===void 0?void 0:m.content,C);l.message.content=D}if(y&&(l.message.ephemeralIndication=s(l.message.ephemeralIndication,void 0,void 0)),d==!1&&w==!0){const C=h(`${E}`,"#FF2C2F"),D=h(`${S}`,"#FF2C2F");l.backgroundHighlight??={},l.backgroundHighlight={backgroundColor:e.ReactNative.processColor(`${C}${c}`),gutterColor:e.ReactNative.processColor(`${D}${_}`)}}}}}),r[1]=JSON.stringify(f),r[1]})}const pa=v.findByProps("updateMessageRecord","createMessageRecord");function Sa(){return B.after("createMessageRecord",pa,function(n,r){let[a]=n;r.was_deleted=a.was_deleted})}const _a=v.findByName("MessageRecord",!1);function Ca(){return B.after("default",_a,function(n,r){let[a]=n;r.was_deleted=!!a.was_deleted})}const At=v.findByProps("updateMessageRecord","createMessageRecord");function Ia(){return B.instead("updateMessageRecord",At,function(n,r){let[a,f]=n;return f.was_deleted?At.createMessageRecord(f,a.reactions):r.apply(this,[a,f])})}const{FormSection:Aa}=P.Forms,wa=v.findByName("getScreens"),Da=v.findByName("UserSettingsOverviewWrapper",!1),Ta=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:N.semanticColors.BACKGROUND_MOBILE_PRIMARY}});function wt(n,r,a){const f=[],u=B.after("default",Da,function(E,c){u();const S=oe.findInReactTree(c.props.children,function(_){return _.type&&_.type.name==="UserSettingsOverview"});f.push(B.after("render",S.type.prototype,function(_,R){let{props:{children:w}}=R;const d=[e.i18n.Messages.BILLING_SETTINGS,e.i18n.Messages.PREMIUM_SETTINGS];w=oe.findInReactTree(w,function(h){return h.children[1].type===Aa}).children;const y=w.findIndex(function(h){return d.includes(h?.props.label)});n()&&w.splice(y===-1?4:y,0,r({}))}))},!0);if(f.push(u),wa&&a){const E=`VENDETTA_PLUGIN_${e.lodash.snakeCase(a.key).toUpperCase()}`,c=a.page.render,S=e.React.memo(function(d){let{navigation:y}=d;const h=y.addListener("focus",function(){h(),y.setOptions(oe.without(a.page,"noErrorBoundary","render"))});return e.React.createElement(e.ReactNative.View,{style:Ta.container},a.page.noErrorBoundary?e.React.createElement(c,null):e.React.createElement(P.ErrorBoundary,null,e.React.createElement(c,null)))}),_={[E]:{type:"route",title:function(){return a.title},icon:a.icon,parent:null,screen:{route:`VendettaPlugin${e.lodash.chain(a.key).camelCase().upperFirst().value()}`,getComponent:function(){return S}}}},R=function(d,y){var h,i;const s=[...d],l=y?s==null||(h=s[0])===null||h===void 0?void 0:h.sections:s;if(!Array.isArray(l))return l;const b="Vendetta",m=l.find(function(C){return C?.title===b||C?.label===b});return m&&!(!(m==null||(i=m.settings)===null||i===void 0)&&i.includes(E))&&m.settings.push(E),s},w=function(){const d=v.findByProps("useOverviewSettings"),y=v.findByProps("getSettingTitleConfig"),h=v.findByProps("SETTING_RELATIONSHIPS","SETTING_RENDERER_CONFIGS"),i="getSettingSearchListItems",s="getSettingListItems",l=v.findByProps(i),b=l?i:s,m=l??v.findByProps(s);if(!m||!d)return!1;f.push(B.after("useOverviewSettings",d,function(o,I){return R(I)})),f.push(B.after("getSettingTitleConfig",y,function(o,I){return{...I,[E]:a.title}})),f.push(B.after(b,m,function(o,I){let[F]=o;return[...F.includes(E)?[{type:"setting_search_result",ancestorRendererData:_[E],setting:E,title:function(){return a.title},breadcrumbs:["Vendetta"],icon:_[E].icon}]:[],...I]}));const C=h.SETTING_RELATIONSHIPS,D=h.SETTING_RENDERER_CONFIGS;return h.SETTING_RELATIONSHIPS={...C,[E]:null},h.SETTING_RENDERER_CONFIGS={...D,..._},f.push(function(){h.SETTING_RELATIONSHIPS=C,h.SETTING_RENDERER_CONFIGS=C}),!0};(function(){const d=v.findByProps("SearchableSettingsList"),y=v.findByProps("SETTING_RENDERER_CONFIG"),h=v.findByProps("getSettingListItems");if(!h||!d||!y)return!1;f.push(B.before("type",d.SearchableSettingsList,function(s){return R(s,!0)})),f.push(B.after("getSettingListSearchResultItems",h,function(s,l){for(const b of l)b.setting===E&&(b.breadcrumbs=["Vendetta"])}));const i=y.SETTING_RENDERER_CONFIG;return y.SETTING_RENDERER_CONFIG={...i,..._},f.push(function(){y.SETTING_RENDERER_CONFIG=i}),!0})()||w()}return function(){return f.forEach(function(E){return E()})}}const{FormRow:Ae}=P.Forms;function Na(){const n=e.NavigationNative.useNavigation();return React.createElement(P.ErrorBoundary,null,React.createElement(Ae,{label:"Antied",leading:React.createElement(Ae.Icon,{source:p.getAssetIDByName("ic_edit_24px")}),trailing:Ae.Arrow,onPress:function(){return n.push("VendettaCustomPage",{title:"Anti Edit & Delete Setting",render:Ie})}}))}const{FormRow:we}=P.Forms;function Fa(){const n=e.NavigationNative.useNavigation();return React.createElement(P.ErrorBoundary,null,React.createElement(we,{label:"Anti Edit & Delete Logs",leading:React.createElement(we.Icon,{source:p.getAssetIDByName("ic_edit_24px")}),trailing:we.Arrow,onPress:function(){return n.push("VendettaCustomPage",{title:"Anti Edit & Delete Logs",render:Ce})}}))}function La(){const n=[];return n.push(wt(function(){return!0},function(){return React.createElement(Na,null)},{key:Ee.plugin.manifest.name,icon:p.getAssetIDByName("ic_edit_24px"),title:"Anti Edit & Delete",page:{title:"Anti Edit & Delete",render:Ie}}),wt(function(){return!0},function(){return React.createElement(Fa,null)},{key:Ee.plugin.manifest.name,icon:p.getAssetIDByName("ic_message_delete"),title:"Anti Edit & Delete Logs",page:{title:"Anti Edit & Delete Logs",render:Ce}})),function(){return n.forEach(function(r){return r()})}}const Dt=v.findByProps("openLazy","hideActionSheet"),Pa=v.findByProps("getMessage","getMessages"),Ba=v.findByProps("getChannel","getDMFromUserId"),Tt=v.findByProps("_channelMessages"),{FormRow:Ma,FormIcon:$a}=P.Forms;Re(t.storage,{switches:{customizeable:!1,enableMD:!0,enableMU:!0,useBackgroundColor:!1,ignoreBots:!1,minimalistic:!0,alwaysAdd:!1,darkMode:!0,removeDismissButton:!1,addTimestampForEdits:!1,timestampStyle:"R"},colors:{textColor:"#E40303",backgroundColor:"#FF2C2F",backgroundColorAlpha:"33",gutterColor:"#FF2C2F",gutterColorAlpha:"CC"},inputs:{deletedMessageBuffer:"This message is deleted",editedMessageBuffer:"`[ EDITED ]`",historyToast:"History Removed",logLength:60,logCount:1e3,ignoredUserList:[]},log:[],logWarning:!1});let Nt=[],Ft={};var xa={onLoad:function(){Nt.push(La(),Ea(Ft),ba(Ft),ya(),Sa(),Ca(),Ia(),B.before("openLazy",Dt,function(n){let[r,a,f]=n;const u=f?.message;a!=="MessageLongPressActionSheet"||!u||r.then(function(E){const c=B.after("default",E,function(S,_){var R;e.React.useEffect(function(){return function(){c()}},[]);const w=oe.findInReactTree(_,function(i){var s,l;return(i==null||(l=i[0])===null||l===void 0||(s=l.type)===null||s===void 0?void 0:s.name)==="ButtonRow"});if(!w)return _;const d=Math.max(w.findIndex(function(i){var s,l;return(i==null||(s=i.props)===null||s===void 0?void 0:s.message)===(e.i18n===null||e.i18n===void 0||(l=e.i18n.Messages)===null||l===void 0?void 0:l.MESSAGE_ACTION_REPLY)}),0),y=Pa.getMessage(u.channel_id,u?.id),h=function(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}((t.storage===null||t.storage===void 0||(R=t.storage.inputs)===null||R===void 0?void 0:R.editedMessageBuffer)||"`[ EDITED ]`");if(new RegExp(h,"gmi").test(u.content)){const i=d||1;w.splice(i,0,e.React.createElement(Ma,{label:"Remove Edit History",leading:e.React.createElement($a,{style:{opacity:1},source:p.getAssetIDByName("ic_edit_24px")}),onPress:function(){var s,l,b,m,C,D;let o=(t.storage===null||t.storage===void 0||(s=t.storage.inputs)===null||s===void 0?void 0:s.editedMessageBuffer)||"`[ EDITED ]`";o=o+` `;const I=u==null||(l=u.content)===null||l===void 0?void 0:l.split(o),F=I[I.length-1],M=u==null||(b=u.embeds)===null||b===void 0?void 0:b.map(function(A){var V,j,J;const ae=A==null||(J=A.color)===null||J===void 0||(j=J.replace(/.+\(/,""))===null||j===void 0||(V=j.replace(/\%/g,""))===null||V===void 0?void 0:V.replace(")",""),G=ae?.split(", "),ne=e.ReactNative.processColor(`${ct(ie.HSLtoHEX(G[0],G[1],G[2]),G[3])}`);return{...A,author:A.author,title:A.rawTitle,description:A.rawDescription,url:A.url,type:A.type,image:A.image,thumbnail:A.thumbnail,color:ne,content_scan_version:1}});if(e.FluxDispatcher.dispatch({type:"MESSAGE_UPDATE",message:{...u,content:`${F}`,embeds:M??[],attachments:u.attachments??[],mentions:u.mentions??[],guild_id:Ba.getChannel(y.channel_id).guild_id},otherPluginBypass:!0}),Dt.hideActionSheet(),(t.storage===null||t.storage===void 0||(C=t.storage.inputs)===null||C===void 0||(m=C.historyToast)===null||m===void 0?void 0:m.length)>0||(t.storage===null||t.storage===void 0||(D=t.storage.inputs)===null||D===void 0?void 0:D.historyToast)!=""){var $;H.showToast(`[ANTI ED] ${t.storage===null||t.storage===void 0||($=t.storage.inputs)===null||$===void 0?void 0:$.historyToast}`,p.getAssetIDByName("ic_edit_24px"))}}}))}})})}))},onUnload:function(){for(const n of Nt)n();for(const n in Tt._channelMessages)for(const r of Tt._channelMessages[n]._array)r.was_deleted&&e.FluxDispatcher.dispatch({type:"MESSAGE_DELETE",id:r.id,channelId:r.channel_id,otherPluginBypass:!0})},settings:Ie};return ve.default=xa,Object.defineProperty(ve,"__esModule",{value:!0}),ve})({},vendetta,vendetta.metro,vendetta.plugin,vendetta.storage,vendetta.ui.components,vendetta.ui.assets,vendetta.metro.common,vendetta.ui,vendetta.ui.toasts,vendetta.ui.alerts,vendetta.patcher,vendetta.utils); diff --git a/antied/manifest.json b/antied/manifest.json index 0fe6786..7bc3247 100644 --- a/antied/manifest.json +++ b/antied/manifest.json @@ -1 +1 @@ -{"name":"Anti [Edit|Delete] v1.0.0","description":"Keeps deleted messages and logs edited messages, until you restart/reloads the app","authors":[{"name":"Angelica","id":"692632336961110087"}],"main":"index.js","vendetta":{"icon":"ic_edit_24px"},"hash":"0a6da0722dc36c51c7a5400eeb6f269eb3b262e9116c864310043581033765d2"} \ No newline at end of file +{"name":"Anti [Edit|Delete] v1.0.0","description":"Keeps deleted messages and logs edited messages, until you restart/reloads the app","authors":[{"name":"Angelica","id":"692632336961110087"}],"main":"index.js","vendetta":{"icon":"ic_edit_24px"},"hash":"b03682da70c3530b3e2f884f993fde2a8e93188cfcfecbf4538f2dbc816bf7fc"} \ No newline at end of file