Keep sensitive content tag when replying to posts

This commit is contained in:
Manuel Cortez 2022-11-21 19:36:34 -06:00
parent 98ecd000a9
commit 48730ead63
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790
2 changed files with 13 additions and 0 deletions

View File

@ -303,6 +303,11 @@ class BaseBuffer(base.Buffer):
post = messages.post(session=self.session, title=title, caption=caption, text=users_str) post = messages.post(session=self.session, title=title, caption=caption, text=users_str)
visibility_settings = dict(public=0, unlisted=1, private=2, direct=3) visibility_settings = dict(public=0, unlisted=1, private=2, direct=3)
post.message.visibility.SetSelection(visibility_settings.get(visibility)) post.message.visibility.SetSelection(visibility_settings.get(visibility))
# Respect content warning settings.
if item.sensitive:
post.message.sensitive.SetValue(item.sensitive)
post.message.spoiler.ChangeValue(item.spoiler_text)
post.message.on_sensitivity_changed()
response = post.message.ShowModal() response = post.message.ShowModal()
if response == wx.ID_OK: if response == wx.ID_OK:
post_data = post.get_data() post_data = post.get_data()
@ -325,6 +330,10 @@ class BaseBuffer(base.Buffer):
users_str = "".join(users) users_str = "".join(users)
post = messages.post(session=self.session, title=title, caption=caption, text=users_str) post = messages.post(session=self.session, title=title, caption=caption, text=users_str)
post.message.visibility.SetSelection(3) post.message.visibility.SetSelection(3)
if item.sensitive:
post.message.sensitive.SetValue(item.sensitive)
post.message.spoiler.ChangeValue(item.spoiler_text)
post.message.on_sensitivity_changed()
response = post.message.ShowModal() response = post.message.ShowModal()
if response == wx.ID_OK: if response == wx.ID_OK:
post_data = post.get_data() post_data = post.get_data()

View File

@ -180,6 +180,10 @@ class ConversationListBuffer(BaseBuffer):
post = messages.post(session=self.session, title=title, caption=caption, text=users_str) post = messages.post(session=self.session, title=title, caption=caption, text=users_str)
visibility_settings = dict(public=0, unlisted=1, private=2, direct=3) visibility_settings = dict(public=0, unlisted=1, private=2, direct=3)
post.message.visibility.SetSelection(visibility_settings.get(visibility)) post.message.visibility.SetSelection(visibility_settings.get(visibility))
if item.sensitive:
post.message.sensitive.SetValue(item.sensitive)
post.message.spoiler.ChangeValue(item.spoiler_text)
post.message.on_sensitivity_changed()
response = post.message.ShowModal() response = post.message.ShowModal()
if response == wx.ID_OK: if response == wx.ID_OK:
post_data = post.get_data() post_data = post.get_data()