Allow passing in aprsis_client

When the admin user users the web ui to send a message
a new client instance is created with login credentials for
that particular message.  This patch ensures that send_direct
uses that client.
This commit is contained in:
Hemna 2021-09-02 11:17:15 -04:00
parent 8ada789d4d
commit 62ce84b315
2 changed files with 8 additions and 3 deletions

View File

@ -162,7 +162,6 @@ class SendMessageThread(threads.APRSDThread):
def run(self):
LOG.debug("Starting")
from_call = self.request["from"]
self.request["password"]
to_call = self.request["to"]
message = self.request["message"]
LOG.info(

View File

@ -381,7 +381,10 @@ class TextMessage(Message):
def send_direct(self, aprsis_client=None):
"""Send a message without a separate thread."""
cl = self.get_transport()
if aprsis_client:
cl = aprsis_client
else:
cl = self.get_transport()
log_message(
"Sending Message Direct",
str(self).rstrip("\n"),
@ -501,7 +504,10 @@ class AckMessage(Message):
def send_direct(self, aprsis_client=None):
"""Send an ack message without a separate thread."""
cl = self.get_transport()
if aprsis_client:
cl = aprsis_client
else:
cl = self.get_transport()
log_message(
"Sending ack",
str(self).rstrip("\n"),