From 32ce1d2a74f88d0de785fc9fc3ea6c4a58860297 Mon Sep 17 00:00:00 2001 From: Joseph Abbey Date: Fri, 12 Jan 2024 18:01:00 +0000 Subject: [PATCH] Fix naming --- source/Settings.mc | 6 +++--- source/WebhookManager.mc | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/source/Settings.mc b/source/Settings.mc index eed1bd9..443c8ce 100644 --- a/source/Settings.mc +++ b/source/Settings.mc @@ -83,7 +83,7 @@ class Settings { if ((System has :ServiceDelegate) and (Background.getTemporalEventRegisteredTime() != null)) { Background.deleteTemporalEvent(); } - removeWebhookId(); + unsetWebhookId(); } } if (Globals.scDebug) { @@ -109,7 +109,7 @@ class Settings { Properties.setValue("webhook_id", mWebhookId); } - static function removeWebhookId() { + static function unsetWebhookId() { mWebhookId = ""; Properties.setValue("webhook_id", mWebhookId); } @@ -155,7 +155,7 @@ class Settings { return mIsWidgetStartNoTap; } - static function disableBatteryLevel() { + static function unsetIsBatteryLevelEnabled() { mIsBatteryLevelEnabled = false; Properties.setValue("enable_battery_level", mIsBatteryLevelEnabled); if ((System has :ServiceDelegate) and (Background.getTemporalEventRegisteredTime() != null)) { diff --git a/source/WebhookManager.mc b/source/WebhookManager.mc index 197d383..c2933cb 100644 --- a/source/WebhookManager.mc +++ b/source/WebhookManager.mc @@ -38,7 +38,7 @@ class WebhookManager { if (Globals.scDebug) { System.println("WebhookManager onReturnRequestWebhookId() Response Code: INVALID_HTTP_BODY_IN_NETWORK_RESPONSE, check JSON is returned."); } - Settings.disableBatteryLevel(); + Settings.unsetIsBatteryLevelEnabled(); ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getNoJson()); break; @@ -46,7 +46,7 @@ class WebhookManager { if (Globals.scDebug) { System.println("WebhookManager onReturnRequestWebhookId() Response Code: 404, page not found. Check API URL setting."); } - Settings.disableBatteryLevel(); + Settings.unsetIsBatteryLevelEnabled(); ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getApiUrlNotFound()); break; @@ -78,7 +78,7 @@ class WebhookManager { if (Globals.scDebug) { System.println("WebhookManager onReturnRequestWebhookId(): No webhook id in response data."); } - Settings.disableBatteryLevel(); + Settings.unsetIsBatteryLevelEnabled(); ErrorView.show(RezStrings.getWebhookFailed()); } break; @@ -87,7 +87,7 @@ class WebhookManager { if (Globals.scDebug) { System.println("WebhookManager onReturnRequestWebhookId(): Unhandled HTTP response code = " + responseCode); } - Settings.disableBatteryLevel(); + Settings.unsetIsBatteryLevelEnabled(); ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getUnhandledHttpErr() + responseCode); } } @@ -130,7 +130,7 @@ class WebhookManager { if (Globals.scDebug) { System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: BLE_HOST_TIMEOUT or BLE_CONNECTION_UNAVAILABLE, Bluetooth connection severed."); } - Settings.removeWebhookId(); + Settings.unsetWebhookId(); ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getNoPhone() + "."); break; @@ -138,7 +138,7 @@ class WebhookManager { if (Globals.scDebug) { System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: BLE_QUEUE_FULL, API calls too rapid."); } - Settings.removeWebhookId(); + Settings.unsetWebhookId(); ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getApiFlood()); break; @@ -146,7 +146,7 @@ class WebhookManager { if (Globals.scDebug) { System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: NETWORK_REQUEST_TIMED_OUT, check Internet connection."); } - Settings.removeWebhookId(); + Settings.unsetWebhookId(); ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getNoResponse()); break; @@ -154,15 +154,15 @@ class WebhookManager { if (Globals.scDebug) { System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: NETWORK_RESPONSE_OUT_OF_MEMORY, are we going too fast?"); } - Settings.removeWebhookId(); + Settings.unsetWebhookId(); // Ignore and see if we can carry on break; case Communications.INVALID_HTTP_BODY_IN_NETWORK_RESPONSE: if (Globals.scDebug) { System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: INVALID_HTTP_BODY_IN_NETWORK_RESPONSE, check JSON is returned."); } - Settings.removeWebhookId(); - Settings.disableBatteryLevel(); + Settings.unsetWebhookId(); + Settings.unsetIsBatteryLevelEnabled(); ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getNoJson()); break; @@ -170,8 +170,8 @@ class WebhookManager { if (Globals.scDebug) { System.println("WebhookManager onReturnRequestWebhookId() Response Code: 404, page not found. Check API URL setting."); } - Settings.removeWebhookId(); - Settings.disableBatteryLevel(); + Settings.unsetWebhookId(); + Settings.unsetIsBatteryLevelEnabled(); ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getApiUrlNotFound()); break; @@ -184,8 +184,8 @@ class WebhookManager { if (Globals.scDebug) { System.println("WebhookManager onReturnRegisterWebhookSensor(): Failure"); } - Settings.removeWebhookId(); - Settings.disableBatteryLevel(); + Settings.unsetWebhookId(); + Settings.unsetIsBatteryLevelEnabled(); ErrorView.show(RezStrings.getWebhookFailed()); } break; @@ -194,8 +194,8 @@ class WebhookManager { if (Globals.scDebug) { System.println("WebhookManager onReturnRequestWebhookId(): Unhandled HTTP response code = " + responseCode); } - Settings.removeWebhookId(); - Settings.disableBatteryLevel(); + Settings.unsetWebhookId(); + Settings.unsetIsBatteryLevelEnabled(); ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getUnhandledHttpErr() + responseCode); } }