Move sharing message management into a lib

parent f6392734
Pipeline #1701 passed with stages
in 2 minutes and 18 seconds