utils

package
v0.0.0-...-52f30ea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause Imports: 34 Imported by: 152

Documentation

Index

Constants

View Source
const (
	// ReaderSep is the string that separates readers from writers in a
	// TLF name.
	ReaderSep = "#"

	// TlfHandleExtensionSep is the string that separates the folder
	// participants from an extension suffix in the TLF name.
	TlfHandleExtensionSep = " "

	// PublicUIDName is the name given to keybase1.PublicUID.  This string
	// should correspond to an illegal or reserved Keybase user name.
	PublicUIDName = "_public"
)
View Source
const (
	ChatTopicIDLen    = 16
	ChatTopicIDSuffix = 0x20
)
View Source
const ConvertHEICGregorKey = "convertheic"
View Source
const DisablePlaintextDesktopGregorKey = "disableplaintextdesktop"
View Source
const ServiceDecorationPrefix = `(?:^|[\s([/{:;.,!?"'])`

Start at the beginning of the line, space, or some hand picked artisanal characters

Variables

View Source
var ErrConvLockTabDeadlock = errors.New("timeout reading thread")
View Source
var ErrGetUnverifiedConvNotFound = errors.New("GetUnverifiedConv: conversation not found")
View Source
var ErrGetVerifiedConvNotFound = errors.New("GetVerifiedConv: conversation not found")

Functions

func AddUserToTLFName

func AddUserToTLFName(g *globals.Context, tlfName string, vis keybase1.TLFVisibility,
	membersType chat1.ConversationMembersType) string

func AggRateLimits

func AggRateLimits(rlimits []chat1.RateLimit) (res []chat1.RateLimit)

func AggRateLimitsP

func AggRateLimitsP(rlimits []*chat1.RateLimit) (res []chat1.RateLimit)

AggRateLimitsP takes a list of rate limit responses and dedups them to the last one received of each category

func AllChatConversationStatuses

func AllChatConversationStatuses() (res []chat1.ConversationStatus)

func ApplyInboxQuery

func ApplyInboxQuery(ctx context.Context, debugLabeler DebugLabeler, query *chat1.GetInboxQuery, rcs []types.RemoteConversation) (res []types.RemoteConversation)

func AssertLoggedInUID

func AssertLoggedInUID(ctx context.Context, g *globals.Context) (uid gregor1.UID, err error)

func AssetsForMessage

func AssetsForMessage(g *globals.Context, msgBody chat1.MessageBody) (assets []chat1.Asset)

AssetsForMessage gathers all assets on a message

func AttachContactNames

func AttachContactNames(mctx libkb.MetaContext, participants []chat1.ConversationLocalParticipant)

AttachContactNames retrieves display names for SBS phones/emails that are in the phonebook. ConversationLocalParticipant structures are modified in place in `participants` passed in argument.

func Collar

func Collar(lower int, ideal int, upper int) int

upper bounds takes higher priority

func CreateHiddenPlaceholder

func CreateHiddenPlaceholder(msgID chat1.MessageID) chat1.MessageUnboxed

func DBConvLess

func DBConvLess(a pager.InboxEntry, b pager.InboxEntry) bool

func DecodeBase64

func DecodeBase64(enc []byte) ([]byte, error)

func DecodePagination

func DecodePagination(p *chat1.UIPagination) (res *chat1.Pagination, err error)

func DecorateBody

func DecorateBody(ctx context.Context, body string, offset, length int, decoration interface{}) (res string, added int)

func DecorateWithKBFSPath

func DecorateWithKBFSPath(
	ctx context.Context, body string, paths []chat1.KBFSPath) (
	res string)
func DecorateWithLinks(ctx context.Context, body string) string

func DecorateWithMentions

func DecorateWithMentions(ctx context.Context, body string, atMentions []string,
	maybeMentions []chat1.MaybeMention, chanMention chat1.ChannelMention,
	channelNameMentions []chat1.ChannelNameMention) string

func DedupStringLists

func DedupStringLists(lists ...[]string) (res []string)

func EphemeralLifetimeFromConv

func EphemeralLifetimeFromConv(ctx context.Context, g *globals.Context, conv chat1.ConversationLocal) (res *gregor1.DurationSec, err error)

func EscapeForDecorate

func EscapeForDecorate(ctx context.Context, body string) string

func EscapeShrugs

func EscapeShrugs(ctx context.Context, body string) string

func ExportToSummary

func ExportToSummary(i chat1.InboxUIItem) (s chat1.ConvSummary)

func FilterByType

func FilterByType(msgs []chat1.MessageUnboxed, query *chat1.GetThreadQuery, includeAllErrors bool) (res []chat1.MessageUnboxed)

FilterByType filters messages based on a query. If includeAllErrors then MessageUnboxedError are all returned. Otherwise, they are filtered based on type. Messages whose type cannot be determined are considered errors.

func FilterExploded

func FilterExploded(conv types.UnboxConversationInfo, msgs []chat1.MessageUnboxed, now time.Time) (res []chat1.MessageUnboxed)

Filter messages that are both exploded that are no longer shown in the GUI (as ash lines)

func ForceReloadUPAKsForUIDs

func ForceReloadUPAKsForUIDs(ctx context.Context, g *globals.Context, uids []keybase1.UID) error

func FormatConversationName

