mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-03-28 17:43:05 +01:00
Correct sender name and use non-deprecated loop getter
This commit is contained in:
@@ -49,11 +49,14 @@ class BotModule(FanoutModule):
|
||||
channel_key = None
|
||||
channel_name = None
|
||||
|
||||
# Look up sender name from contacts
|
||||
from app.repository import ContactRepository
|
||||
# Outgoing DMs: sender is us, not the contact
|
||||
if is_outgoing:
|
||||
sender_name = None
|
||||
else:
|
||||
from app.repository import ContactRepository
|
||||
|
||||
contact = await ContactRepository.get_by_key(conversation_key)
|
||||
sender_name = contact.name if contact else None
|
||||
contact = await ContactRepository.get_by_key(conversation_key)
|
||||
sender_name = contact.name if contact else None
|
||||
else:
|
||||
conversation_key = data.get("conversation_key", "")
|
||||
sender_key = None
|
||||
@@ -89,7 +92,7 @@ class BotModule(FanoutModule):
|
||||
from app.fanout.bot_exec import _bot_executor, _bot_semaphore
|
||||
|
||||
async with _bot_semaphore:
|
||||
loop = asyncio.get_event_loop()
|
||||
loop = asyncio.get_running_loop()
|
||||
try:
|
||||
response = await asyncio.wait_for(
|
||||
loop.run_in_executor(
|
||||
|
||||
Reference in New Issue
Block a user