aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2019-10-12 19:26:57 +0200
committerLorenz Diener <[email protected]>2019-10-12 19:26:57 +0200
commit5e776519ef53f165f6c099e8312e0510cef9fc08 (patch)
treeb9e2688563dc6aaa1919d8095b1c97913c2c880a /mastodon/Mastodon.py
parent50717ce548c0fd193a48348a539548842f9c3bb3 (diff)
downloadmastodon.py-5e776519ef53f165f6c099e8312e0510cef9fc08.tar.gz
Clean up status_reply a little (fixes #189)
Diffstat (limited to 'mastodon/Mastodon.py')
-rw-r--r--mastodon/Mastodon.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index b6bcfd3..dfac4d0 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -1611,9 +1611,10 @@ class Mastodon:
1611 return self.status_post(status) 1611 return self.status_post(status)
1612 1612
1613 @api_version("1.0.0", "2.8.0", __DICT_VERSION_STATUS) 1613 @api_version("1.0.0", "2.8.0", __DICT_VERSION_STATUS)
1614 def status_reply(self, to_status, status, media_ids=None, sensitive=False, visibility=None, 1614 def status_reply(self, to_status, status, in_reply_to_id=None, media_ids=None,
1615 spoiler_text=None, language=None, idempotency_key=None, content_type=None, 1615 sensitive=False, visibility=None, spoiler_text=None,
1616 scheduled_at=None, poll=None, untag=False): 1616 language=None, idempotency_key=None, content_type=None,
1617 scheduled_at=None, poll=None, untag=False):
1617 """ 1618 """
1618 Helper function - acts like status_post, but prepends the name of all 1619 Helper function - acts like status_post, but prepends the name of all
1619 the users that are being replied to to the status text and retains 1620 the users that are being replied to to the status text and retains
@@ -1623,6 +1624,11 @@ class Mastodon:
1623 are replying to, removing every other mentioned user from the 1624 are replying to, removing every other mentioned user from the
1624 conversation. 1625 conversation.
1625 """ 1626 """
1627 keyword_args = locals()
1628 del keyword_args["self"]
1629 del keyword_args["to_status"]
1630 del keyword_args["untag"]
1631
1626 user_id = self.__get_logged_in_id() 1632 user_id = self.__get_logged_in_id()
1627 1633
1628 # Determine users to mention 1634 # Determine users to mention
@@ -1642,11 +1648,12 @@ class Mastodon:
1642 visibility = to_status.visibility 1648 visibility = to_status.visibility
1643 if spoiler_text == None and 'spoiler_text' in to_status: 1649 if spoiler_text == None and 'spoiler_text' in to_status:
1644 spoiler_text = to_status.spoiler_text 1650 spoiler_text = to_status.spoiler_text
1645 1651
1646 return self.status_post(status, in_reply_to_id = to_status.id, media_ids = media_ids, sensitive = sensitive, 1652 keyword_args["status"] = status
1647 visibility = visibility, spoiler_text = spoiler_text, language = language, 1653 keyword_args["visibility"] = visibility
1648 idempotency_key = idempotency_key, content_type = content_type, 1654 keyword_args["spoiler_text"] = spoiler_text
1649 scheduled_at = scheduled_at, poll = poll) 1655 keyword_args["in_reply_to_id"] = to_status.id
1656 return self.status_post(**keyword_args)
1650 1657
1651 @api_version("2.8.0", "2.8.0", __DICT_VERSION_POLL) 1658 @api_version("2.8.0", "2.8.0", __DICT_VERSION_POLL)
1652 def make_poll(self, options, expires_in, multiple=False, hide_totals=False): 1659 def make_poll(self, options, expires_in, multiple=False, hide_totals=False):
Powered by cgit v1.2.3 (git 2.41.0)