func FormatConversationName(info chat1.ConversationInfoLocal, myUsername string) string

func GetConvLastSendTime

func GetConvLastSendTime(rc types.RemoteConversation) gregor1.Time

func GetConvMtime

func GetConvMtime(rc types.RemoteConversation) (res gregor1.Time)

func GetConvMtimeLocal

func GetConvMtimeLocal(conv chat1.ConversationLocal) gregor1.Time

func GetConvParticipantUsernames

func GetConvParticipantUsernames(ctx context.Context, g *globals.Context, uid gregor1.UID,
	convID chat1.ConversationID) (parts []string, err error)

func GetConvPriorityScore

func GetConvPriorityScore(rc types.RemoteConversation) float64

GetConvPriorityScore weighs conversations that are fully read above ones that are not, weighting more recently modified conversations higher.. Used to order conversations when background loading.

func GetConvSnippet

func GetConvSnippet(ctx context.Context, g *globals.Context, uid gregor1.UID, conv chat1.ConversationLocal,
	currentUsername string) (chat1.SnippetDecoration, string, string)

func GetDesktopNotificationSnippet

func GetDesktopNotificationSnippet(ctx context.Context, g *globals.Context,
	uid gregor1.UID, conv *chat1.ConversationLocal, currentUsername string,
	fromMsg *chat1.MessageUnboxed, plaintextDesktopDisabled bool) string

func GetGregorBool

func GetGregorBool(ctx context.Context, g *globals.Context, key string, defaultVal bool) (bool, error)

func GetGregorConn

func GetGregorConn(ctx context.Context, g *globals.Context, log DebugLabeler,
	handler func(nist *libkb.NIST) rpc.ConnectionHandler) (conn *rpc.Connection, token gregor1.SessionToken, err error)

func GetMsgSnippet

func GetMsgSnippet(ctx context.Context, g *globals.Context, uid gregor1.UID, msg chat1.MessageUnboxed,
	conv chat1.ConversationLocal, currentUsername string) (decoration chat1.SnippetDecoration, snippet string, snippetDecorated string)

func GetMsgSnippetBody

func GetMsgSnippetBody(ctx context.Context, g *globals.Context, uid gregor1.UID, convID chat1.ConversationID,
	msg chat1.MessageUnboxed) (snippet, snippetDecorated string)

func GetMsgSummaryByType

func GetMsgSummaryByType(msgs []chat1.MessageSummary, typ chat1.MessageType) (chat1.MessageSummary, error)

func GetPaymentAtMentions

func GetPaymentAtMentions(ctx context.Context, upak libkb.UPAKLoader, payments []chat1.TextPayment,
	l *DebugLabeler) (atMentions []chat1.KnownUserMention)

func GetQueryRe

func GetQueryRe(query string) (*regexp.Regexp, error)

GetQueryRe returns a regex to match the query string on message text. This is used for result highlighting.

func GetReaction

func GetReaction(msg chat1.MessageUnboxed) (string, error)

func GetRemoteConvDisplayName

func GetRemoteConvDisplayName(rc types.RemoteConversation) string

func GetRemoteConvTLFName

func GetRemoteConvTLFName(conv types.RemoteConversation) string

func GetSupersedes

func GetSupersedes(msg chat1.MessageUnboxed) ([]chat1.MessageID, error)

GetSupersedes must be called with a valid msg

func GetTextAtMentionedItems

func GetTextAtMentionedItems(ctx context.Context, g *globals.Context, uid gregor1.UID,
	convID chat1.ConversationID, msg chat1.MessageText,
	getConvMembs func() ([]string, error),
	debug *DebugLabeler) (atRes []chat1.KnownUserMention, maybeRes []chat1.MaybeMention, chanRes chat1.ChannelMention)

func GetUnverifiedConv

func GetUnverifiedConv(ctx context.Context, g *globals.Context, uid gregor1.UID,
	convID chat1.ConversationID, dataSource types.InboxSourceDataSourceTyp) (res types.RemoteConversation, err error)

func GetVerifiedConv

func GetVerifiedConv(ctx context.Context, g *globals.Context, uid gregor1.UID,
	convID chat1.ConversationID, dataSource types.InboxSourceDataSourceTyp) (res chat1.ConversationLocal, err error)

func IsBadgeableMessageType

func IsBadgeableMessageType(messageType chat1.MessageType) bool

func IsCollapsibleMessageType

func IsCollapsibleMessageType(messageType chat1.MessageType) bool

func IsConvEmpty

func IsConvEmpty(conv chat1.Conversation) bool

func IsDeleteableByDeleteMessageType

func IsDeleteableByDeleteMessageType(valid chat1.MessageUnboxedValid) bool

func IsDeletedConvError

func IsDeletedConvError(err error) bool

func IsEditableByEditMessageType

func IsEditableByEditMessageType(messageType chat1.MessageType) bool

func IsMapUnfurl

func IsMapUnfurl(msg chat1.MessageUnboxed) bool

func IsNonEmptyConvMessageType

func IsNonEmptyConvMessageType(messageType chat1.MessageType) bool

func IsNotifiableChatMessageType

func IsNotifiableChatMessageType(messageType chat1.MessageType, atMentions []gregor1.UID,
	chanMention chat1.ChannelMention) bool

func IsPermanentErr

func IsPermanentErr(err error) bool

