Skip to content

Commit

Permalink
Fix for #469 compose shows error now when length too long
Browse files Browse the repository at this point in the history
  • Loading branch information
danschwarz committed Mar 3, 2024
1 parent e1be3a6 commit 2cbb792
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions toot/tui/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ def post(self, button):
self.set_error_message("Cannot post an empty message")
return

if len(content) > self.max_chars:
self.set_error_message(f"Message exceeds maximum length of {self.max_chars} characters")
return

in_reply_to_id = self.in_reply_to.id if self.in_reply_to else None
self._emit("post", content, warning, self.visibility, in_reply_to_id)

Expand Down

0 comments on commit 2cbb792

Please sign in to comment.