Skip to content

Commit

Permalink
Adding 24hours duration for chats mute
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandraB99 committed Apr 5, 2024
1 parent 6c82a6c commit 23a96d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion protocol/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@ const (
MuteFor1MinDuration = time.Minute
MuteFor15MinsDuration = 15 * time.Minute
MuteFor1HrsDuration = time.Hour
MuteFor8HrsDuration = 8 * time.Hour
MuteFor8HrsDuration = 8 * time.Hour
MuteFor24HrsDuration = 24 * time.Hour
MuteFor1WeekDuration = 7 * 24 * time.Hour
)

const (
MuteFor15Min requests.MutingVariation = iota + 1
MuteFor1Hr
MuteFor8Hr
MuteFor24Hr
MuteFor1Week
MuteTillUnmuted
MuteTill1Min
Expand Down
2 changes: 2 additions & 0 deletions protocol/messenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -4699,6 +4699,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:
Expand Down
2 changes: 2 additions & 0 deletions protocol/messenger_communities.go
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,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:
Expand Down

0 comments on commit 23a96d0

Please sign in to comment.