1 line
3.1 KiB
JavaScript
1 line
3.1 KiB
JavaScript
(function(c,y,f,b,e,v,s,x){"use strict";function F(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function g(a,n,r){return n in a?Object.defineProperty(a,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[n]=r,a}const R=f.findByStoreName("UserStore"),{ScrollView:w,TouchableOpacity:o,Image:I,FlatList:m}=e.ReactNative,{FormInput:N,FormDivider:p,FormText:S,FormIcon:u,FormRow:h,FormSection:k,FormSwitchRow:B}=x.Forms,E=e.stylesheet.createThemedStyleSheet({avatar:{height:36,width:36,borderRadius:18},button:{marginRight:12}});function P(a){let{callback:n}=a;return e.React.createElement(o,{onPress:n},e.React.createElement(S,{style:E.button},"ADD"))}function U(a){let{onFinish:n}=a;const[r,i]=e.React.useState(""),d=function(){!isNaN(parseInt(r))&&R.getUser(r)&&!t.exempted.includes(r)&&(t.exempted=[...t.exempted,r],i("")),n()};return e.React.createElement(h,{leading:e.React.createElement(u,{source:s.getAssetIDByName("ic_add_friend")}),label:e.React.createElement(N,{autoFocus:!0,title:"User ID",placeholder:"123456789012345678",value:r,keyboardType:"numeric",onChangeText:function(l){return i(l.replace(/[^0-9]/g,"").trim())},returnKeyType:"done"}),trailing:e.React.createElement(o,{onPress:d},e.React.createElement(u,{source:s.getAssetIDByName("ic_add_24px")}))})}function _(){v.useProxy(t);const[a,n]=e.React.useState(!1),r=e.NavigationNative.useNavigation();return e.React.useEffect(function(){r.setOptions({headerRight:function(){return e.React.createElement(P,{callback:function(){return n(!0)}})}})},[]),e.React.createElement(w,null,e.React.createElement(B,{label:"Enable blacklist mode",subLabel:"If enabled, only users in the exempted list will be affected by the plugin.",leading:e.React.createElement(u,{source:s.getAssetIDByName("ic_block")}),value:t.isBlacklistMode,onValueChange:function(i){return t.isBlacklistMode=i}}),e.React.createElement(k,{title:"Exempted Users"},t.exempted?.length>0&&e.React.createElement(m,{data:t.exempted,keyExtractor:function(i){return i},renderItem:function(i){let{item:d}=i;const l=R.getUser(d);if(!l)throw new Error("User not found/is not cached");return e.React.createElement(h,{label:l.username,leading:e.React.createElement(I,{style:E.avatar,source:{uri:l.getAvatarURL()}}),trailing:e.React.createElement(o,{onPress:function(){t.exempted=t.exempted.filter(function(A){return A!==d})}},e.React.createElement(u,{source:s.getAssetIDByName("Small"),disableColor:!0}))})},ItemSeparatorComponent:p}),a&&e.React.createElement(e.React.Fragment,null,e.React.createElement(p,null),e.React.createElement(U,{onFinish:function(){return n(!1)}}))))}const t=b.storage,D=f.findByProps("createPendingReply");t.isBlacklistMode??=!1,t.exempted??=[];var T=new function a(){F(this,a),g(this,"settings",_),g(this,"onUnload",y.patcher.before("createPendingReply",D,function(n){let[r]=n;const i=t.exempted.includes(r.message?.author?.id);r.shouldMention&&=t.isBlacklistMode?!i:i}))};return c.default=T,c.settings=t,Object.defineProperty(c,"__esModule",{value:!0}),c})({},vendetta,vendetta.metro,vendetta.plugin,vendetta.metro.common,vendetta.storage,vendetta.ui.assets,vendetta.ui.components);
|