Documentation ¶
Index ¶
- type BadgeState
- func (b *BadgeState) Clear()
- func (b *BadgeState) ConversationBadge(ctx context.Context, convID chat1.ConversationID) int
- func (b *BadgeState) ConversationBadgeStr(ctx context.Context, convIDStr chat1.ConvIDStr) int
- func (b *BadgeState) Export(ctx context.Context) (keybase1.BadgeState, error)
- func (b *BadgeState) SetLocalChatState(s LocalChatState)
- func (b *BadgeState) SetWalletAccountUnreadCount(accountID stellar1.AccountID, unreadCount int) bool
- func (b *BadgeState) UpdateWithChat(ctx context.Context, update chat1.UnreadUpdate, inboxVers chat1.InboxVers, ...)
- func (b *BadgeState) UpdateWithChatFull(ctx context.Context, update chat1.UnreadUpdateFull, isMobile bool)
- func (b *BadgeState) UpdateWithGregor(ctx context.Context, gstate gregor.State) error
- type Badger
- func (b *Badger) Clear(ctx context.Context)
- func (b *Badger) GetInboxVersionForTest(ctx context.Context) (chat1.InboxVers, error)
- func (b *Badger) PushChatFullUpdate(ctx context.Context, update chat1.UnreadUpdateFull)
- func (b *Badger) PushChatUpdate(ctx context.Context, update chat1.UnreadUpdate, inboxVers chat1.InboxVers)
- func (b *Badger) PushState(ctx context.Context, state gregor.State)
- func (b *Badger) Send(ctx context.Context) error
- func (b *Badger) SetInboxVersionSource(s InboxVersionSource)
- func (b *Badger) SetLocalChatState(s LocalChatState)
- func (b *Badger) SetWalletAccountUnreadCount(ctx context.Context, accountID stellar1.AccountID, unreadCount int)
- func (b *Badger) State() *BadgeState
- type InboxVersionSource
- type LocalChatState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadgeState ¶
BadgeState represents the number of badges on the app. It's threadsafe. Useable from both the client service and gregor server. See service:Badger for the service part that owns this.
func NewBadgeState ¶
func NewBadgeState(log logger.Logger, env *libkb.Env) *BadgeState
NewBadgeState creates a new empty BadgeState.
func NewBadgeStateForServer ¶
func NewBadgeStateForServer(log logger.Logger) *BadgeState
NewBadgeState creates a new empty BadgeState in contexts where notifications do not need to be handled.
func (*BadgeState) Clear ¶
func (b *BadgeState) Clear()
func (*BadgeState) ConversationBadge ¶
func (b *BadgeState) ConversationBadge(ctx context.Context, convID chat1.ConversationID) int
func (*BadgeState) ConversationBadgeStr ¶
func (*BadgeState) Export ¶
func (b *BadgeState) Export(ctx context.Context) (keybase1.BadgeState, error)
Exports the state summary
func (*BadgeState) SetLocalChatState ¶
func (b *BadgeState) SetLocalChatState(s LocalChatState)
func (*BadgeState) SetWalletAccountUnreadCount ¶
func (b *BadgeState) SetWalletAccountUnreadCount(accountID stellar1.AccountID, unreadCount int) bool
SetWalletAccountUnreadCount sets the unread count for a wallet account. It returns true if the call changed the unread count for accountID.
func (*BadgeState) UpdateWithChat ¶
func (b *BadgeState) UpdateWithChat(ctx context.Context, update chat1.UnreadUpdate, inboxVers chat1.InboxVers, isMobile bool)
func (*BadgeState) UpdateWithChatFull ¶
func (b *BadgeState) UpdateWithChatFull(ctx context.Context, update chat1.UnreadUpdateFull, isMobile bool)
func (*BadgeState) UpdateWithGregor ¶
UpdateWithGregor updates the badge state from a gregor state.
type Badger ¶
type Badger struct { libkb.Contextified // contains filtered or unexported fields }
Badger keeps a BadgeState up to date and broadcasts it to electron. This is the client-specific glue. The state is kept up to date by subscribing to: - All gregor state updates - All chat.activity gregor OOBMs - Logout
func NewBadger ¶
func NewBadger(g *libkb.GlobalContext) *Badger
func (*Badger) GetInboxVersionForTest ¶
func (*Badger) PushChatFullUpdate ¶
func (b *Badger) PushChatFullUpdate(ctx context.Context, update chat1.UnreadUpdateFull)
func (*Badger) PushChatUpdate ¶
func (*Badger) SetInboxVersionSource ¶
func (b *Badger) SetInboxVersionSource(s InboxVersionSource)
func (*Badger) SetLocalChatState ¶
func (b *Badger) SetLocalChatState(s LocalChatState)
func (*Badger) SetWalletAccountUnreadCount ¶
func (*Badger) State ¶
func (b *Badger) State() *BadgeState
type InboxVersionSource ¶
type LocalChatState ¶
type LocalChatState interface {
ApplyLocalChatState(context.Context, []keybase1.BadgeConversationInfo) ([]keybase1.BadgeConversationInfo, int, int)
}