From 38e166ff9c62f2d2bf64193376e95bfe01f53c7c Mon Sep 17 00:00:00 2001 From: Alexandra Betouni Date: Fri, 5 Apr 2024 22:17:50 +0300 Subject: [PATCH] Adding 24hours duration for chats mute Needed for https://github.com/status-im/status-desktop/issues/13393 --- protocol/chat.go | 2 ++ protocol/messenger.go | 2 ++ protocol/messenger_communities.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/protocol/chat.go b/protocol/chat.go index 88a22128ef6..81649a7fdec 100644 --- a/protocol/chat.go +++ b/protocol/chat.go @@ -56,6 +56,7 @@ const ( MuteFor15MinsDuration = 15 * time.Minute MuteFor1HrsDuration = time.Hour MuteFor8HrsDuration = 8 * time.Hour + MuteFor24HrsDuration = 24 * time.Hour MuteFor1WeekDuration = 7 * 24 * time.Hour ) @@ -63,6 +64,7 @@ const ( MuteFor15Min requests.MutingVariation = iota + 1 MuteFor1Hr MuteFor8Hr + MuteFor24Hr MuteFor1Week MuteTillUnmuted MuteTill1Min diff --git a/protocol/messenger.go b/protocol/messenger.go index 5d8c85650df..86fcec73499 100644 --- a/protocol/messenger.go +++ b/protocol/messenger.go @@ -4393,6 +4393,8 @@ func (m *Messenger) MuteChat(request *requests.MuteChat) (time.Time, error) { MuteTill = time.Now().Add(MuteFor1HrsDuration) case MuteFor8Hr: MuteTill = time.Now().Add(MuteFor8HrsDuration) + case MuteFor24Hr: + MuteTill = time.Now().Add(MuteFor24HrsDuration) case MuteFor1Week: MuteTill = time.Now().Add(MuteFor1WeekDuration) default: diff --git a/protocol/messenger_communities.go b/protocol/messenger_communities.go index e9f199dd967..7be4736843d 100644 --- a/protocol/messenger_communities.go +++ b/protocol/messenger_communities.go @@ -1206,6 +1206,8 @@ func (m *Messenger) MuteDuration(mutedType requests.MutingVariation) (time.Time, MuteTill = time.Now().Add(MuteFor1HrsDuration) case MuteFor8Hr: MuteTill = time.Now().Add(MuteFor8HrsDuration) + case MuteFor24Hr: + MuteTill = time.Now().Add(MuteFor24HrsDuration) case MuteFor1Week: MuteTill = time.Now().Add(MuteFor1WeekDuration) default: