Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Avoid a possible message object duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdera7mane committed Jul 9, 2022
1 parent 5fa29e2 commit 7a752ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions addons/cordot/rest/api/ChannelRESTAPI.gd
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func get_messages(channel_id: int, query: Dictionary = {limit = 50}) -> Array:
if response.successful():
var messages_data: Array = parse_json(response.body.get_string_from_utf8())
for message_data in messages_data:
messages.append(entity_manager.get_or_construct_message(message_data))
messages.append(entity_manager.get_or_construct_message(message_data, true))
return messages

func get_message(channel_id: int, message_id: int) -> Message:
Expand Down Expand Up @@ -224,5 +224,5 @@ func _handle_message_response(response: HTTPResponse) -> Message:
var message: Message = null
if response.successful():
var message_data: Dictionary = parse_json(response.body.get_string_from_utf8())
message = entity_manager.get_or_construct_message(message_data)
message = entity_manager.get_or_construct_message(message_data, true)
return message
2 changes: 1 addition & 1 deletion addons/cordot/rest/api/InteractionRESTAPI.gd
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ func _handle_message_response(response: HTTPResponse) -> Message:
var message: Message = null
if response.successful():
var message_data: Dictionary = parse_json(response.body.get_string_from_utf8())
message = entity_manager.get_or_construct_message(message_data)
message = entity_manager.get_or_construct_message(message_data, true)
return message

0 comments on commit 7a752ed

Please sign in to comment.