19 lines
518 B
Python
19 lines
518 B
Python
import logging
|
|
from pydbus import SystemBus
|
|
from gi.repository.GLib import GError
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def signal_send(recipients: list[str], message: str) -> None:
|
|
try:
|
|
bus = SystemBus()
|
|
signal_bus = bus.get("org.asamk.Signal")
|
|
for recipient in recipients:
|
|
signal_bus.sendMessage(
|
|
message,
|
|
[],
|
|
recipient,
|
|
)
|
|
except GError as exn:
|
|
logger.error("Cannot send Signal notification: %s", exn)
|