gmessages

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PairConsole

func PairConsole(ctx context.Context, sessionPath, qrPNG string, logger zerolog.Logger) error

PairConsole performs the explicit operator QR flow. QR tokens are refreshed every 25 seconds because the Messages Web pairing token is short-lived.

func ProductionLogger

func ProductionLogger(logger zerolog.Logger) zerolog.Logger

ProductionLogger suppresses Trace/Debug output before a logger is handed to libgm. Upstream uses those levels for encoded HTTP/protobuf response bodies, which can contain private Google Messages data and must not be retained in production logs. Info and above keep lifecycle and actionable failures visible.

Types

type IngestFunc

type IngestFunc func(sms.Input) error

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(cfg config.Config, logger zerolog.Logger, ingest IngestFunc) *Manager

func (*Manager) BeginGooglePair

func (m *Manager) BeginGooglePair(cookieInput string) (string, string, error)

func (*Manager) BeginPair

func (m *Manager) BeginPair() (string, error)

BeginPair starts the legacy QR flow. Google-account/emoji pairing is preferred.

func (*Manager) ReauthenticateGoogle

func (m *Manager) ReauthenticateGoogle(cookieInput string) error

ReauthenticateGoogle replaces only the Google browser authentication on an existing Gaia pairing. The phone pairing, crypto keys and relay identity are preserved. Fresh cookies are committed only after Google confirms that they belong to the same account that originally paired the phone.

func (*Manager) Reconnect

func (m *Manager) Reconnect() error

func (*Manager) RefreshPair

func (m *Manager) RefreshPair() (string, error)

func (*Manager) Start

func (m *Manager) Start(parent context.Context)

func (*Manager) Status

func (m *Manager) Status() Status

func (*Manager) Stop

func (m *Manager) Stop()

func (*Manager) Unpair

func (m *Manager) Unpair() error

type Status

type Status struct {
	Enabled         bool       `json:"enabled"`
	State           string     `json:"state"`
	Paired          bool       `json:"paired"`
	Connected       bool       `json:"connected"`
	PhoneResponsive bool       `json:"phoneResponsive"`
	PairingMethod   string     `json:"pairingMethod,omitempty"`
	PairingEmoji    string     `json:"pairingEmoji,omitempty"`
	AccountEmail    string     `json:"accountEmail,omitempty"`
	LastConnectedAt *time.Time `json:"lastConnectedAt,omitempty"`
	LastMessageAt   *time.Time `json:"lastMessageAt,omitempty"`
	LastError       string     `json:"lastError,omitempty"`
}

Jump to

Keyboard shortcuts

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