rocketchat: Harden parsing of custom emoji exports.

Apparently some exports have a weird `ObjectId("idstring")` typed
value here, that stringify to the actual string.
This commit is contained in:
Tim Abbott 2024-10-18 11:24:01 -07:00
parent c9375fb5ee
commit 1b171ce04d
1 changed files with 1 additions and 1 deletions

View File

@ -284,7 +284,7 @@ def build_custom_emoji(
# Map emoji file_id to emoji file data # Map emoji file_id to emoji file data
emoji_file_data = {} emoji_file_data = {}
for emoji_file in custom_emoji_data["file"]: for emoji_file in custom_emoji_data["file"]:
emoji_file_data[emoji_file["_id"]] = {"filename": emoji_file["filename"], "chunks": []} emoji_file_data[str(emoji_file["_id"])] = {"filename": emoji_file["filename"], "chunks": []}
for emoji_chunk in custom_emoji_data["chunk"]: for emoji_chunk in custom_emoji_data["chunk"]:
emoji_file_data[emoji_chunk["files_id"]]["chunks"].append(emoji_chunk["data"]) emoji_file_data[emoji_chunk["files_id"]]["chunks"].append(emoji_chunk["data"])