Skip to content

Commit

Permalink
Auto create authKeyHash on stringSession creation
Browse files Browse the repository at this point in the history
  • Loading branch information
AmarnathCJD committed Mar 1, 2024
1 parent cd99cb4 commit 9b9cd29
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions telegram/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ type Session struct {
}

func (s *Session) Encode() string {
if s.Hash == nil || len(s.Hash) == 0 {
s.Hash = utils.Sha1Byte(s.Key)[12:20]
}
return session.NewStringSession(s.Key, s.Hash, 0, s.Hostname, s.AppID).Encode()
}

Expand Down

0 comments on commit 9b9cd29

Please sign in to comment.