Documentation
¶
Overview ¶
Package history implements best-effort message backfill through the paired phone. It is shared by the CLI (`gmcli history`) and the RPC daemon (`gmcli serve`), which is why it lives outside cmd.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LookupConversation ¶
func LookupConversation(client *gm.Client, pump *gmsync.Pump, phone string) (*gmproto.Conversation, error)
LookupConversation asks Google Messages for the conversation associated with an E.164 phone number and imports it through pump. Returns the proto so callers can read the conversation ID and name.
Types ¶
type BackfillResult ¶
type BackfillResult struct {
ConversationID string `json:"conversation_id"`
Requests int `json:"requests"`
Count int64 `json:"count"`
FetchedMessages int `json:"fetched_messages"`
SyncRecordsProcessed int `json:"sync_records_processed"`
MessagesBefore int `json:"messages_before"`
MessagesAfter int `json:"messages_after"`
MessagesAddedForChat int `json:"messages_added_for_chat"`
}
BackfillResult reports what a backfill run accomplished. Protocol records processed are counted separately from messages added to the target chat — Google's FetchMessages can return records for other conversations.
func Backfill ¶
func Backfill(ctx context.Context, st *store.Store, client *gm.Client, pump *gmsync.Pump, chat string, requests int, count int64) (BackfillResult, error)
Backfill pages FetchMessages backwards from the oldest locally-stored message in chat, importing records through pump. requests bounds the number of FetchMessages calls; count bounds records per call.