diff --git a/model.py b/model.py

index 3ce1fc0..e4aeada 100644

--- a/model.py

+++ b/model.py

@@ -1419,8 +1419,18 @@ class Database:

     cur.execute('DELETE FROM segments WHERE id=?', (segment.id,))

     cur.execute('DELETE FROM crossrefs WHERE segment=?', (segment.id,))

     self.commit()

+

+ post = self.get_post(id=segment.post)

+ if not post.is_draft:

+ self.update_post_summary(post)

     if segment.type == Segment.POLL:

- self.update_poll_tag(self.get_post(id=segment.post))

+ self.update_poll_tag(post)

+ self.unpublish_if_empty(post)

+

+ def unpublish_if_empty(self, post):

+ if not post.is_draft and not post.title and post.num_cmts == 0 and \

+ len(self.get_segments(post)) == 0:

+ self.unpublish_post(post)



 def update_segment_crossrefs(self, segment: Segment):

     if segment.type == Segment.TEXT:

@@ -1502,6 +1512,9 @@ class Database:

         pos += 1

     self.commit()



+ if not post.is_draft:

+ self.update_post_summary(post)

+

 def modify_vote(self, user: User, segment: Segment):

     cur = self.conn.cursor()



@@ -1783,6 +1796,7 @@ class Database:

         self.commit()

         if title != None and not post.is_draft:

             self.update_post_summary(post)

+ self.unpublish_if_empty(post)



 def notify_mentioned(self, post, content, old_content=None):

     names = parse_at_names(content)

Proxy Information
Original URL
gemini://git.skyjake.fi/bubble/main/pcdiff/96bac9923ad0a7c2feb691183049151a596f51ae
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
31.739712 milliseconds
Gemini-to-HTML Time
0.980621 milliseconds

This content has been proxied by September (3851b).