Initial open source release
This commit is contained in:
commit
74992e893f
377 changed files with 118084 additions and 0 deletions
65
internal/domain/account.go
Normal file
65
internal/domain/account.go
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
package domain
|
||||
|
||||
// PasswordSettings 是账号 2FA/SRP 配置。第一阶段默认 HasPassword=false。
|
||||
type PasswordSettings struct {
|
||||
HasRecovery bool
|
||||
HasSecureValues bool
|
||||
HasPassword bool
|
||||
Hint string
|
||||
EmailUnconfirmedPattern string
|
||||
LoginEmailPattern string
|
||||
SecureRandom []byte
|
||||
}
|
||||
|
||||
// ReactionNotifyFrom stores one account-level reaction notification scope.
|
||||
type ReactionNotifyFrom string
|
||||
|
||||
const (
|
||||
ReactionNotifyFromNone ReactionNotifyFrom = "none"
|
||||
ReactionNotifyFromContacts ReactionNotifyFrom = "contacts"
|
||||
ReactionNotifyFromAll ReactionNotifyFrom = "all"
|
||||
)
|
||||
|
||||
// ReactionsNotifySettings stores the account reaction notification settings
|
||||
// consumed by account.get/setReactionsNotifySettings.
|
||||
type ReactionsNotifySettings struct {
|
||||
MessagesFrom ReactionNotifyFrom
|
||||
StoriesFrom ReactionNotifyFrom
|
||||
PollVotesFrom ReactionNotifyFrom
|
||||
ShowPreviews bool
|
||||
}
|
||||
|
||||
// PaidReactionPrivacyKind stores the account default paid reaction privacy.
|
||||
type PaidReactionPrivacyKind string
|
||||
|
||||
const (
|
||||
PaidReactionPrivacyDefault PaidReactionPrivacyKind = "default"
|
||||
PaidReactionPrivacyAnonymous PaidReactionPrivacyKind = "anonymous"
|
||||
PaidReactionPrivacyPeer PaidReactionPrivacyKind = "peer"
|
||||
)
|
||||
|
||||
// PaidReactionPrivacy is the domain representation of tg.PaidReactionPrivacy.
|
||||
type PaidReactionPrivacy struct {
|
||||
Kind PaidReactionPrivacyKind
|
||||
Peer *Peer
|
||||
}
|
||||
|
||||
// AccountReactionSettings groups account-level reaction preferences.
|
||||
type AccountReactionSettings struct {
|
||||
Notify ReactionsNotifySettings
|
||||
DefaultReaction MessageReaction
|
||||
PaidPrivacy PaidReactionPrivacy
|
||||
}
|
||||
|
||||
func DefaultAccountReactionSettings() AccountReactionSettings {
|
||||
return AccountReactionSettings{
|
||||
Notify: ReactionsNotifySettings{
|
||||
MessagesFrom: ReactionNotifyFromContacts,
|
||||
StoriesFrom: ReactionNotifyFromContacts,
|
||||
PollVotesFrom: ReactionNotifyFromContacts,
|
||||
ShowPreviews: true,
|
||||
},
|
||||
DefaultReaction: MessageReaction{Type: MessageReactionEmoji, Emoticon: "👍"},
|
||||
PaidPrivacy: PaidReactionPrivacy{Kind: PaidReactionPrivacyDefault},
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue