From 3773f96901a5b2f398f098e530023290c66d2bc9 Mon Sep 17 00:00:00 2001
From: Casey Diemel <diemelcw@gmail.com>
Date: Sat, 12 Oct 2019 16:49:52 -0400
Subject: [PATCH] Updated on() to allow return values

modified line 21

added line 22-23

Signed-off-by: Casey Diemel <diemelcw@gmail.com>
---
 pwnagotchi/plugins/__init__.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pwnagotchi/plugins/__init__.py b/pwnagotchi/plugins/__init__.py
index 6dd7b64..7faa553 100644
--- a/pwnagotchi/plugins/__init__.py
+++ b/pwnagotchi/plugins/__init__.py
@@ -18,7 +18,9 @@ def on(event_name, *args, **kwargs):
         if cb_name in plugin.__dict__:
             # print("calling %s %s(%s)" %(cb_name, args, kwargs))
             try:
-                plugin.__dict__[cb_name](*args, **kwargs)
+                ret_val = plugin.__dict__[cb_name](*args, **kwargs)
+                if ret_val is not None:
+                    return ret_val
             except Exception as e:
                 logging.error("error while running %s.%s : %s" % (plugin_name, cb_name, e))