fix: [tracker] fix message trackers

dev
terrtia 2024-02-15 16:22:00 +01:00
parent 152e7bb51e
commit 93d1b6fc1f
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
3 changed files with 8 additions and 4 deletions

View File

@ -929,7 +929,7 @@ def api_add_tracker(dict_input, user_id):
# Filters # TODO MOVE ME
filters = dict_input.get('filters', {})
if filters:
if filters.keys() == {'decoded', 'item', 'pgp', 'title'} and set(filters['pgp'].get('subtypes', [])) == {'mail', 'name'}:
if filters.keys() == set(get_objects_tracked()) and set(filters['pgp'].get('subtypes', [])) == {'mail', 'name'}:
filters = {}
for obj_type in filters:
if obj_type not in get_objects_tracked():
@ -1004,7 +1004,7 @@ def api_edit_tracker(dict_input, user_id):
# Filters # TODO MOVE ME
filters = dict_input.get('filters', {})
if filters:
if filters.keys() == {'decoded', 'item', 'pgp', 'title'} and set(filters['pgp'].get('subtypes', [])) == {'mail', 'name'}:
if filters.keys() == set(get_objects_tracked()) and set(filters['pgp'].get('subtypes', [])) == {'mail', 'name'}:
if not filters['decoded'] and not filters['item']:
filters = {}
for obj_type in filters:

View File

@ -61,10 +61,10 @@ def get_obj_queued():
return ['item', 'image']
def get_objects_tracked():
return ['decoded', 'item', 'pgp', 'title']
return ['decoded', 'item', 'pgp', 'message', 'title']
def get_objects_retro_hunted():
return ['decoded', 'item']
return ['decoded', 'item', 'message']
def get_all_objects_with_subtypes_tuple():
str_objs = []

View File

@ -136,6 +136,10 @@
<input class="custom-control-input" type="checkbox" name="title_obj" id="title_obj" checked="">
<label class="custom-control-label" for="title_obj"><i class="fas fa-heading"></i>&nbsp;Decoded <i class="fas fa-info-circle text-info" data-toggle="tooltip" data-placement="right" title="Title that has been extracted from a HTML page"></i></label>
</div>
<div class="custom-control custom-switch mt-1">
<input class="custom-control-input" type="checkbox" name="message_obj" id="message_obj" checked="">
<label class="custom-control-label" for="message_obj"><i class="fas fa-comment-dots"></i>&nbsp;Message <i class="fas fa-info-circle text-info" data-toggle="tooltip" data-placement="right" title="Messages from Chats"></i></label>
</div>
{# <div class="custom-control custom-switch mt-1">#}
{# <input class="custom-control-input" type="checkbox" name="level" id="screenshot_obj" checked="">#}