processone/ejabberd — pull request #229 by weiss (2014-05-30 22:00:52+00:00)
Title: XEP-0280: Don't send v1 carbon copies back to the sender

This PR applies three somewhat related changes to `mod_carboncopy`:

1. An earlier version of XEP-0280 specified the `` and `` tags to be siblings of the `` element, whereas the current version mandates them to be parents of ``. `mod_carboncopy` supports both variants. However, the check that makes sure clients won't receive a copy of the messages they sent didn't work for the old-style schema. This is now fixed.

2. The `mod_carboncopy:is_carbon_copy/1` function now returns true not only for ``, but also for `` carbon copies.

3. The `mod_carboncopy:check_and_forward/4` function is simplified: It now uses `is_carbon_copy/1`, and multiple `case` clauses arecombined into a single one.