Add support for custom message when sharing a query

Fix #703.