func IsSnippetChatMessageType

func IsSnippetChatMessageType(messageType chat1.MessageType) bool

func IsVisibleChatMessageType

func IsVisibleChatMessageType(messageType chat1.MessageType) bool

func MessageIDControlToPagination

func MessageIDControlToPagination(ctx context.Context, logger DebugLabeler, control *chat1.MessageIDControl,
	conv *types.RemoteConversation) (res *chat1.Pagination)

func NewChatTopicID

func NewChatTopicID() (id []byte, err error)

func NormalizeAssertionOrName

func NormalizeAssertionOrName(mctx libkb.MetaContext, s string) (string, error)

TODO: this function can likely be replaced with a call to AssertionParseAndOnly when CORE-2967 and CORE-2968 are fixed.

func NormalizeNamesInTLF

func NormalizeNamesInTLF(mctx libkb.MetaContext, writerNames, readerNames []string,
	extensionSuffix string) (string, error)

normalizeNamesInTLF takes a split TLF name and, without doing any resolutions or identify calls, normalizes all elements of the name. It then returns the normalized name.

func NotificationInfoSet

func NotificationInfoSet(settings *chat1.ConversationNotificationInfo,
	apptype keybase1.DeviceType,
	kind chat1.NotificationKind, enabled bool)

func ParseAtMentionedItems

func ParseAtMentionedItems(ctx context.Context, g *globals.Context, body string,
	knownMentions []chat1.KnownUserMention, getConvMembs func() ([]string, error)) (atRes []chat1.KnownUserMention, maybeRes []chat1.MaybeMention, chanRes chat1.ChannelMention)

func ParseChannelNameMentions

func ParseChannelNameMentions(ctx context.Context, body string, uid gregor1.UID, teamID chat1.TLFID,
	ts types.TeamChannelSource) (res []chat1.ChannelNameMention)

func ParseDurationExtended

func ParseDurationExtended(s string) (d time.Duration, err error)

parseDurationExtended is like time.ParseDuration, but adds "d" unit. "1d" is one day, defined as 24*time.Hour. Only whole days are supported for "d" unit, but it can be followed by smaller units, e.g., "1d1h".

func ParseKBFSPaths

func ParseKBFSPaths(ctx context.Context, body string) (paths []chat1.KBFSPath)

func ParseTimeFromRFC3339OrDurationFromPast

func ParseTimeFromRFC3339OrDurationFromPast(g *globals.Context, s string) (t time.Time, err error)

func PickLatestMessageSummary

func PickLatestMessageSummary(conv MessageSummaryContainer, typs []chat1.MessageType) (res chat1.MessageSummary, err error)

func PluckConvIDs

func PluckConvIDs(convs []chat1.Conversation) (res []chat1.ConversationID)

func PluckConvIDsLocal

func PluckConvIDsLocal(convs []chat1.ConversationLocal) (res []chat1.ConversationID)

func PluckConvIDsRC

func PluckConvIDsRC(convs []types.RemoteConversation) (res []chat1.ConversationID)

func PluckConvs

func PluckConvs(rcs []types.RemoteConversation) (res []chat1.Conversation)

func PluckMUMessageIDs

func PluckMUMessageIDs(msgs []chat1.MessageUnboxed) (res []chat1.MessageID)

func PluckMessageIDs

func PluckMessageIDs(msgs []chat1.MessageSummary) []chat1.MessageID

func PluckUIMessageIDs

func PluckUIMessageIDs(msgs []chat1.UIMessage) (res []chat1.MessageID)

func PresentBytes

func PresentBytes(bytes int64) string

func PresentChannelNameMentions

func PresentChannelNameMentions(ctx context.Context, crs []chat1.ChannelNameMention) (res []chat1.UIChannelNameMention)

func PresentConversationErrorLocal

func PresentConversationErrorLocal(ctx context.Context, g *globals.Context, uid gregor1.UID, rawConv chat1.ConversationErrorLocal) (res chat1.InboxUIItemError)

func PresentConversationLocal

func PresentConversationLocal(ctx context.Context, g *globals.Context, uid gregor1.UID,
	rawConv chat1.ConversationLocal, partMode PresentParticipantsMode) (res chat1.InboxUIItem)

func PresentConversationLocals

func PresentConversationLocals(ctx context.Context, g *globals.Context, uid gregor1.UID,
	convs []chat1.ConversationLocal, partMode PresentParticipantsMode) (res []chat1.InboxUIItem)

func PresentConversationParticipantsLocal

func PresentConversationParticipantsLocal(ctx context.Context, rawParticipants []chat1.ConversationLocalParticipant) (participants []chat1.UIParticipant)

func PresentDecoratedPendingTextBody

func PresentDecoratedPendingTextBody(ctx context.Context, g *globals.Context, uid gregor1.UID,
	msg chat1.MessagePlaintext) *string

func PresentDecoratedReactionMap

func PresentDecoratedReactionMap(ctx context.Context, g *globals.Context, uid gregor1.UID,
	convID chat1.ConversationID, msg chat1.MessageUnboxedValid, reactions chat1.ReactionMap) (res chat1.UIReactionMap)

func PresentDecoratedSnippet

func PresentDecoratedSnippet(ctx context.Context, g *globals.Context, body string,
	uid gregor1.UID, msgType chat1.MessageType, emojis []chat1.HarvestedEmoji) string

