From 281e137d77d80ad341f70f6242f64d963488f7e7 Mon Sep 17 00:00:00 2001 From: Diogo Castro Date: Thu, 7 Sep 2023 15:29:09 +0100 Subject: [PATCH] [#112] Do not display "You are in this timezone" Problem: We received some feedback that showing "You are in this timezone" in ephemeral messages isn't very useful. It would be better to just display the converted time, like we do for all other ephemeral messages, for consitency. Solution: display the converted time. --- src/TzBot/Render.hs | 2 +- test/Test/TzBot/RenderSpec.hs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TzBot/Render.hs b/src/TzBot/Render.hs index 606ebbd..ad2f351 100644 --- a/src/TzBot/Render.hs +++ b/src/TzBot/Render.hs @@ -168,7 +168,7 @@ renderOnSuccess (ModalFlag forModal) sender timeRef timeRefSucess user = do let isNotSender = ((/=) `on` uId) sender user shouldShowThisConversion = isNotSender || forModal guard shouldShowThisConversion - Just "You are in this timezone" + Just renderedUserTime totalClockChanges = checkForClockChanges timeRef timeRefSucess userTzLabel mbClockChangeWarning = do guard $ not $ null totalClockChanges diff --git a/test/Test/TzBot/RenderSpec.hs b/test/Test/TzBot/RenderSpec.hs index eba1f01..f2dde83 100644 --- a/test/Test/TzBot/RenderSpec.hs +++ b/test/Test/TzBot/RenderSpec.hs @@ -66,7 +66,7 @@ test_renderSpec = TestGroup "Render" mkChatCase arbitraryTime1 "10am" userMoscow userMoscow2 [ convertWithoutNotes "\"10am\", 30 January 2023 in Europe/Moscow" - "You are in this timezone" + "10:00, Monday, 30 January 2023 in your timezone (Europe/Moscow)" ] , testCase "Back to author, same timezone" $ mkChatCase arbitraryTime1 "10am" userMoscow userMoscow @@ -161,7 +161,7 @@ test_renderSpec = TestGroup "Render" mkModalCase arbitraryTime1 "10am" userMoscow userMoscow [ convertWithoutNotes "\"10am\", 30 January 2023 in Europe/Moscow" - "You are in this timezone" + "10:00, Monday, 30 January 2023 in your timezone (Europe/Moscow)" ] ]