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