1.1 --- a/imiptools/config.py Sat Oct 24 17:14:59 2015 +0200
1.2 +++ b/imiptools/config.py Sat Oct 24 19:44:20 2015 +0200
1.3 @@ -104,4 +104,13 @@
1.4
1.5 FREEBUSY_OFFER_DEFAULT = None
1.6
1.7 +
1.8 +
1.9 +# Policy settings.
1.10 +
1.11 +# Allow mislabelled iMIP Content-Type method parameter values for COUNTER
1.12 +# messages (seen in Kontact).
1.13 +
1.14 +IMIP_COUNTER_AS_REQUEST = True
1.15 +
1.16 # vim: tabstop=4 expandtab shiftwidth=4
2.1 --- a/imiptools/content.py Sat Oct 24 17:14:59 2015 +0200
2.2 +++ b/imiptools/content.py Sat Oct 24 19:44:20 2015 +0200
2.3 @@ -19,6 +19,7 @@
2.4 this program. If not, see <http://www.gnu.org/licenses/>.
2.5 """
2.6
2.7 +from imiptools.config import IMIP_COUNTER_AS_REQUEST
2.8 from imiptools.data import Object, parse_object, get_value
2.9
2.10 try:
2.11 @@ -51,7 +52,14 @@
2.12
2.13 # Require consistency between declared and employed methods.
2.14
2.15 - if get_value(itip, "METHOD") == method:
2.16 + itip_method = get_value(itip, "METHOD")
2.17 +
2.18 + if itip_method == method or \
2.19 + IMIP_COUNTER_AS_REQUEST and itip_method == "COUNTER" and method == "REQUEST":
2.20 +
2.21 + # Assert the object's method as the definitive one.
2.22 +
2.23 + method = itip_method
2.24
2.25 # Look for different kinds of sections.
2.26