MDL-67637 core_message: only preview lastmessage text if safe to do so