func PresentDecoratedTextBody

func PresentDecoratedTextBody(ctx context.Context, g *globals.Context, uid gregor1.UID,
	convID chat1.ConversationID, msg chat1.MessageUnboxedValid) *string

func PresentDecoratedTextNoMentions

func PresentDecoratedTextNoMentions(ctx context.Context, body string) string

func PresentDecoratedUserBio

func PresentDecoratedUserBio(ctx context.Context, bio string) (res string)

func PresentMessageUnboxed

func PresentMessageUnboxed(ctx context.Context, g *globals.Context, rawMsg chat1.MessageUnboxed,
	uid gregor1.UID, convID chat1.ConversationID) (res chat1.UIMessage)

func PresentMessagesUnboxed

func PresentMessagesUnboxed(ctx context.Context, g *globals.Context, msgs []chat1.MessageUnboxed,
	uid gregor1.UID, convID chat1.ConversationID) (res []chat1.UIMessage)

func PresentPagination

func PresentPagination(p *chat1.Pagination) (res *chat1.UIPagination)

func PresentRemoteConversationAsBigTeamChannelRow

func PresentRemoteConversationAsBigTeamChannelRow(ctx context.Context, rc types.RemoteConversation) (res chat1.UIInboxBigTeamChannelRow)

func PresentRemoteConversationAsSearchHit

func PresentRemoteConversationAsSearchHit(conv types.RemoteConversation, username string) chat1.UIChatSearchConvHit

func PresentRemoteConversationAsSmallTeamRow

func PresentRemoteConversationAsSmallTeamRow(ctx context.Context, rc types.RemoteConversation,
	username string) (res chat1.UIInboxSmallTeamRow)

func PresentRemoteConversations

func PresentRemoteConversations(ctx context.Context, g *globals.Context, uid gregor1.UID, rcs []types.RemoteConversation) (res []chat1.UnverifiedInboxUIItem)

func PresentRemoteConversationsAsSearchHits

func PresentRemoteConversationsAsSearchHits(convs []types.RemoteConversation, username string) (res []chat1.UIChatSearchConvHit)

func PresentThreadView

func PresentThreadView(ctx context.Context, g *globals.Context, uid gregor1.UID, tv chat1.ThreadView,
	convID chat1.ConversationID) (res chat1.UIMessages)

func RemoteConvs

func RemoteConvs(convs []chat1.Conversation) (res []types.RemoteConversation)

func RemoveUnfurl

func RemoveUnfurl(mvalid *chat1.MessageUnboxedValid, unfurlMessageID chat1.MessageID)

func ReorderParticipants

func ReorderParticipants(mctx libkb.MetaContext, g libkb.UIDMapperContext, umapper libkb.UIDMapper,
	tlfName string, verifiedMembers []string, activeList []gregor1.UID) (writerNames []chat1.ConversationLocalParticipant, err error)

ReorderParticipants based on the order in activeList. Only allows usernames from tlfname in the output. This never fails, worse comes to worst it just returns the split of tlfname.

func ReorderParticipantsKBFS

func ReorderParticipantsKBFS(mctx libkb.MetaContext, g libkb.UIDMapperContext, umapper libkb.UIDMapper,
	tlfName string, activeList []gregor1.UID) (writerNames []chat1.ConversationLocalParticipant, err error)

func ReplaceQuotedSubstrings

func ReplaceQuotedSubstrings(xs string, skipAngleQuotes bool) string

func SanitizeTopicName

func SanitizeTopicName(topicName string) string

func SearchableRemoteConversationName

func SearchableRemoteConversationName(conv types.RemoteConversation, username string) string

func SetGregorBool

func SetGregorBool(ctx context.Context, g *globals.Context, key string, disabled bool) error

func SetUnfurl

func SetUnfurl(mvalid *chat1.MessageUnboxedValid, unfurlMessageID chat1.MessageID,
	unfurl chat1.UnfurlResult)

func SplitAndNormalizeTLFName

func SplitAndNormalizeTLFName(mctx libkb.MetaContext, name string, public bool) (
	writerNames, readerNames []string,
	extensionSuffix string, err error)

func SplitTLFName

func SplitTLFName(tlfName string) []string

func StripUsernameFromConvName

func StripUsernameFromConvName(name string, username string) (res string)

func SuspendComponent

func SuspendComponent(ctx context.Context, g *globals.Context, suspendable types.Suspendable) func()

SuspendComponent will suspend a Suspendable type until the return function is called. This allows a succinct call like defer SuspendComponent(ctx, g, g.ConvLoader)() in RPC handlers wishing to lock out the conv loader.

func SuspendComponents

func SuspendComponents(ctx context.Context, g *globals.Context, suspendables []types.Suspendable) func()

func SystemMessageMentions

func SystemMessageMentions(ctx context.Context, g *globals.Context, uid gregor1.UID,
	body chat1.MessageSystem) (atMentions []gregor1.UID, chanMention chat1.ChannelMention, channelNameMentions []chat1.ChannelNameMention)

func ToLastActiveStatus

func ToLastActiveStatus(mtime gregor1.Time) chat1.LastActiveStatus

func VisibleChatConversationStatuses

func VisibleChatConversationStatuses() (res []chat1.ConversationStatus)

