mirror of
https://github.com/zulip/zulip.git
synced 2026-07-03 21:10:12 +08:00
rocketchat: Only set message content if it exists.
Not sure where those come from since we discovered this with production data. Signed-off-by: Florian Pritz <bluewind@xinu.at>
This commit is contained in:
parent
1cc2764d45
commit
c308799133
@ -648,7 +648,15 @@ def process_messages(
|
||||
def message_to_dict(message: Dict[str, Any]) -> Dict[str, Any]:
|
||||
rc_sender_id = message["u"]["_id"]
|
||||
sender_id = user_id_mapper.get(rc_sender_id)
|
||||
content = message["msg"]
|
||||
if "msg" in message:
|
||||
content = message["msg"]
|
||||
else: # nocoverage
|
||||
content = "This message imported from Rocket.Chat had no body in the data export."
|
||||
logging.info(
|
||||
"Message %s contains no message content: %s",
|
||||
message["_id"],
|
||||
message,
|
||||
)
|
||||
|
||||
if message.get("reactions"):
|
||||
reactions = list_reactions(message["reactions"])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user