(20250123) Made a common API to disable all integrations.
This commit is contained in:
@@ -106,6 +106,12 @@ from abc import ABC, abstractmethod
|
||||
|
||||
class ChatController(CoreMessageController, ABC):
|
||||
|
||||
# ┏┓┓ ┓┏
|
||||
# ┃ ┃┏┓┏┏ ┃┃┏┓┏┓┏
|
||||
# ┗┛┗┗┻┛┛ ┗┛┗┻┛ ┛
|
||||
|
||||
SERVICE_TYPE = "chat"
|
||||
|
||||
# ┏┓
|
||||
# ┃ ┏┓┏┓┏╋┏┓┓┏┏╋┏┓┏┓
|
||||
# ┗┛┗┛┛┗┛┗┛ ┗┻┗┗┗┛┛
|
||||
@@ -137,7 +143,7 @@ class ChatController(CoreMessageController, ABC):
|
||||
# Prepare the combined base filter:
|
||||
sms_filter = {}
|
||||
for k, v in (base_filter or {}).items(): sms_filter[k] = v
|
||||
sms_filter["serviceType"] = "chat"
|
||||
sms_filter["serviceType"] = self.SERVICE_TYPE
|
||||
|
||||
# Invoke the parent's constructor:
|
||||
CoreMessageController.__init__(
|
||||
@@ -151,6 +157,9 @@ class ChatController(CoreMessageController, ABC):
|
||||
debug_only_errors = debug_only_errors
|
||||
)
|
||||
|
||||
# Init a variable in a parent:
|
||||
self._service_type = self.SERVICE_TYPE
|
||||
|
||||
# ┏┓ ┓ ┳┳┓
|
||||
# ┗┓┏┓┏┓┏┫ ┃┃┃┏┓┏┏┏┓┏┓┏┓┏
|
||||
# ┗┛┗ ┛┗┗┻ ┛ ┗┗ ┛┛┗┻┗┫┗ ┛
|
||||
|
||||
@@ -105,6 +105,12 @@ import asyncio
|
||||
|
||||
class WhatsAppNimbusController(ChatController):
|
||||
|
||||
# ┏┓┓ ┓┏
|
||||
# ┃ ┃┏┓┏┏ ┃┃┏┓┏┓┏
|
||||
# ┗┛┗┗┻┛┛ ┗┛┗┻┛ ┛
|
||||
|
||||
CLIENT_NAME = "gmail"
|
||||
|
||||
# ┏┓
|
||||
# ┃ ┏┓┏┓┏╋┏┓┓┏┏╋┏┓┏┓
|
||||
# ┗┛┗┛┛┗┛┗┛ ┗┻┗┗┗┛┛
|
||||
@@ -134,12 +140,15 @@ class WhatsAppNimbusController(ChatController):
|
||||
cache = cache,
|
||||
alert_url = alert_url,
|
||||
http_client = http_client,
|
||||
base_filter = {"client": "whatsappNimbus"},
|
||||
base_filter = {"client": self.CLIENT_NAME},
|
||||
debug = debug,
|
||||
debug_prefix = debug_prefix,
|
||||
debug_only_errors = debug_only_errors
|
||||
)
|
||||
|
||||
# Init a variable in a parent:
|
||||
self._client = self.CLIENT_NAME
|
||||
|
||||
# ┏┓ ┓ ┳┳┓
|
||||
# ┗┓┏┓┏┓┏┫ ┃┃┃┏┓┏┏┏┓┏┓┏┓┏
|
||||
# ┗┛┗ ┛┗┗┻ ┛ ┗┗ ┛┛┗┻┗┫┗ ┛
|
||||
|
||||
Reference in New Issue
Block a user