Which convs show in the inbox.

Types

type BadTLFNameError

type BadTLFNameError struct {
	Name string
}

BadTLFNameError indicates a top-level folder name that has an incorrect format.

func (BadTLFNameError) Error

func (e BadTLFNameError) Error() string

Error implements the error interface for BadTLFNameError.

type ByConvID

type ByConvID []chat1.ConversationID

func (ByConvID) Len

func (c ByConvID) Len() int

func (ByConvID) Less

func (c ByConvID) Less(i, j int) bool

func (ByConvID) Swap

func (c ByConvID) Swap(i, j int)

type ByMsgID

type ByMsgID []chat1.MessageID

func (ByMsgID) Len

func (m ByMsgID) Len() int

func (ByMsgID) Less

func (m ByMsgID) Less(i, j int) bool

func (ByMsgID) Swap

func (m ByMsgID) Swap(i, j int)

type ByMsgSummaryCtime

type ByMsgSummaryCtime []chat1.MessageSummary

func (ByMsgSummaryCtime) Len

func (c ByMsgSummaryCtime) Len() int

func (ByMsgSummaryCtime) Less

func (c ByMsgSummaryCtime) Less(i, j int) bool

func (ByMsgSummaryCtime) Swap

func (c ByMsgSummaryCtime) Swap(i, j int)

type ByMsgUnboxedCtime

type ByMsgUnboxedCtime []chat1.MessageUnboxed

func (ByMsgUnboxedCtime) Len

func (c ByMsgUnboxedCtime) Len() int

func (ByMsgUnboxedCtime) Less

func (c ByMsgUnboxedCtime) Less(i, j int) bool

func (ByMsgUnboxedCtime) Swap

func (c ByMsgUnboxedCtime) Swap(i, j int)

type ByMsgUnboxedMsgID

type ByMsgUnboxedMsgID []chat1.MessageUnboxed

func (ByMsgUnboxedMsgID) Len

func (c ByMsgUnboxedMsgID) Len() int

func (ByMsgUnboxedMsgID) Less

func (c ByMsgUnboxedMsgID) Less(i, j int) bool

func (ByMsgUnboxedMsgID) Swap

func (c ByMsgUnboxedMsgID) Swap(i, j int)

type Collapses

type Collapses struct {
	globals.Contextified
	DebugLabeler
	// contains filtered or unexported fields
}

func NewCollapses

func NewCollapses(g *globals.Context) *Collapses

func (*Collapses) IsCollapsed

func (c *Collapses) IsCollapsed(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID,
	msgID chat1.MessageID, msgType chat1.MessageType) bool

func (*Collapses) ToggleRange

func (c *Collapses) ToggleRange(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID,
	msgID chat1.MessageID, collapsed bool) error

func (*Collapses) ToggleSingle

func (c *Collapses) ToggleSingle(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID,
	msgID chat1.MessageID, collapsed bool) error

type ConvByConvID

type ConvByConvID []chat1.Conversation

func (ConvByConvID) Len

func (c ConvByConvID) Len() int

func (ConvByConvID) Less

func (c ConvByConvID) Less(i, j int) bool

func (ConvByConvID) Swap

func (c ConvByConvID) Swap(i, j int)

type ConvLocalByConvID

type ConvLocalByConvID []chat1.ConversationLocal

func (ConvLocalByConvID) Len

func (c ConvLocalByConvID) Len() int

func (ConvLocalByConvID) Less

func (c ConvLocalByConvID) Less(i, j int) bool

func (ConvLocalByConvID) Swap

func (c ConvLocalByConvID) Swap(i, j int)

type ConvLocalByTopicName

type ConvLocalByTopicName []chat1.ConversationLocal

func (ConvLocalByTopicName) Len

func (c ConvLocalByTopicName) Len() int

func (ConvLocalByTopicName) Less

func (c ConvLocalByTopicName) Less(i, j int) bool

func (ConvLocalByTopicName) Swap

func (c ConvLocalByTopicName) Swap(i, j int)

type ConversationLockTab

type ConversationLockTab struct {
	globals.Contextified
	sync.Mutex
	DebugLabeler
	// contains filtered or unexported fields
}

func NewConversationLockTab

func NewConversationLockTab(g *globals.Context) *ConversationLockTab

func (*ConversationLockTab) Acquire

func (c *ConversationLockTab) Acquire(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID) (blocked bool, err error)

Acquire obtains a per user per conversation lock on a per trace basis. That is, the lock is a shared lock for the current chat trace, and serves to synchronize large chat operations. If there is no chat trace, this is a no-op.

func (*ConversationLockTab) NumLocks

func (c *ConversationLockTab) NumLocks() int

func (*ConversationLockTab) Release

func (c *ConversationLockTab) Release(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID) (released bool)

func (*ConversationLockTab) SetBlockCb

func (c *ConversationLockTab) SetBlockCb(ch *chan struct{})

func (*ConversationLockTab) SetMaxAcquireRetries

func (c *ConversationLockTab) SetMaxAcquireRetries(n int)

type ConversationMemberStatusBehavior

type ConversationMemberStatusBehavior struct {
	// Whether to show the conv in the inbox
	ShowInInbox bool
	// Whether to show desktop notifications
	DesktopNotifications bool
	// Whether to send push notifications
	PushNotifications bool
	// Whether to show as part of badging
	ShowBadges bool
}

