Documentation
¶
Index ¶
- Constants
- func AggRateLimits(rlimits []chat1.RateLimit) (res []chat1.RateLimit)
- func AggRateLimitsP(rlimits []*chat1.RateLimit) (res []chat1.RateLimit)
- func AllChatConversationStatuses() (res []chat1.ConversationStatus)
- func Collar(lower int, ideal int, upper int) int
- func CreateTopicNameState(cmp chat1.ConversationIDMessageIDPairs) (chat1.TopicNameState, error)
- func FilterByType(msgs []chat1.MessageUnboxed, query *chat1.GetThreadQuery, ...) (res []chat1.MessageUnboxed)
- func GetSupersedes(msg chat1.MessageUnboxed) ([]chat1.MessageID, error)
- func GetTopicName(conv chat1.ConversationLocal) string
- func IsConvEmpty(conv chat1.Conversation) bool
- func IsVisibleChatMessageType(messageType chat1.MessageType) bool
- func NewChatTopicID() (id []byte, err error)
- func NotificationInfoSet(settings *chat1.ConversationNotificationInfo, apptype keybase1.DeviceType, ...)
- func ParseAndDecorateAtMentionedUIDs(ctx context.Context, body string, upak libkb.UPAKLoader, debug *DebugLabeler) (newBody string, atRes []gregor1.UID, chanRes chat1.ChannelMention)
- func ParseAtMentionedUIDs(ctx context.Context, body string, upak libkb.UPAKLoader, debug *DebugLabeler) (atRes []gregor1.UID, chanRes chat1.ChannelMention)
- func ParseAtMentionsNames(ctx context.Context, body string) (res []string)
- func ParseDurationExtended(s string) (d time.Duration, err error)
- func ParseTimeFromRFC3339OrDurationFromPast(g *globals.Context, s string) (t time.Time, err error)
- func PluckConvIDs(convs []chat1.Conversation) (res []chat1.ConversationID)
- func PluckConvIDsLocal(convs []chat1.ConversationLocal) (res []chat1.ConversationID)
- func PluckMessageIDs(msgs []chat1.MessageSummary) []chat1.MessageID
- func ReorderParticipants(ctx context.Context, uloader ReorderUsernameSource, tlfname string, ...) (writerNames []string, readerNames []string, err error)
- func SanitizeTopicName(topicName string) string
- func VisibleChatConversationStatuses() (res []chat1.ConversationStatus)
- func VisibleChatMessageTypes() []chat1.MessageType
- type BadTLFNameError
- type ByConvID
- type ConvByConvID
- type ConvLocalByConvID
- type ConvLocalByTopicName
- type ConversationStatusBehavior
- type DebugLabeler
- type NoSuchNameError
- type NoSuchUserError
- type ReorderUsernameSource
- type TlfNameNotCanonical
Constants ¶
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" )
const ( ChatTopicIDLen = 16 ChatTopicIDSuffix = 0x20 )
Variables ¶
This section is empty.
Functions ¶
func AggRateLimitsP ¶
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 CreateTopicNameState ¶
func CreateTopicNameState(cmp chat1.ConversationIDMessageIDPairs) (chat1.TopicNameState, error)
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 GetSupersedes ¶
func GetSupersedes(msg chat1.MessageUnboxed) ([]chat1.MessageID, error)
GetSupersedes must be called with a valid msg
func GetTopicName ¶
func GetTopicName(conv chat1.ConversationLocal) string
func IsConvEmpty ¶
func IsConvEmpty(conv chat1.Conversation) bool
func IsVisibleChatMessageType ¶
func IsVisibleChatMessageType(messageType chat1.MessageType) bool
func NewChatTopicID ¶
func NotificationInfoSet ¶
func NotificationInfoSet(settings *chat1.ConversationNotificationInfo, apptype keybase1.DeviceType, kind chat1.NotificationKind, enabled bool)
func ParseAndDecorateAtMentionedUIDs ¶
func ParseAndDecorateAtMentionedUIDs(ctx context.Context, body string, upak libkb.UPAKLoader, debug *DebugLabeler) (newBody string, atRes []gregor1.UID, chanRes chat1.ChannelMention)
func ParseAtMentionedUIDs ¶
func ParseAtMentionedUIDs(ctx context.Context, body string, upak libkb.UPAKLoader, debug *DebugLabeler) (atRes []gregor1.UID, chanRes chat1.ChannelMention)
func ParseAtMentionsNames ¶
func ParseDurationExtended ¶
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 PluckConvIDs ¶
func PluckConvIDs(convs []chat1.Conversation) (res []chat1.ConversationID)
func PluckConvIDsLocal ¶
func PluckConvIDsLocal(convs []chat1.ConversationLocal) (res []chat1.ConversationID)
func PluckMessageIDs ¶
func PluckMessageIDs(msgs []chat1.MessageSummary) []chat1.MessageID
func ReorderParticipants ¶
func ReorderParticipants(ctx context.Context, uloader ReorderUsernameSource, tlfname string, activeList []gregor1.UID) (writerNames []string, readerNames []string, err error)
Reorder participants 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 SanitizeTopicName ¶
func VisibleChatConversationStatuses ¶
func VisibleChatConversationStatuses() (res []chat1.ConversationStatus)
Which convs show in the inbox.
func VisibleChatMessageTypes ¶
func VisibleChatMessageTypes() []chat1.MessageType
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
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 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 {
// contains filtered or unexported fields
}
func NewDebugLabeler ¶
func NewDebugLabeler(log logger.Logger, label string, verbose bool) DebugLabeler
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 ReorderUsernameSource ¶
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