Browse Source

Add option to request more history from phone on login

Tulir Asokan 3 năm trước cách đây
mục cha
commit
d94cd6a669
3 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 1 0
      config/bridge.go
  2. 3 0
      example-config.yaml
  3. 1 0
      main.go

+ 1 - 0
config/bridge.go

@@ -44,6 +44,7 @@ type BridgeConfig struct {
 		MaxAge               int64 `yaml:"max_age"`
 		Backfill             bool  `yaml:"backfill"`
 		DoublePuppetBackfill bool  `yaml:"double_puppet_backfill"`
+		RequestFullSync      bool  `yaml:"request_full_sync"`
 	} `yaml:"history_sync"`
 	UserAvatarSync    bool `yaml:"user_avatar_sync"`
 	BridgeMatrixLeave bool `yaml:"bridge_matrix_leave"`

+ 3 - 0
example-config.yaml

@@ -107,6 +107,9 @@ bridge:
         # Whether to use custom puppet for backfilling.
         # In order to use this, the custom puppets must be in the appservice's user ID namespace.
         double_puppet_backfill: false
+        # Whether the client should request a full sync from the phone when logging in.
+        # This bumps the size of history syncs from 3 months to 1 year.
+        request_full_sync: false
     # Whether or not puppet avatars should be fetched from the server even if an avatar is already set.
     user_avatar_sync: true
     # Whether or not Matrix users leaving groups should be bridged to WhatsApp

+ 1 - 0
main.go

@@ -291,6 +291,7 @@ func (bridge *Bridge) Init() {
 	store.BaseClientPayload.UserAgent.OsVersion = proto.String(WAVersion)
 	store.BaseClientPayload.UserAgent.OsBuildNumber = proto.String(WAVersion)
 	store.CompanionProps.Os = proto.String(bridge.Config.WhatsApp.OSName)
+	store.CompanionProps.RequireFullSync = proto.Bool(bridge.Config.Bridge.HistorySync.RequestFullSync)
 	versionParts := strings.Split(WAVersion, ".")
 	if len(versionParts) > 2 {
 		primary, _ := strconv.Atoi(versionParts[0])