Tightly integrate WhatsApp selectors into existing UIs
This commit is contained in:
@@ -22,12 +22,7 @@ if _signal_http_url:
|
||||
parsed = urlparse(
|
||||
_signal_http_url if "://" in _signal_http_url else f"http://{_signal_http_url}"
|
||||
)
|
||||
configured_host = (parsed.hostname or "").strip().lower()
|
||||
runtime = os.getenv("container", "").strip().lower()
|
||||
if configured_host == "signal" and runtime == "podman":
|
||||
SIGNAL_HOST = "127.0.0.1"
|
||||
else:
|
||||
SIGNAL_HOST = parsed.hostname or "signal"
|
||||
SIGNAL_HOST = parsed.hostname or "signal"
|
||||
SIGNAL_PORT = parsed.port or 8080
|
||||
else:
|
||||
if settings.DEBUG:
|
||||
@@ -276,18 +271,34 @@ class HandleMessage(Command):
|
||||
envelope_source_uuid = envelope.get("sourceUuid")
|
||||
envelope_source_number = envelope.get("sourceNumber")
|
||||
envelope_source = envelope.get("source")
|
||||
destination_number = (
|
||||
raw.get("envelope", {})
|
||||
.get("syncMessage", {})
|
||||
.get("sentMessage", {})
|
||||
.get("destination")
|
||||
)
|
||||
|
||||
primary_identifier = dest if is_from_bot else source_uuid
|
||||
identifier_candidates = _identifier_candidates(
|
||||
primary_identifier,
|
||||
source_uuid,
|
||||
source_number,
|
||||
source_value,
|
||||
envelope_source_uuid,
|
||||
envelope_source_number,
|
||||
envelope_source,
|
||||
dest,
|
||||
)
|
||||
if is_from_bot:
|
||||
# Outbound events must route only by destination identity.
|
||||
# Including the bot's own UUID/number leaks messages across people
|
||||
# if "self" identifiers are linked anywhere.
|
||||
identifier_candidates = _identifier_candidates(
|
||||
dest,
|
||||
destination_number,
|
||||
primary_identifier,
|
||||
)
|
||||
else:
|
||||
identifier_candidates = _identifier_candidates(
|
||||
primary_identifier,
|
||||
source_uuid,
|
||||
source_number,
|
||||
source_value,
|
||||
envelope_source_uuid,
|
||||
envelope_source_number,
|
||||
envelope_source,
|
||||
dest,
|
||||
)
|
||||
if not identifier_candidates:
|
||||
log.warning("No Signal identifier available for message routing.")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user