ConversationMemberStatusBehavior describes how a ConversationMemberStatus behaves

type ConversationStatusBehavior

type ConversationStatusBehavior struct {
	// Whether to show the conv in the inbox
	ShowInInbox bool
	// Whether sending to this conv sets it back to UNFILED
	SendingRemovesStatus bool
	// Whether any incoming activity sets it back to UNFILED
	ActivityRemovesStatus bool
	// Whether to show desktop notifications
	DesktopNotifications bool
	// Whether to send push notifications
	PushNotifications bool
	// Whether to show as part of badging
	ShowBadges bool
}

ConversationStatusBehavior describes how a ConversationStatus behaves

func GetConversationStatusBehavior

func GetConversationStatusBehavior(s chat1.ConversationStatus) ConversationStatusBehavior

GetConversationStatusBehavior gives information about what is allowed for a conversation status. When changing these, be sure to update gregor's postMessage as well

type DebugLabeler

type DebugLabeler struct {
	libkb.Contextified
	// contains filtered or unexported fields
}

func NewDebugLabeler

func NewDebugLabeler(g *libkb.GlobalContext, label string, verbose bool) DebugLabeler

func (DebugLabeler) Debug

func (d DebugLabeler) Debug(ctx context.Context, msg string, args ...interface{})

func (DebugLabeler) GetLog

func (d DebugLabeler) GetLog() logger.Logger

func (DebugLabeler) GetPerfLog

func (d DebugLabeler) GetPerfLog() logger.Logger

func (DebugLabeler) PerfTrace

func (d DebugLabeler) PerfTrace(ctx context.Context, err *error, format string, args ...interface{}) func()

func (DebugLabeler) Trace

func (d DebugLabeler) Trace(ctx context.Context, err *error, format string, args ...interface{}) func()

type DummyChatNotifications

type DummyChatNotifications struct{}

func (DummyChatNotifications) ChatArchiveComplete

func (DummyChatNotifications) ChatArchiveProgress

func (DummyChatNotifications) ChatAttachmentDownloadComplete

func (DummyChatNotifications) ChatAttachmentDownloadProgress

func (DummyChatNotifications) ChatAttachmentUploadProgress

func (DummyChatNotifications) ChatAttachmentUploadStart

func (DummyChatNotifications) ChatConvUpdate

func (DummyChatNotifications) ChatIdentifyUpdate

func (DummyChatNotifications) ChatInboxStale

func (DummyChatNotifications) ChatInboxSyncStarted

func (d DummyChatNotifications) ChatInboxSyncStarted(context.Context, keybase1.UID) error

func (DummyChatNotifications) ChatInboxSynced

func (DummyChatNotifications) ChatJoinedConversation

func (DummyChatNotifications) ChatKBFSToImpteamUpgrade

func (DummyChatNotifications) ChatLeftConversation

func (DummyChatNotifications) ChatParticipantsInfo

func (DummyChatNotifications) ChatPaymentInfo

func (DummyChatNotifications) ChatPromptUnfurl

func (DummyChatNotifications) ChatRequestInfo

func (DummyChatNotifications) ChatResetConversation

func (DummyChatNotifications) ChatSetConvRetention

func (DummyChatNotifications) ChatSetConvSettings

func (DummyChatNotifications) ChatSetTeamRetention

func (DummyChatNotifications) ChatSubteamRename

func (DummyChatNotifications) ChatTLFFinalize

func (DummyChatNotifications) ChatTLFResolve

func (DummyChatNotifications) ChatThreadsStale

func (DummyChatNotifications) ChatTypingUpdate

func (DummyChatNotifications) ChatWelcomeMessageLoaded

func (DummyChatNotifications) NewChatActivity

type DummyChatUI

type DummyChatUI struct{}

func (DummyChatUI) ChatBotCommandsUpdateStatus

func (r DummyChatUI) ChatBotCommandsUpdateStatus(context.Context, chat1.ChatBotCommandsUpdateStatusArg) error

func (DummyChatUI) ChatClearWatch

func (DummyChatUI) ChatCoinFlipStatus

func (r DummyChatUI) ChatCoinFlipStatus(ctx context.Context, arg chat1.ChatCoinFlipStatusArg) error

func (DummyChatUI) ChatCommandMarkdown

func (r DummyChatUI) ChatCommandMarkdown(ctx context.Context, arg chat1.ChatCommandMarkdownArg) error

func (DummyChatUI) ChatCommandStatus

func (DummyChatUI) ChatConfirmChannelDelete

func (r DummyChatUI) ChatConfirmChannelDelete(ctx context.Context, arg chat1.ChatConfirmChannelDeleteArg) (bool, error)

func (DummyChatUI) ChatGiphySearchResults

func (r DummyChatUI) ChatGiphySearchResults(ctx context.Context, arg chat1.ChatGiphySearchResultsArg) error

func (DummyChatUI) ChatGiphyToggleResultWindow

func (r DummyChatUI) ChatGiphyToggleResultWindow(ctx context.Context,
	arg chat1.ChatGiphyToggleResultWindowArg) error

func (DummyChatUI) ChatInboxConversation

func (r DummyChatUI) ChatInboxConversation(ctx context.Context, arg chat1.ChatInboxConversationArg) error

