Rebuild some of the logic for send-message (still missing logic for local message handling.