Page MenuHomePhorge

Prevent user from sending an empty message
ClosedPublic

Authored by tusooa on Jul 8 2024, 9:03 PM.

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
Branch
tusooa/stacked
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 158
Build 305: GitLab CI for kazv
Build 304: arc lint + arc unit

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