mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Hide boost buttons and menu item when focus is in a toot part of a conversation
This commit is contained in:
parent
96b5eec8e0
commit
bedb2e2a4f
@ -260,6 +260,9 @@ class BaseBuffer(base.Buffer):
|
|||||||
return self.session.db[self.name][index]
|
return self.session.db[self.name][index]
|
||||||
|
|
||||||
def can_share(self):
|
def can_share(self):
|
||||||
|
toot = self.get_item()
|
||||||
|
if toot.visibility == "direct":
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def reply(self, *args):
|
def reply(self, *args):
|
||||||
@ -297,7 +300,7 @@ class BaseBuffer(base.Buffer):
|
|||||||
|
|
||||||
def share_item(self, *args, **kwargs):
|
def share_item(self, *args, **kwargs):
|
||||||
if self.can_share() == False:
|
if self.can_share() == False:
|
||||||
return output.speak(_("This action is not supported on protected accounts."))
|
return output.speak(_("This action is not supported on conversation toots."))
|
||||||
toot = self.get_item()
|
toot = self.get_item()
|
||||||
id = toot.id
|
id = toot.id
|
||||||
if self.session.settings["general"]["boost_mode"] == "ask":
|
if self.session.settings["general"]["boost_mode"] == "ask":
|
||||||
@ -320,9 +323,9 @@ class BaseBuffer(base.Buffer):
|
|||||||
self.session.sound.play("audio.ogg")
|
self.session.sound.play("audio.ogg")
|
||||||
if self.session.settings['sound']['indicate_img'] and utils.is_image(toot):
|
if self.session.settings['sound']['indicate_img'] and utils.is_image(toot):
|
||||||
self.session.sound.play("image.ogg")
|
self.session.sound.play("image.ogg")
|
||||||
# can_share = self.can_share()
|
can_share = self.can_share()
|
||||||
# pub.sendMessage("toggleShare", shareable=can_share)
|
pub.sendMessage("toggleShare", shareable=can_share)
|
||||||
# self.buffer.boost.Enable(can_share)
|
self.buffer.boost.Enable(can_share)
|
||||||
|
|
||||||
def audio(self, url='', *args, **kwargs):
|
def audio(self, url='', *args, **kwargs):
|
||||||
if sound.URLPlayer.player.is_playing():
|
if sound.URLPlayer.player.is_playing():
|
||||||
|
Loading…
Reference in New Issue
Block a user