mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
update toot from server before displaying item
This commit is contained in:
parent
64d5b7e684
commit
de1d94e679
@ -300,11 +300,11 @@ class BaseBuffer(base.Buffer):
|
|||||||
title = _("Reply to {}").format(item.account.username)
|
title = _("Reply to {}").format(item.account.username)
|
||||||
caption = _("Write your reply here")
|
caption = _("Write your reply here")
|
||||||
if item.reblog != None:
|
if item.reblog != None:
|
||||||
users = ["@{}".format(user.acct) for user in item.reblog.mentions if user.id != self.session.db["user_id"]]
|
users = ["@{} ".format(user.acct) for user in item.reblog.mentions if user.id != self.session.db["user_id"]]
|
||||||
if item.reblog.account.acct != item.account.acct and "@{} ".format(item.reblog.account.acct) not in users:
|
if item.reblog.account.acct != item.account.acct and "@{} ".format(item.reblog.account.acct) not in users:
|
||||||
users.append("@{} ".format(item.reblog.account.acct))
|
users.append("@{} ".format(item.reblog.account.acct))
|
||||||
else:
|
else:
|
||||||
users = ["@{}".format(user.acct) for user in item.mentions if user.id != self.session.db["user_id"]]
|
users = ["@{} ".format(user.acct) for user in item.mentions if user.id != self.session.db["user_id"]]
|
||||||
if "@{} ".format(item.account.acct) not in users and item.account.id != self.session.db["user_id"]:
|
if "@{} ".format(item.account.acct) not in users and item.account.id != self.session.db["user_id"]:
|
||||||
users.insert(0, "@{} ".format(item.account.acct))
|
users.insert(0, "@{} ".format(item.account.acct))
|
||||||
users_str = "".join(users)
|
users_str = "".join(users)
|
||||||
@ -321,11 +321,11 @@ class BaseBuffer(base.Buffer):
|
|||||||
title = _("Conversation with {}").format(item.account.username)
|
title = _("Conversation with {}").format(item.account.username)
|
||||||
caption = _("Write your message here")
|
caption = _("Write your message here")
|
||||||
if item.reblog != None:
|
if item.reblog != None:
|
||||||
users = ["@{}".format(user.acct) for user in item.reblog.mentions if user.id != self.session.db["user_id"]]
|
users = ["@{} ".format(user.acct) for user in item.reblog.mentions if user.id != self.session.db["user_id"]]
|
||||||
if item.reblog.account.acct != item.account.acct and "@{} ".format(item.reblog.account.acct) not in users:
|
if item.reblog.account.acct != item.account.acct and "@{} ".format(item.reblog.account.acct) not in users:
|
||||||
users.append("@{} ".format(item.reblog.account.acct))
|
users.append("@{} ".format(item.reblog.account.acct))
|
||||||
else:
|
else:
|
||||||
users = ["@{}".format(user.acct) for user in item.mentions if user.id != self.session.db["user_id"]]
|
users = ["@{} ".format(user.acct) for user in item.mentions if user.id != self.session.db["user_id"]]
|
||||||
if item.account.acct not in users and item.account.id != self.session.db["user_id"]:
|
if item.account.acct not in users and item.account.id != self.session.db["user_id"]:
|
||||||
users.insert(0, "@{} ".format(item.account.acct))
|
users.insert(0, "@{} ".format(item.account.acct))
|
||||||
users_str = "".join(users)
|
users_str = "".join(users)
|
||||||
@ -469,6 +469,8 @@ class BaseBuffer(base.Buffer):
|
|||||||
|
|
||||||
def view_item(self):
|
def view_item(self):
|
||||||
toot = self.get_item()
|
toot = self.get_item()
|
||||||
|
# Update object so we can retrieve newer stats
|
||||||
|
toot = self.session.api.status(id=toot.id)
|
||||||
print(toot)
|
print(toot)
|
||||||
msg = messages.viewToot(toot, offset_hours=self.session.db["utc_offset"], item_url=self.get_item_url())
|
msg = messages.viewToot(toot, offset_hours=self.session.db["utc_offset"], item_url=self.get_item_url())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user