This has the following advantages:
- Works while all resources are offline (persistent channels)
- Helps with combating duplicate messages when sent to different
resources, resources going offline, carbon-copying etc. etc.
As a side effect, this also makes the MUC PMs not be MUC PMs and
always be emitted from the server-wide JID of the sending user.
Fixes#3313.
Some duplication is avoided, but most importantly: it’s much much cleaner,
easier to find, functions have been cleaned up (functools.partial usages are
now hidden), etc.