1.1 --- a/imiptools/client.py Fri Sep 11 17:32:10 2015 +0200
1.2 +++ b/imiptools/client.py Sat Sep 12 18:13:10 2015 +0200
1.3 @@ -268,9 +268,9 @@
1.4 self.sequence = obj and self.obj.get_value("SEQUENCE")
1.5 self.dtstamp = obj and self.obj.get_value("DTSTAMP")
1.6
1.7 - def is_usable(self):
1.8 + def is_usable(self, method=None):
1.9
1.10 - "Return whether the current object is usable."
1.11 + "Return whether the current object is usable with the given 'method'."
1.12
1.13 return True
1.14
2.1 --- a/imiptools/content.py Fri Sep 11 17:32:10 2015 +0200
2.2 +++ b/imiptools/content.py Sat Sep 12 18:13:10 2015 +0200
2.3 @@ -69,7 +69,7 @@
2.4 # Dispatch to a handler and obtain any response.
2.5
2.6 handler.set_object(Object({name : item}))
2.7 - if handler.is_usable():
2.8 + if handler.is_usable(method):
2.9 methods[method](handler)()
2.10
2.11 # Handler registry.
3.1 --- a/imiptools/handlers/common.py Fri Sep 11 17:32:10 2015 +0200
3.2 +++ b/imiptools/handlers/common.py Sat Sep 12 18:13:10 2015 +0200
3.3 @@ -70,12 +70,14 @@
3.4
3.5 "Common outgoing message handling functionality mix-in."
3.6
3.7 - def is_usable(self):
3.8 + def is_usable(self, method=None):
3.9 +
3.10 + "Return whether the current object is usable with the given 'method'."
3.11
3.12 - "Return whether the current object is usable."
3.13 -
3.14 - return self.obj and self.obj.get_datetime("DTSTART") and \
3.15 - (self.obj.get_datetime("DTEND") or self.obj.get_duration("DURATION"))
3.16 + return self.obj and (
3.17 + method in ("CANCEL", "REFRESH") or
3.18 + self.obj.get_datetime("DTSTART") and
3.19 + (self.obj.get_datetime("DTEND") or self.obj.get_duration("DURATION")))
3.20
3.21 def update_event_in_freebusy(self, for_organiser=True):
3.22