Simplify dashboard

This commit is contained in:
Mark Veidemanis 2021-12-31 18:21:56 +00:00
parent b7dd850c61
commit 05045c2a8e
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@ class Agora(object):
self.lc_dash = LoopingCall(self.dashboard) self.lc_dash = LoopingCall(self.dashboard)
self.lc_dash.start(int(settings.Agora.RefreshSec)) self.lc_dash.start(int(settings.Agora.RefreshSec))
def dashboard(self, send_irc=True, formatted=False): def dashboard(self, send_irc=True):
""" """
Returns a dict for the dashboard. Returns a dict for the dashboard.
Calls hooks to parse dashboard info and get all contact messages. Calls hooks to parse dashboard info and get all contact messages.
@ -60,10 +60,10 @@ class Agora(object):
for contact in dash["response"]["data"]["contact_list"]: for contact in dash["response"]["data"]["contact_list"]:
contact_id = contact["data"]["contact_id"] contact_id = contact["data"]["contact_id"]
dash_tmp[contact_id] = contact dash_tmp[contact_id] = contact
fmt = self.dashboard_hook(dash_tmp)
# Call hook function
self.dashboard_hook(dash_tmp, send_irc=send_irc)
self.get_recent_messages() self.get_recent_messages()
if formatted:
return fmt
return dash_tmp return dash_tmp
def dashboard_hook(self, dash, send_irc=True): def dashboard_hook(self, dash, send_irc=True):