feat: log presence, read receipts, group leaves, links, profiles, stories
This commit is contained in:
1 parent
bfd16ab02c
commit
bcb94b6474
31 files changed
+1298
-19
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,32 @@
|
||||
from datetime import datetime
|
||||
|
||||
import asyncpg
|
||||
|
||||
_INSERT_STATUS = """
|
||||
INSERT INTO presence
|
||||
(account_id, peer_id, ts, status, last_online_date, next_offline_date, raw)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7::jsonb)
|
||||
ON CONFLICT (account_id, peer_id, ts) DO NOTHING
|
||||
"""
|
||||
|
||||
|
||||
async def insert_status( # noqa: PLR0913
|
||||
pool: asyncpg.Pool,
|
||||
account_id: int,
|
||||
peer_id: int,
|
||||
ts: datetime,
|
||||
status: str,
|
||||
last_online_date: datetime | None,
|
||||
next_offline_date: datetime | None,
|
||||
raw: str,
|
||||
) -> None:
|
||||
await pool.execute(
|
||||
_INSERT_STATUS,
|
||||
account_id,
|
||||
peer_id,
|
||||
ts,
|
||||
status,
|
||||
last_online_date,
|
||||
next_offline_date,
|
||||
raw,
|
||||
)
|
||||
Reference in new issue
Block a user