Nostr bech32 dm (#109)

* nostr: bech32 keys and remember last DM check

* cump to 0.9.2

* make format
This commit is contained in:
calle
2023-02-13 23:19:19 +01:00
committed by GitHub
parent 53aa73b7c7
commit 5ec2c3604e
10 changed files with 84 additions and 19 deletions

View File

@@ -334,3 +334,27 @@ async def update_lightning_invoice(
hash,
),
)
async def set_nostr_last_check_timestamp(
db: Database,
timestamp: int,
conn: Optional[Connection] = None,
):
await (conn or db).execute(
f"UPDATE nostr SET last = ? WHERE type = ?",
(timestamp, "dm"),
)
async def get_nostr_last_check_timestamp(
db: Database,
conn: Optional[Connection] = None,
):
row = await (conn or db).fetchone(
f"""
SELECT last from nostr WHERE type = ?
""",
("dm",),
)
return row[0] if row else None