mirror of https://git.skyjake.fi/gemini/bubble.git
Bumped version to 8.4; move comments when moving post
This commit is contained in:
parent
2c53b11bbf
commit
b3f14d09ad
|
@ -18,7 +18,7 @@ from utils import *
|
|||
from worker import *
|
||||
|
||||
|
||||
__version__ = '8.3'
|
||||
__version__ = '8.4'
|
||||
|
||||
|
||||
class Bubble:
|
||||
|
|
|
@ -343,7 +343,10 @@ def make_composer_page(session):
|
|||
return 50, "Cannot move to an issue tracker subspace"
|
||||
if dst_sub.owner and dst_sub.owner != post.user:
|
||||
return 50, "Cannot move to another user's subspace"
|
||||
|
||||
oldsub_id = post.subspace
|
||||
db.update_post(post, subspace_id=dst_sub.id)
|
||||
db.move_comments(post, oldsub_id, dst_sub.id)
|
||||
|
||||
# Notify as if the post was new.
|
||||
db.notify_followed_about_post(post)
|
||||
|
|
6
model.py
6
model.py
|
@ -2297,6 +2297,12 @@ class Database:
|
|||
self.update_post_summary(post)
|
||||
self.unpublish_if_empty(post)
|
||||
|
||||
def move_comments(self, post: Post, oldsub_id, newsub_id):
|
||||
cur = self.conn.cursor()
|
||||
cur.execute("UPDATE posts SET subspace=? WHERE subspace=? AND parent=?",
|
||||
(newsub_id, oldsub_id, post.id))
|
||||
self.commit()
|
||||
|
||||
def notify_mentioned(self, post, content, old_content=None):
|
||||
names = parse_at_names(content)
|
||||
post_user = self.get_user(id=post.user)
|
||||
|
|
Loading…
Reference in New Issue