From fe55357f838d8ff7ef79207c5b5e05a54e171a50 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 10 Oct 2018 19:21:52 +0100 Subject: [PATCH] talk: Show something useful when having an encrypted call Signed-off-by: Michael Tremer --- src/backend/talk.py | 13 ++++++++++++- src/templates/talk/modules/channels.html | 10 ++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/backend/talk.py b/src/backend/talk.py index 5ff48e47..7fec3afb 100644 --- a/src/backend/talk.py +++ b/src/backend/talk.py @@ -153,9 +153,20 @@ class Channel(object): return " ".join(s) + def is_secure(self): + if self.data.secure: + return True + + return False + @property def secure(self): - return self.data.secure + try: + transport_protocol, key_negotiation, cipher_suite = self.data.secure.split(":") + except: + return + + return "%s: %s" % (key_negotiation.upper(), cipher_suite.replace("_", "-")) class Talk(Object): diff --git a/src/templates/talk/modules/channels.html b/src/templates/talk/modules/channels.html index 9d73d10b..c2a1959c 100644 --- a/src/templates/talk/modules/channels.html +++ b/src/templates/talk/modules/channels.html @@ -39,11 +39,13 @@
- {{ chan.codec }} + + {% if chan.is_secure() %} + + {% end %} - {% if chan.secure %} - {{ chan.secure }} - {% end %} + {{ chan.codec }} + -- 2.47.3