Tweaked voting logic

This commit is contained in:
2026-09-04 10:43:53 -05:00
parent c71fec44d6
commit f6f6721f3a
21 changed files with 19 additions and 18 deletions
+7 -3
View File
@@ -838,8 +838,6 @@ class Room:
print(f"Failed to post suggestion {idx}: {resp}")
continue
post.is_posted = True
reaction = {
"m.relates_to": {
"rel_type": "m.annotation",
@@ -855,7 +853,6 @@ class Room:
await asyncio.sleep(self.config.post_interval)
self.mark_posts_as_posted([p for p in unposted_posts if p.is_posted])
print("Suggestions posted!")
def mark_posts_as_posted(self, posts=None):
@@ -873,6 +870,13 @@ class Room:
dbutil.commit(conn)
conn.close()
def mark_submissions_posted(self):
conn = dbutil.connect(self.db_path)
c = conn.cursor()
_ = c.execute("UPDATE suggestions SET is_posted = 1 WHERE is_posted = 0")
dbutil.commit(conn)
conn.close()
async def close(self):
if self.client:
await self.client.close()