func (DummyChatUI) ChatInboxFailed

func (r DummyChatUI) ChatInboxFailed(ctx context.Context, arg chat1.ChatInboxFailedArg) error

func (DummyChatUI) ChatInboxLayout

func (r DummyChatUI) ChatInboxLayout(ctx context.Context, arg chat1.ChatInboxLayoutArg) error

func (DummyChatUI) ChatInboxUnverified

func (r DummyChatUI) ChatInboxUnverified(ctx context.Context, arg chat1.ChatInboxUnverifiedArg) error

func (DummyChatUI) ChatLoadGalleryHit

func (r DummyChatUI) ChatLoadGalleryHit(ctx context.Context, arg chat1.ChatLoadGalleryHitArg) error

func (DummyChatUI) ChatMaybeMentionUpdate

func (r DummyChatUI) ChatMaybeMentionUpdate(ctx context.Context, arg chat1.ChatMaybeMentionUpdateArg) error

func (DummyChatUI) ChatSearchBotHits

func (r DummyChatUI) ChatSearchBotHits(ctx context.Context, arg chat1.ChatSearchBotHitsArg) error

func (DummyChatUI) ChatSearchConvHits

func (r DummyChatUI) ChatSearchConvHits(ctx context.Context, arg chat1.ChatSearchConvHitsArg) error

func (DummyChatUI) ChatSearchDone

func (r DummyChatUI) ChatSearchDone(ctx context.Context, arg chat1.ChatSearchDoneArg) error

func (DummyChatUI) ChatSearchHit

func (r DummyChatUI) ChatSearchHit(ctx context.Context, arg chat1.ChatSearchHitArg) error

func (DummyChatUI) ChatSearchInboxDone

func (r DummyChatUI) ChatSearchInboxDone(ctx context.Context, arg chat1.ChatSearchInboxDoneArg) error

func (DummyChatUI) ChatSearchInboxHit

func (r DummyChatUI) ChatSearchInboxHit(ctx context.Context, arg chat1.ChatSearchInboxHitArg) error

func (DummyChatUI) ChatSearchInboxStart

func (r DummyChatUI) ChatSearchInboxStart(ctx context.Context, sessionID int) error

func (DummyChatUI) ChatSearchIndexStatus

func (r DummyChatUI) ChatSearchIndexStatus(ctx context.Context, arg chat1.ChatSearchIndexStatusArg) error

func (DummyChatUI) ChatSearchTeamHits

func (r DummyChatUI) ChatSearchTeamHits(ctx context.Context, arg chat1.ChatSearchTeamHitsArg) error

func (DummyChatUI) ChatShowManageChannels

func (r DummyChatUI) ChatShowManageChannels(ctx context.Context, arg chat1.ChatShowManageChannelsArg) error

func (DummyChatUI) ChatStellarDataConfirm

func (r DummyChatUI) ChatStellarDataConfirm(ctx context.Context, arg chat1.ChatStellarDataConfirmArg) (bool, error)

func (DummyChatUI) ChatStellarDataError

func (r DummyChatUI) ChatStellarDataError(ctx context.Context, arg chat1.ChatStellarDataErrorArg) (bool, error)

func (DummyChatUI) ChatStellarDone

func (r DummyChatUI) ChatStellarDone(ctx context.Context, arg chat1.ChatStellarDoneArg) error

func (DummyChatUI) ChatStellarShowConfirm

func (r DummyChatUI) ChatStellarShowConfirm(ctx context.Context, sessionID int) error

func (DummyChatUI) ChatThreadCached

func (r DummyChatUI) ChatThreadCached(ctx context.Context, arg chat1.ChatThreadCachedArg) error

func (DummyChatUI) ChatThreadFull

func (r DummyChatUI) ChatThreadFull(ctx context.Context, arg chat1.ChatThreadFullArg) error

func (DummyChatUI) ChatThreadStatus

func (r DummyChatUI) ChatThreadStatus(ctx context.Context, arg chat1.ChatThreadStatusArg) error

func (DummyChatUI) TriggerContactSync

func (r DummyChatUI) TriggerContactSync(context.Context, int) error

type MessageSummaryContainer

type MessageSummaryContainer interface {
	GetMaxMessage(typ chat1.MessageType) (chat1.MessageSummary, error)
}

type NoSuchNameError

type NoSuchNameError struct {
	Name string
}

NoSuchNameError indicates that the user tried to access a subdirectory entry that doesn't exist.

func (NoSuchNameError) Error

func (e NoSuchNameError) Error() string

Error implements the error interface for NoSuchNameError

type NoSuchUserError

type NoSuchUserError struct {
	Input string
}

NoSuchUserError indicates that the given user couldn't be resolved.

func (NoSuchUserError) Error

func (e NoSuchUserError) Error() string

Error implements the error interface for NoSuchUserError

func (NoSuchUserError) ToStatus

func (e NoSuchUserError) ToStatus() keybase1.Status

ToStatus implements the keybase1.ToStatusAble interface for NoSuchUserError

type NullChatUI

type NullChatUI struct{}

func (NullChatUI) ChatClearWatch

func (u NullChatUI) ChatClearWatch(context.Context, chat1.LocationWatchID) error

func (NullChatUI) ChatCoinFlipStatus

