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 15, 2024
1 parent 1211b86 commit d395419
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions protocol/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,17 @@ const (
const (
MuteFor1MinDuration = time.Minute
MuteFor15MinsDuration = 15 * time.Minute
MuteFor1HrsDuration = time.Hour
MuteFor8HrsDuration = 8 * time.Hour
MuteFor1HrsDuration = 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
4 changes: 3 additions & 1 deletion protocol/messenger_communities.go
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,9 @@ func (m *Messenger) MuteDuration(mutedType requests.MutingVariation) (time.Time,
case MuteFor1Hr:
MuteTill = time.Now().Add(MuteFor1HrsDuration)
case MuteFor8Hr:
MuteTill = time.Now().Add(MuteFor8HrsDuration)
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 d395419

Please sign in to comment.