diff --git a/bin/lib/chats_viewer.py b/bin/lib/chats_viewer.py index a358c0a6..491f315f 100755 --- a/bin/lib/chats_viewer.py +++ b/bin/lib/chats_viewer.py @@ -185,7 +185,7 @@ class ChatServiceInstance: meta['chats'] = [] for chat_id in self.get_chats_with_messages(): meta['chats'].append( - Chats.Chat(chat_id, self.uuid).get_meta({'created_at', 'icon', 'nb_subchannels', 'nb_messages'})) + Chats.Chat(chat_id, self.uuid).get_meta({'created_at', 'icon', 'nb_subchannels', 'nb_messages', 'username', 'str_username'})) return meta def get_nb_chats(self): diff --git a/bin/lib/objects/Chats.py b/bin/lib/objects/Chats.py index f1ffa21f..8b127524 100755 --- a/bin/lib/objects/Chats.py +++ b/bin/lib/objects/Chats.py @@ -94,6 +94,8 @@ class Chat(AbstractChatObject): meta['nb_messages'] = self.get_nb_messages() if 'username' in options: meta['username'] = self.get_username() + if meta['username'] and 'str_username' in options: + meta['username'] = meta['username'].split(':', 2)[2] if 'subchannels' in options: meta['subchannels'] = self.get_subchannels() if 'nb_subchannels': diff --git a/var/www/templates/chats_explorer/chat_instance.html b/var/www/templates/chats_explorer/chat_instance.html index 574055aa..747dc98b 100644 --- a/var/www/templates/chats_explorer/chat_instance.html +++ b/var/www/templates/chats_explorer/chat_instance.html @@ -65,8 +65,9 @@ Icon - Name ID + Name + Username Created at First Seen Last Seen @@ -81,8 +82,13 @@ {{ chat['id'] }} - {{ chat['name'] }} {{ chat['id'] }} + {{ chat['name'] }} + + {% if chat['username'] %} + {{ chat['username'] }} + {% endif %} + {{ chat['created_at'] }} {% if chat['first_seen'] %} @@ -114,7 +120,7 @@ $('#tablechats').DataTable({ "aLengthMenu": [[5, 10, 15, -1], [5, 10, 15, "All"]], "iDisplayLength": 10, - "order": [[ 5, "desc" ]] + "order": [[ 6, "desc" ]] }); });