Merge remote-tracking branch 'origin/main' into bb/gui
# Conflicts: # tui_gateway/server.py
This commit is contained in:
@@ -446,7 +446,9 @@ class SignalAdapter(BasePlatformAdapter):
|
||||
if sent_msg and isinstance(sent_msg, dict):
|
||||
dest = sent_msg.get("destinationNumber") or sent_msg.get("destination")
|
||||
sent_ts = sent_msg.get("timestamp")
|
||||
if dest == self._account_normalized:
|
||||
sent_msg_group_info = sent_msg.get("groupInfo") or {}
|
||||
sent_msg_group_id = sent_msg_group_info.get("groupId") if sent_msg_group_info else None
|
||||
if dest == self._account_normalized or sent_msg_group_id:
|
||||
# Check if this is an echo of our own outbound reply
|
||||
if sent_ts and sent_ts in self._recent_sent_timestamps:
|
||||
self._recent_sent_timestamps.discard(sent_ts)
|
||||
|
||||
@@ -2772,7 +2772,7 @@ class TelegramAdapter(BasePlatformAdapter):
|
||||
{"thread_id": str(thread_id)},
|
||||
)
|
||||
)
|
||||
await self._bot.send_message(**send_kwargs)
|
||||
await self._send_message_with_thread_fallback(**send_kwargs)
|
||||
except Exception as exc:
|
||||
logger.error("[%s] slash-confirm callback failed: %s", self.name, exc, exc_info=True)
|
||||
return
|
||||
|
||||
@@ -345,6 +345,7 @@ class WeComAdapter(BasePlatformAdapter):
|
||||
try:
|
||||
await self._open_connection()
|
||||
backoff_idx = 0
|
||||
self._mark_connected()
|
||||
logger.info("[%s] Reconnected", self.name)
|
||||
except Exception as reconnect_exc:
|
||||
logger.warning("[%s] Reconnect failed: %s", self.name, reconnect_exc)
|
||||
|
||||
@@ -494,12 +494,15 @@ class WhatsAppAdapter(BasePlatformAdapter):
|
||||
# plain executable path.
|
||||
_npm_bin = shutil.which("npm") or "npm"
|
||||
try:
|
||||
# Read timeout from environment variable, default to 300 seconds (5 minutes)
|
||||
# to accommodate slower systems like Unraid NAS
|
||||
npm_install_timeout = int(os.environ.get("WHATSAPP_NPM_INSTALL_TIMEOUT", "300"))
|
||||
install_result = subprocess.run(
|
||||
[_npm_bin, "install", "--silent"],
|
||||
cwd=str(bridge_dir),
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=60,
|
||||
timeout=npm_install_timeout,
|
||||
)
|
||||
if install_result.returncode != 0:
|
||||
print(f"[{self.name}] npm install failed: {install_result.stderr}")
|
||||
|
||||
@@ -7543,6 +7543,7 @@ class GatewayRunner:
|
||||
hook_ctx = {
|
||||
"platform": source.platform.value if source.platform else "",
|
||||
"user_id": source.user_id,
|
||||
"chat_id": source.chat_id or "",
|
||||
"session_id": session_entry.session_id,
|
||||
"message": message_text[:500],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user