@@ -58,7 +58,7 @@ def cbMuteAdd(self, to, auth_address, cert_user_id, reason):
5858 def actionMuteAdd (self , to , auth_address , cert_user_id , reason ):
5959 self .cmd (
6060 "prompt" ,
61- [_ ["Hide all content from <b>%s</b>?" ] % html .escape (cert_user_id ), reason , _ ["Mute" ]],
61+ [_ ["Remove all content from <b>%s</b>?" ] % html .escape (cert_user_id ), reason , _ ["Mute" ]],
6262 lambda res : self .cbMuteAdd (to , auth_address , cert_user_id , res if res else reason )
6363 )
6464
@@ -216,6 +216,28 @@ def onUpdated(self, inner_path, file=None):
216216 filter_storage .includeUpdateAll ()
217217 return super (SiteStoragePlugin , self ).onUpdated (inner_path , file = file )
218218
219+ @PluginManager .registerTo ("Site" )
220+ class SitePlugin (object ):
221+ def needFile (self , inner_path , update = False , blocking = True , peer = None , priority = 0 ):
222+ self .log .debug (f'needFile { inner_path } ' )
223+ matches = re .findall ('/(1[A-Za-z0-9]{26,35})/' , inner_path )
224+ for auth_address in matches :
225+ if filter_storage .isMuted (auth_address ):
226+ self .log .info (f'Mute match in Site.needFile: { auth_address } , ignoring { inner_path } ' )
227+ return False
228+ return super (SitePlugin , self ).needFile (inner_path , update , blocking , peer , priority )
229+
230+ @PluginManager .registerTo ("FileRequest" )
231+ class FileRequestPlugin :
232+ def actionUpdate (self , params ):
233+ inner_path = params .get ('inner_path' , '' )
234+ matches = re .findall ('/(1[A-Za-z0-9]{26,35})/' , inner_path )
235+ for auth_address in matches :
236+ if filter_storage .isMuted (auth_address ):
237+ self .log .info (f'Mute match in FileRequest.actionUpdate: { auth_address } , ignoring { inner_path } ' )
238+ self .response ({'ok' : f'Thanks, file { inner_path } updated!' })
239+ return False
240+ return super (FileRequestPlugin , self ).actionUpdate (params )
219241
220242@PluginManager .registerTo ("UiRequest" )
221243class UiRequestPlugin (object ):
0 commit comments