Skip to content

Commit

Permalink
chg: [chats] show NB messages by chat
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Jan 26, 2024
1 parent 74e4101 commit 61bccec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/lib/chats_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get_meta(self, options=set()):
if 'chats' in options:
meta['chats'] = []
for chat_id in self.get_chats():
meta['chats'].append(Chats.Chat(chat_id, self.uuid).get_meta({'created_at', 'icon', 'nb_subchannels'}))
meta['chats'].append(Chats.Chat(chat_id, self.uuid).get_meta({'created_at', 'icon', 'nb_subchannels', 'nb_messages'}))
return meta

def get_nb_chats(self):
Expand Down
2 changes: 2 additions & 0 deletions bin/lib/objects/Chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def get_meta(self, options=set()):
meta['participants'] = self.get_participants()
if 'nb_participants' in options:
meta['nb_participants'] = self.get_nb_participants()
if 'nb_messages' in options:
meta['nb_messages'] = self.get_nb_messages()
if 'username' in options:
meta['username'] = self.get_username()
if 'subchannels' in options:
Expand Down
2 changes: 1 addition & 1 deletion var/www/blueprints/chats_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def chats_explorer_networks():
return render_template('chats_networks.html', protocol=protocol, networks=networks)


@chats_explorer.route("chats/explorer/instance", methods=['GET'])
@chats_explorer.route("chats/explorer/instances", methods=['GET'])
@login_required
@login_read_only
def chats_explorer_instance():
Expand Down
4 changes: 3 additions & 1 deletion var/www/templates/chats_explorer/chat_instance.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ <h4 class="text-secondary">{{ chat_instance["protocol"] }} :</h4>
<th>Created at</th>
<th>First Seen</th>
<th>Last Seen</th>
<th>NB SubChannels</th>
<th>SubChannels</th>
<th>Messages</th>
</tr>
</thead>
<tbody style="font-size: 15px;">
Expand All @@ -94,6 +95,7 @@ <h4 class="text-secondary">{{ chat_instance["protocol"] }} :</h4>
{% endif %}
</td>
<td>{{ chat['nb_subchannels'] }}</td>
<td>{{ chat['nb_messages'] }}</td>
</tr>
{% endfor %}
</tbody>
Expand Down

0 comments on commit 61bccec

Please sign in to comment.