messages: add next message id to chain messages