mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
Merge pull request #50 from SemjonKerner/fix_notifications
Fix bug calling is_subbed
This commit is contained in:
commit
b157420d77
@ -33,7 +33,6 @@ class WindowClient:
|
||||
WindowClient.clients.remove(self)
|
||||
if len(WindowClient.clients) == 0:
|
||||
window_server.stop()
|
||||
logging.info("window server stopped")
|
||||
|
||||
@staticmethod
|
||||
def running():
|
||||
|
@ -162,8 +162,12 @@ def on_loot():
|
||||
|
||||
|
||||
def on_fight():
|
||||
logging.info("FIGHTING")
|
||||
msg = "FIGHTING!"
|
||||
logging.info(msg)
|
||||
web.send_notification(msg)
|
||||
|
||||
|
||||
def on_dead():
|
||||
logging.info("DEAD or INVENTORY FULL or NO BAIT EQUIPPED")
|
||||
msg = "DEAD or INVENTORY FULL or NO BAIT EQUIPPED"
|
||||
logging.info(msg)
|
||||
web.send_notification(msg)
|
||||
|
@ -58,7 +58,7 @@ def start_semifisher_config(gui: 'GUI'):
|
||||
gui.config.save_config()
|
||||
|
||||
def toggle_sub():
|
||||
if web.is_subbed(config.get("uid"))[0]:
|
||||
if web.is_subbed()[0]:
|
||||
if web.unsub():
|
||||
gui._notify.set(0)
|
||||
else:
|
||||
|
@ -51,18 +51,20 @@ def register_user(new_uid):
|
||||
|
||||
|
||||
@fallback(None)
|
||||
def send_notification(uid, message):
|
||||
# todo clean dead code
|
||||
if not is_subbed(uid):
|
||||
def send_notification(message):
|
||||
if not is_subbed():
|
||||
return False
|
||||
|
||||
body = {"uid": uid, "message": message, "apiversion":apiversion}
|
||||
body = {"uid": config.get("uid"), "message": message, "apiversion":apiversion}
|
||||
requests.post(urls.notify, json=body)
|
||||
|
||||
|
||||
@uses_session
|
||||
@fallback(None)
|
||||
def send_hole_deplete(fish_caught, hole_time, fish_times):
|
||||
if not is_subbed():
|
||||
return False
|
||||
|
||||
hole_data = {
|
||||
"fish_caught": fish_caught,
|
||||
"hole_time": hole_time,
|
||||
|
Loading…
Reference in New Issue
Block a user