diff --git a/internal/discord/activity.go b/internal/discord/activity.go index a9fab33..afa6c8d 100644 --- a/internal/discord/activity.go +++ b/internal/discord/activity.go @@ -120,20 +120,6 @@ func startActivityTimer(uid string) { go activityTimers[uid].Start(context.Background()) } -/* -_activityTimerExists() returns true if there is already an activity timer for -the specified uid - -WARNING: does not lock. do not call without locking. -*/ -func _activityTimerExists(uid string) bool { - if _, ok := activityTimers[uid]; !ok { - return false - } - - return true -} - /* stopActivityTimer() cancels any running timer for the given uid and removes it from the activityTimers map. @@ -142,7 +128,7 @@ func stopActivityTimer(uid string) { timerMutex.Lock() defer timerMutex.Unlock() - if _activityTimerExists(uid) { + if _, ok := activityTimers[uid]; !ok { activityTimers[uid].Cancel() delete(activityTimers, uid) }