func (u NullChatUI) ChatCoinFlipStatus(context.Context, []chat1.UICoinFlipStatus) error

func (NullChatUI) ChatCommandMarkdown

func (NullChatUI) ChatConfirmChannelDelete

func (u NullChatUI) ChatConfirmChannelDelete(context.Context, chat1.ChatConfirmChannelDeleteArg) (bool, error)

func (NullChatUI) ChatGiphySearchResults

func (u NullChatUI) ChatGiphySearchResults(ctx context.Context, convID chat1.ConversationID,
	results chat1.GiphySearchResults) error

func (NullChatUI) ChatGiphyToggleResultWindow

func (u NullChatUI) ChatGiphyToggleResultWindow(ctx context.Context, convID chat1.ConversationID, show, clearInput bool) error

func (NullChatUI) ChatInboxConversation

func (u NullChatUI) ChatInboxConversation(context.Context, chat1.ChatInboxConversationArg) error

func (NullChatUI) ChatInboxFailed

func (NullChatUI) ChatInboxLayout

func (u NullChatUI) ChatInboxLayout(context.Context, string) error

func (NullChatUI) ChatInboxUnverified

func (u NullChatUI) ChatInboxUnverified(context.Context, chat1.ChatInboxUnverifiedArg) error

func (NullChatUI) ChatLoadGalleryHit

func (u NullChatUI) ChatLoadGalleryHit(context.Context, chat1.UIMessage) error

func (NullChatUI) ChatMaybeMentionUpdate

func (u NullChatUI) ChatMaybeMentionUpdate(context.Context, string, string, chat1.UIMaybeMentionInfo) error

func (NullChatUI) ChatSearchBotHits

func (u NullChatUI) ChatSearchBotHits(context.Context, chat1.UIChatSearchBotHits) error

func (NullChatUI) ChatSearchConvHits

func (u NullChatUI) ChatSearchConvHits(context.Context, chat1.UIChatSearchConvHits) error

func (NullChatUI) ChatSearchDone

func (NullChatUI) ChatSearchHit

func (NullChatUI) ChatSearchInboxDone

func (u NullChatUI) ChatSearchInboxDone(context.Context, chat1.ChatSearchInboxDoneArg) error

func (NullChatUI) ChatSearchInboxHit

func (u NullChatUI) ChatSearchInboxHit(context.Context, chat1.ChatSearchInboxHitArg) error

func (NullChatUI) ChatSearchInboxStart

func (u NullChatUI) ChatSearchInboxStart(context.Context) error

func (NullChatUI) ChatSearchIndexStatus

func (u NullChatUI) ChatSearchIndexStatus(context.Context, chat1.ChatSearchIndexStatusArg) error

func (NullChatUI) ChatSearchTeamHits

func (u NullChatUI) ChatSearchTeamHits(context.Context, chat1.UIChatSearchTeamHits) error

func (NullChatUI) ChatShowManageChannels

func (u NullChatUI) ChatShowManageChannels(context.Context, string) error

func (NullChatUI) ChatStellarDataConfirm

func (u NullChatUI) ChatStellarDataConfirm(context.Context, chat1.UIChatPaymentSummary) (bool, error)

func (NullChatUI) ChatStellarDataError

func (u NullChatUI) ChatStellarDataError(context.Context, keybase1.Status) (bool, error)

func (NullChatUI) ChatStellarDone

func (u NullChatUI) ChatStellarDone(context.Context, bool) error

func (NullChatUI) ChatStellarShowConfirm

func (u NullChatUI) ChatStellarShowConfirm(context.Context) error

func (NullChatUI) ChatThreadCached

func (u NullChatUI) ChatThreadCached(context.Context, *string) error

func (NullChatUI) ChatThreadFull

func (u NullChatUI) ChatThreadFull(context.Context, string) error

func (NullChatUI) ChatThreadStatus

func (u NullChatUI) ChatThreadStatus(context.Context, chat1.UIChatThreadStatus) error

func (NullChatUI) TriggerContactSync

func (u NullChatUI) TriggerContactSync(context.Context) error

type PresentParticipantsMode

type PresentParticipantsMode int
const (
	PresentParticipantsModeInclude PresentParticipantsMode = iota
	PresentParticipantsModeSkip
)

type RemoteConvByConvID

type RemoteConvByConvID []types.RemoteConversation

func (RemoteConvByConvID) Len

func (c RemoteConvByConvID) Len() int

func (RemoteConvByConvID) Less

func (c RemoteConvByConvID) Less(i, j int) bool

func (RemoteConvByConvID) Swap

func (c RemoteConvByConvID) Swap(i, j int)

type RemoteConvByMtime

type RemoteConvByMtime []types.RemoteConversation

func (RemoteConvByMtime) Len

func (c RemoteConvByMtime) Len() int

func (RemoteConvByMtime) Less

func (c RemoteConvByMtime) Less(i, j int) bool

func (RemoteConvByMtime) Swap

func (c RemoteConvByMtime) Swap(i, j int)

type TlfNameNotCanonical

type TlfNameNotCanonical struct {
	Name, NameToTry string
}

TlfNameNotCanonical indicates that a name isn't a canonical, and that another (not necessarily canonical) name should be tried.

func (TlfNameNotCanonical) Error

func (e TlfNameNotCanonical) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL