mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
Fixed reply and toot things to make it work properly
This commit is contained in:
parent
c0654658b5
commit
c6433d8655
@ -63,7 +63,7 @@ class BaseBuffer(base.Buffer):
|
||||
response = toot.message.ShowModal()
|
||||
if response == wx.ID_OK:
|
||||
toot_data = toot.get_tweet_data()
|
||||
call_threaded(self.session.send_toot, *toot_data)
|
||||
call_threaded(self.session.send_toot, toots=toot_data)
|
||||
if hasattr(toot.message, "destroy"):
|
||||
toot.message.destroy()
|
||||
|
||||
@ -272,9 +272,9 @@ class BaseBuffer(base.Buffer):
|
||||
if response == wx.ID_OK:
|
||||
toot_data = toot.get_tweet_data()
|
||||
users = toot.get_people()
|
||||
if users == "" and item.account.id != self.session.db["user_id"]:
|
||||
users = users +"@{}".format(item.account.acct)
|
||||
call_threaded(self.session.send_toot, item.id, users, *toot_data)
|
||||
if item.account.acct not in users and item.account.id != self.session.db["user_id"]:
|
||||
users = "@{} {}".format(item.account.acct, users)
|
||||
call_threaded(self.session.send_toot, reply_to=item.id, users=users, toots=toot_data)
|
||||
if hasattr(toot.message, "destroy"):
|
||||
toot.message.destroy()
|
||||
|
||||
|
@ -142,21 +142,21 @@ class Session(base.baseSession):
|
||||
if _sound != None: self.sound.play(_sound)
|
||||
return val
|
||||
|
||||
def send_toot(self, reply_to=None, users=None, *toots):
|
||||
def send_toot(self, reply_to=None, users=None, visibility=None, toots=[]):
|
||||
""" Convenience function to send a thread. """
|
||||
in_reply_to_id = reply_to
|
||||
for obj in toots:
|
||||
if users != None:
|
||||
text = "{} {}".format(users, obj.get("text"))
|
||||
text = users+obj.get("text")
|
||||
else:
|
||||
text = obj.get("text")
|
||||
if len(obj["attachments"]) == 0:
|
||||
item = self.api_call(call_name="status_post", status=text, _sound="tweet_send.ogg", in_reply_to_id=in_reply_to_id)
|
||||
item = self.api_call(call_name="status_post", status=text, _sound="tweet_send.ogg", in_reply_to_id=in_reply_to_id, visibility=visibility)
|
||||
in_reply_to_id = item["id"]
|
||||
else:
|
||||
media_ids = []
|
||||
for i in obj["attachments"]:
|
||||
img = self.api_call("media_post", media_file=i["file"], description=i["description"])
|
||||
media_ids.append(img.id)
|
||||
item = self.api_call(call_name="status_post", status=text, _sound="tweet_send.ogg", in_reply_to_id=in_reply_to_id, media_ids=media_ids)
|
||||
item = self.api_call(call_name="status_post", status=text, _sound="tweet_send.ogg", in_reply_to_id=in_reply_to_id, media_ids=media_ids, visibility=visibility)
|
||||
in_reply_to_id = item["id"]
|
||||
|
Loading…
Reference in New Issue
Block a user