Documentation ¶
Index ¶
- Constants
- func AddUserToTLFName(g *globals.Context, tlfName string, vis keybase1.TLFVisibility, ...) string
- func AggRateLimits(rlimits []chat1.RateLimit) (res []chat1.RateLimit)
- func AggRateLimitsP(rlimits []*chat1.RateLimit) (res []chat1.RateLimit)
- func AllChatConversationStatuses() (res []chat1.ConversationStatus)
- func AssetsForMessage(g *globals.Context, msgBody chat1.MessageBody) (assets []chat1.Asset)
- func Collar(lower int, ideal int, upper int) int
- func CreateHiddenPlaceholder(msgID chat1.MessageID) chat1.MessageUnboxed
- func CreateTopicNameState(cmp chat1.ConversationIDMessageIDPairs) (chat1.TopicNameState, error)
- func DecodeBase64(enc []byte) ([]byte, error)
- func DecodePagination(p *chat1.UIPagination) (res *chat1.Pagination, err error)
- func FilterByType(msgs []chat1.MessageUnboxed, query *chat1.GetThreadQuery, ...) (res []chat1.MessageUnboxed)
- func FilterExploded(expunge *chat1.Expunge, msgs []chat1.MessageUnboxed, now time.Time) (res []chat1.MessageUnboxed)
- func ForceReloadUPAKsForUIDs(ctx context.Context, g *globals.Context, uids []keybase1.UID) error
- func GetConvMtime(conv chat1.Conversation) gregor1.Time
- func GetConvMtimeLocal(conv chat1.ConversationLocal) gregor1.Time
- func GetConvSnippet(conv chat1.ConversationLocal, currentUsername string) (snippet, decoration string)
- func GetDesktopNotificationSnippet(conv *chat1.ConversationLocal, currentUsername string) string
- func GetGregorConn(ctx context.Context, g *globals.Context, log DebugLabeler, ...) (conn *rpc.Connection, token gregor1.SessionToken, err error)
- func GetHeadline(conv chat1.ConversationLocal) string
- func GetMsgSnippet(msg chat1.MessageUnboxed, conv chat1.ConversationLocal, currentUsername string) (snippet, decoration string)
- func GetMsgSummaryByType(msgs []chat1.MessageSummary, typ chat1.MessageType) (chat1.MessageSummary, error)
- func GetSupersedes(msg chat1.MessageUnboxed) ([]chat1.MessageID, error)
- func GetTopicName(conv chat1.ConversationLocal) string
- func IsConvEmpty(conv chat1.Conversation) bool
- func IsNotifiableChatMessageType(messageType chat1.MessageType, atMentions []gregor1.UID, ...) 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 ParseChannelNameMentions(ctx context.Context, body string, uid gregor1.UID, teamID chat1.TLFID, ...) (res []chat1.ChannelNameMention)
- func ParseDurationExtended(s string) (d time.Duration, err error)
- func ParseTimeFromRFC3339OrDurationFromPast(g *globals.Context, s string) (t time.Time, err error)
- func PickLatestMessageSummary(conv chat1.Conversation, typs []chat1.MessageType) (res chat1.MessageSummary, err error)
- func PickLatestMessageUnboxed(conv chat1.ConversationLocal, typs []chat1.MessageType) (res chat1.MessageUnboxed, err error)
- func PluckConvIDs(convs []chat1.Conversation) (res []chat1.ConversationID)
- func PluckConvIDsLocal(convs []chat1.ConversationLocal) (res []chat1.ConversationID)
- func PluckConvIDsRC(convs []types.RemoteConversation) (res []chat1.ConversationID)
- func PluckConvs(rcs []types.RemoteConversation) (res []chat1.Conversation)
- func PluckMUMessageIDs(msgs []chat1.MessageUnboxed) (res []chat1.MessageID)
- func PluckMessageIDs(msgs []chat1.MessageSummary) []chat1.MessageID
- func PluckUIMessageIDs(msgs []chat1.UIMessage) (res []chat1.MessageID)
- func PresentChannelNameMentions(ctx context.Context, crs []chat1.ChannelNameMention) (res []chat1.UIChannelNameMention)
- func PresentConversationErrorLocal(rawConv chat1.ConversationErrorLocal) (res chat1.InboxUIItemError)
- func PresentConversationLocal(rawConv chat1.ConversationLocal, currentUsername string) (res chat1.InboxUIItem)
- func PresentConversationLocals(convs []chat1.ConversationLocal, currentUsername string) (res []chat1.InboxUIItem)
- func PresentMessageUnboxed(ctx context.Context, g *globals.Context, rawMsg chat1.MessageUnboxed, ...) (res chat1.UIMessage)
- func PresentPagination(p *chat1.Pagination) (res *chat1.UIPagination)
- func PresentRemoteConversation(rc types.RemoteConversation) (res chat1.UnverifiedInboxUIItem)
- func PresentRemoteConversations(rcs []types.RemoteConversation) (res []chat1.UnverifiedInboxUIItem)
- func PresentThreadView(ctx context.Context, g *globals.Context, uid gregor1.UID, tv chat1.ThreadView, ...) (res chat1.UIMessages)
- func RemoteConvs(convs []chat1.Conversation) (res []types.RemoteConversation)
- func ReorderParticipants(mctx libkb.MetaContext, g libkb.UIDMapperContext, umapper libkb.UIDMapper, ...) (writerNames []chat1.ConversationLocalParticipant, err error)
- func SanitizeTopicName(topicName string) string
- func SplitTLFName(tlfName string) []string
- func SystemMessageMentions(ctx context.Context, body chat1.MessageSystem, upak SystemMessageUIDSource) (atMentions []gregor1.UID, chanMention chat1.ChannelMention)
- func UsernamePackageToParticipant(p libkb.UsernamePackage) chat1.ConversationLocalParticipant
- func VisibleChatConversationStatuses() (res []chat1.ConversationStatus)
- func XlateMessageIDControlToPagination(control *chat1.MessageIDControl) (res *chat1.Pagination)
- type ByConvID
- type ByMsgSummaryCtime
- type ByMsgUnboxedCtime
- type ByMsgUnboxedMsgID
- type ConvByConvID
- type ConvLocalByConvID
- type ConvLocalByTopicName
- type ConversationMemberStatusBehavior
- type ConversationStatusBehavior
- type DebugLabeler
- type RemoteConvByConvID
- type SystemMessageUIDSource
Constants ¶
const ( ChatTopicIDLen = 16 ChatTopicIDSuffix = 0x20 )
Variables ¶
This section is empty.
Functions ¶
func AddUserToTLFName ¶
func AddUserToTLFName(g *globals.Context, tlfName string, vis keybase1.TLFVisibility, membersType chat1.ConversationMembersType) string
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 AssetsForMessage ¶
assetsForMessage gathers all assets on a message
func CreateHiddenPlaceholder ¶
func CreateHiddenPlaceholder(msgID chat1.MessageID) chat1.MessageUnboxed
func CreateTopicNameState ¶
func CreateTopicNameState(cmp chat1.ConversationIDMessageIDPairs) (chat1.TopicNameState, error)
func DecodeBase64 ¶
func DecodePagination ¶
func DecodePagination(p *chat1.UIPagination) (res *chat1.Pagination, err 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 FilterExploded ¶
func FilterExploded(expunge *chat1.Expunge, 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 GetConvMtime ¶
func GetConvMtime(conv chat1.Conversation) gregor1.Time
func GetConvMtimeLocal ¶
func GetConvMtimeLocal(conv chat1.ConversationLocal) gregor1.Time
func GetConvSnippet ¶
func GetConvSnippet(conv chat1.ConversationLocal, currentUsername string) (snippet, decoration string)
func GetDesktopNotificationSnippet ¶
func GetDesktopNotificationSnippet(conv *chat1.ConversationLocal, currentUsername string) string
We don't want to display the contents of an exploding message in notifications
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 GetHeadline ¶
func GetHeadline(conv chat1.ConversationLocal) string
func GetMsgSnippet ¶
func GetMsgSnippet(msg chat1.MessageUnboxed, conv chat1.ConversationLocal, currentUsername string) (snippet, decoration string)
func GetMsgSummaryByType ¶
func GetMsgSummaryByType(msgs []chat1.MessageSummary, typ chat1.MessageType) (chat1.MessageSummary, error)
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 IsNotifiableChatMessageType ¶
func IsNotifiableChatMessageType(messageType chat1.MessageType, atMentions []gregor1.UID, chanMention chat1.ChannelMention) 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 PickLatestMessageSummary ¶
func PickLatestMessageSummary(conv chat1.Conversation, typs []chat1.MessageType) (res chat1.MessageSummary, err error)
func PickLatestMessageUnboxed ¶
func PickLatestMessageUnboxed(conv chat1.ConversationLocal, typs []chat1.MessageType) (res chat1.MessageUnboxed, err error)
PickLatestMessageUnboxed gets the latest message with one `typs`. This method can return deleted messages which have a blank body.
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 PresentChannelNameMentions ¶
func PresentChannelNameMentions(ctx context.Context, crs []chat1.ChannelNameMention) (res []chat1.UIChannelNameMention)
func PresentConversationErrorLocal ¶
func PresentConversationErrorLocal(rawConv chat1.ConversationErrorLocal) (res chat1.InboxUIItemError)
func PresentConversationLocal ¶
func PresentConversationLocal(rawConv chat1.ConversationLocal, currentUsername string) (res chat1.InboxUIItem)
func PresentConversationLocals ¶
func PresentConversationLocals(convs []chat1.ConversationLocal, currentUsername string) (res []chat1.InboxUIItem)
func PresentMessageUnboxed ¶
func PresentPagination ¶
func PresentPagination(p *chat1.Pagination) (res *chat1.UIPagination)
func PresentRemoteConversation ¶
func PresentRemoteConversation(rc types.RemoteConversation) (res chat1.UnverifiedInboxUIItem)
func PresentRemoteConversations ¶
func PresentRemoteConversations(rcs []types.RemoteConversation) (res []chat1.UnverifiedInboxUIItem)
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 ReorderParticipants ¶
func ReorderParticipants(mctx libkb.MetaContext, g libkb.UIDMapperContext, umapper libkb.UIDMapper, tlfname 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 SanitizeTopicName ¶
func SplitTLFName ¶
func SystemMessageMentions ¶
func SystemMessageMentions(ctx context.Context, body chat1.MessageSystem, upak SystemMessageUIDSource) (atMentions []gregor1.UID, chanMention chat1.ChannelMention)
func UsernamePackageToParticipant ¶
func UsernamePackageToParticipant(p libkb.UsernamePackage) chat1.ConversationLocalParticipant
func VisibleChatConversationStatuses ¶
func VisibleChatConversationStatuses() (res []chat1.ConversationStatus)
Which convs show in the inbox.
func XlateMessageIDControlToPagination ¶
func XlateMessageIDControlToPagination(control *chat1.MessageIDControl) (res *chat1.Pagination)
Types ¶
type ByConvID ¶
type ByConvID []chat1.ConversationID
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 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 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
func GetConversationMemberStatusBehavior ¶
func GetConversationMemberStatusBehavior(s chat1.ConversationMemberStatus) ConversationMemberStatusBehavior
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
func (DebugLabeler) Debug ¶
func (d DebugLabeler) Debug(ctx context.Context, msg string, args ...interface{})
func (DebugLabeler) GetLog ¶
func (d DebugLabeler) GetLog() logger.Logger
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)