Skip to content

Commit

Permalink
Merge pull request #327 from alexmshepherd/status_reply-patch
Browse files Browse the repository at this point in the history
Status reply patch
  • Loading branch information
halcy committed Apr 23, 2023
2 parents ba142e9 + 2905c07 commit 0e0e8cd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mastodon/statuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ def status_reply(self, to_status, status, in_reply_to_id=None, media_ids=None,
the users that are being replied to to the status text and retains
CW and visibility if not explicitly overridden.
Note that `to_status` should be a :ref:`status dict <status dict>` and not an ID.
Set `untag` to True if you want the reply to only go to the user you
are replying to, removing every other mentioned user from the
conversation.
Expand All @@ -333,7 +335,10 @@ def status_reply(self, to_status, status, in_reply_to_id=None, media_ids=None,

# Determine users to mention
mentioned_accounts = collections.OrderedDict()
mentioned_accounts[to_status.account.id] = to_status.account.acct
try:
mentioned_accounts[to_status.account.id] = to_status.account.acct
except AttributeError as e:
raise TypeError("to_status must specify a status dict!") from e

if not untag:
for account in to_status.mentions:
Expand Down

0 comments on commit 0e0e8cd

Please sign in to comment.