def do_add_submessage(realm: Realm, sender_id: int, message_id: int, msg_type: str, content: str) -> None:
    submessage = SubMessage(sender_id=sender_id, message_id=message_id, msg_type=msg_type, content=content)
    submessage.save()
    event = dict(type='submessage', msg_type=msg_type, message_id=message_id, submessage_id=submessage.id, sender_id=sender_id, content=content)
    ums = UserMessage.objects.filter(message_id=message_id)
    target_user_ids = [um.user_profile_id for um in ums]
    send_event(realm, event, target_user_ids)
def do_add_submessage(realm: Realm, sender_id: int, message_id: int, msg_type: str, content: str) -> None:
    submessage = SubMessage(sender_id=sender_id, message_id=message_id, msg_type=msg_type, content=content)
    submessage.save()
    event = dict(type='submessage', msg_type=msg_type, message_id=message_id, submessage_id=submessage.id, sender_id=sender_id, content=content)
    ums = UserMessage.objects.filter(message_id=message_id)
    target_user_ids = [um.user_profile_id for um in ums]
    send_event(realm, event, target_user_ids)