Split permalinkHandler into two functions: one for sending and one for receiving, since it's hackish to use a single function for both operations. Rewording docs a bit