Fix bridging and refactor

This commit is contained in:
2025-03-13 17:26:26 +00:00
parent 7fa76cd4ef
commit f5c6b535d8
14 changed files with 1264 additions and 202 deletions

View File

@@ -119,16 +119,17 @@ class PersonIdentifier(models.Model):
def __str__(self):
return f"{self.person} ({self.service})"
def send(self, text, attachments=[]):
async def send(self, text, attachments=[]):
"""
Send this contact a text.
"""
if self.service == "signal":
ts = signalapi.send_message_raw_sync(
ts = await signalapi.send_message_raw(
self.identifier,
text,
attachments,
)
print("SENT")
return ts
else:
raise NotImplementedError(f"Service not implemented: {self.service}")