diff --git a/bin/lib/objects/Messages.py b/bin/lib/objects/Messages.py index f1c7ed43..fe1e1f38 100755 --- a/bin/lib/objects/Messages.py +++ b/bin/lib/objects/Messages.py @@ -193,14 +193,14 @@ class Message(AbstractObject): for it in self.get_correlation_iter('file-name', '', file_name, 'item'): if file_name not in files: files[file_name] = [] - files[file_name].append(it[1:]) + files[file_name].append({'obj': it[1:], 'tags': self.get_obj_tags('item', '', it[1:])}) s_files.add(it[1:]) nb_files += 1 if nb_files < self.get_nb_files(): files['undefined'] = [] for f in self.get_correlation('item').get('item'): if f[1:] not in s_files: - files['undefined'].append(f[1:]) + files['undefined'].append({'obj': f[1:], 'tags': self.get_obj_tags('item', '', f[1:])}) return files def get_reactions(self): diff --git a/bin/lib/objects/abstract_object.py b/bin/lib/objects/abstract_object.py index 4b230f11..a157a4fe 100755 --- a/bin/lib/objects/abstract_object.py +++ b/bin/lib/objects/abstract_object.py @@ -109,6 +109,12 @@ class AbstractObject(ABC): tags = list(tags) return tags + def get_obj_tags(self, obj_type, subtype, obj_id, r_list=False): + tags = Tag.get_object_tags(obj_type, obj_id, subtype) + if r_list: + tags = list(tags) + return tags + def add_tag(self, tag): Tag.add_object_tag(tag, self.type, self.id, subtype=self.get_subtype(r_str=True)) diff --git a/var/www/templates/chats_explorer/block_message.html b/var/www/templates/chats_explorer/block_message.html index 1184937f..9dd14af2 100644 --- a/var/www/templates/chats_explorer/block_message.html +++ b/var/www/templates/chats_explorer/block_message.html @@ -134,15 +134,29 @@ {% if message['files'][file_name] | length > 1 %}