# HG changeset patch # User Paul Boddie # Date 1507311282 -7200 # Node ID 8a08870781bb9cd6f884badb7dc142dea7136142 # Parent 0fff3a8647bc49af7e49026a22cc93b87e61d0ac Remove SENT-BY from attributes where the sender matches the user. Simplify get_timestamp, making it use get_time. diff -r 0fff3a8647bc -r 8a08870781bb imiptools/client.py --- a/imiptools/client.py Mon Sep 18 20:36:21 2017 +0200 +++ b/imiptools/client.py Fri Oct 06 19:34:42 2017 +0200 @@ -237,8 +237,11 @@ "Update the SENT-BY attribute of the 'attr' sender metadata." - if self.messenger and self.messenger.sender != get_address(self.user): - attr["SENT-BY"] = get_uri(self.messenger.sender) + if self.messenger: + if self.messenger.sender != get_address(self.user): + attr["SENT-BY"] = get_uri(self.messenger.sender) + else: + del attr["SENT-BY"] def get_periods(self, obj, explicit_only=False, future_only=False): diff -r 0fff3a8647bc -r 8a08870781bb imiptools/dates.py --- a/imiptools/dates.py Mon Sep 18 20:36:21 2017 +0200 +++ b/imiptools/dates.py Fri Oct 06 19:34:42 2017 +0200 @@ -453,8 +453,7 @@ "Return the current time as an iCalendar-compatible string." - offset = offset or timedelta(0) - return format_datetime(to_timezone(datetime.utcnow(), "UTC") + offset) + return format_datetime(get_time(offset)) def get_date(offset=None):