Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
Notify clients when account not active
Browse files Browse the repository at this point in the history
  • Loading branch information
stenya committed May 7, 2020
1 parent 976265a commit a179aed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ const SessionNotFound = 601

// CodeSessionsLimitReached - You've reached the session limit, log out from other device
const CodeSessionsLimitReached = 602

// AccountNotActive - acount should be purchased
const AccountNotActive = 702
7 changes: 7 additions & 0 deletions service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,13 @@ func (s *Service) RequestSessionStatus() (
log.Info("Session not found. Logging out.")
s.logOut(false)
}

// notify clients that account not active
if apiCode == types.AccountNotActive {
// notify about account status
s._evtReceiver.OnAccountStatus(session.Session, accountInfo)
return apiCode, apiErr.Message, session.Session, preferences.AccountStatus{Active: false}, err
}
}

if err != nil {
Expand Down

0 comments on commit a179aed

Please sign in to comment.