Page MenuHomePhorge

Prevent user from sending an empty message
ClosedPublic

Authored by tusooa on Jul 8 2024, 9:03 PM.
Tags
None
Referenced Files
F39735: D111.1728623036.diff
Wed, Oct 9, 10:03 PM
Unknown Object (File)
Tue, Oct 1, 2:15 AM
Unknown Object (File)
Mon, Sep 30, 12:48 AM
Unknown Object (File)
Sun, Sep 29, 8:46 AM
Unknown Object (File)
Sat, Sep 28, 12:59 PM
Unknown Object (File)
Sat, Sep 28, 12:59 PM
Unknown Object (File)
Thu, Sep 26, 7:13 PM
Unknown Object (File)
Tue, Sep 24, 4:25 PM
Subscribers

Details

Summary

This commit disables the send message action when the text box is empty, thus preventing the user from sending an empty text message.

Type: fix

Test Plan

Verify unit tests pass. Verify that the send message button is greyed out if the text box is empty. Verify that when you hit Ctrl+Enter when the text box is empty, no message is sent.

Diff Detail

Repository
rK kazv
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Jul 8 2024, 9:07 PM
Harbormaster failed remote builds in B158: Diff 269!

Why should users be prevented from sending empty messages?

Matrix Spec does not seem to have a restriction on this, and Element also supports receiving empty messages.

In D111#2237, @nannanko wrote:

Why should users be prevented from sending empty messages?

Matrix Spec does not seem to have a restriction on this, and Element also supports receiving empty messages.

I just feel it's rather useless to send an empty message and it's easy for me to misclick Ctrl+Enter

This revision is now accepted and ready to land.Jul 17 2024, 7:51 PM