Refactor: chat sanitization into NetworkChat proc
This commit is contained in:
parent
97c74323d8
commit
00ec796c7a
2 changed files with 4 additions and 5 deletions
|
|
@ -893,15 +893,14 @@ func _on_entry_text_submitted(_value: String) -> void:
|
|||
func _send() -> void:
|
||||
if _send_pending:
|
||||
return
|
||||
var strippable_spaces := RegEx.create_from_string("(^\\s+|\\s+$)")
|
||||
var body := strippable_spaces.sub(_entry.text, "", true)
|
||||
var body := NetworkChatProtocol.sanitize_body(_entry.text)
|
||||
if body.is_empty():
|
||||
close_chat()
|
||||
return
|
||||
if _handle_editor_world_command(body):
|
||||
return
|
||||
_send_pending = true
|
||||
_pending_send_body = NetworkChatProtocol.sanitize_body(body)
|
||||
_pending_send_body = body
|
||||
_entry.editable = false
|
||||
if not _service.send_local_message(
|
||||
body,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue