Sending empty messages #15

Closed
opened 2020-10-22 07:15:07 +00:00 by koloml · 4 comments

If you try to press Enter on empty message input, Carbon will send an empty message, like this one:

{
  "type": "m.room.message",
  "sender": "@koloml:thecore.city",
  "content": {
    "msgtype": "m.text",
    "body": "",
    "chat.carbon.message.pending_id": "pending$1603350677789"
  },
  "origin_server_ts": 1603350679477,
  "unsigned": {
    "age": 19749
  },
  "event_id": "$R7nZZ5YGVDGX-12pSD2RmX7649-McZ9kEjmsz3HwE-Y",
  "room_id": "!GfXFsxiwTgNUhUHWms:sunbutt.faith"
}
If you try to press `Enter` on empty message input, Carbon will send an empty message, like this one: ```json { "type": "m.room.message", "sender": "@koloml:thecore.city", "content": { "msgtype": "m.text", "body": "", "chat.carbon.message.pending_id": "pending$1603350677789" }, "origin_server_ts": 1603350679477, "unsigned": { "age": 19749 }, "event_id": "$R7nZZ5YGVDGX-12pSD2RmX7649-McZ9kEjmsz3HwE-Y", "room_id": "!GfXFsxiwTgNUhUHWms:sunbutt.faith" } ```
Owner

How do you think we should check for if a message is empty? If body.trim().length is 0 ?

How do you think we should check for if a message is empty? If `body.trim().length` is `0` ?
Author

Yup. We want to refuse to send messages with such empty spaces without any other symbols. Also, maybe it's better to always trim message body before checking length. Just because browser anyway ignore additional spaces.

Yup. We want to refuse to send messages with such empty spaces without any other symbols. Also, maybe it's better to always trim message body before checking length. Just because browser anyway ignore additional spaces.
jboi added the
bug
label 2020-10-23 14:17:52 +00:00
Author

Isn't it fixed? Currently, any empty messages just not sending.

Isn't it fixed? Currently, any empty messages just not sending.
Collaborator

36f204624f
Looks like it's fixed, closing

https://gitdab.com/cadence/Carbon/commit/36f204624f3aebc221813c220ca8e82af8556647 Looks like it's fixed, closing
bad closed this issue 2020-10-27 08:26:00 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cadence/Carbon#15
No description provided.