status-go/protocol/protobuf/sync_settings.pb.go

247 lines
9.0 KiB
Go
Raw Normal View History

Sync Settings (#2478) * Sync Settings * Added valueHandlers and Database singleton Some issues remain, need a way to comparing incoming sql.DB to check if the connection is to a different file or not. Maybe make singleton instance per filename * Added functionality to check the sqlite filename * Refactor of Database.SaveSyncSettings to be used as a handler * Implemented inteface for setting sync protobuf factories * Refactored and completed adhoc send setting sync * Tidying up * Immutability refactor * Refactor settings into dedicated package * Breakout structs * Tidy up * Refactor of bulk settings sync * Bug fixes * Addressing feedback * Fix code dropped during rebase * Fix for db closed * Fix for node config related crashes * Provisional fix for type assertion - issue 2 * Adding robust type assertion checks * Partial fix for null literal db storage and json encoding * Fix for passively handling nil sql.DB, and checking if elem has len and if len is 0 * Added test for preferred name behaviour * Adding saved sync settings to MessengerResponse * Completed granular initial sync and clock from network on save * add Settings to isEmpty * Refactor of protobufs, partially done * Added syncSetting receiver handling, some bug fixes * Fix for sticker packs * Implement inactive flag on sync protobuf factory * Refactor of types and structs * Added SettingField.CanSync functionality * Addressing rebase artifact * Refactor of Setting SELECT queries * Refactor of string return queries * VERSION bump and migration index bump * Deactiveate Sync Settings * Deactiveated preferred_name and send_status_updates Co-authored-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2022-03-23 18:47:00 +00:00
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: sync_settings.proto
package protobuf
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type SyncSetting_Type int32
const (
SyncSetting_UNKNOWN SyncSetting_Type = 0
SyncSetting_CURRENCY SyncSetting_Type = 1
SyncSetting_GIF_RECENTS SyncSetting_Type = 2
SyncSetting_GIF_FAVOURITES SyncSetting_Type = 3
SyncSetting_MESSAGES_FROM_CONTACTS_ONLY SyncSetting_Type = 4
SyncSetting_PREFERRED_NAME SyncSetting_Type = 5
SyncSetting_PREVIEW_PRIVACY SyncSetting_Type = 6
SyncSetting_PROFILE_PICTURES_SHOW_TO SyncSetting_Type = 7
SyncSetting_PROFILE_PICTURES_VISIBILITY SyncSetting_Type = 8
SyncSetting_SEND_STATUS_UPDATES SyncSetting_Type = 9
SyncSetting_STICKERS_PACKS_INSTALLED SyncSetting_Type = 10
SyncSetting_STICKERS_PACKS_PENDING SyncSetting_Type = 11
SyncSetting_STICKERS_RECENT_STICKERS SyncSetting_Type = 12
)
var SyncSetting_Type_name = map[int32]string{
0: "UNKNOWN",
1: "CURRENCY",
2: "GIF_RECENTS",
3: "GIF_FAVOURITES",
4: "MESSAGES_FROM_CONTACTS_ONLY",
5: "PREFERRED_NAME",
6: "PREVIEW_PRIVACY",
7: "PROFILE_PICTURES_SHOW_TO",
8: "PROFILE_PICTURES_VISIBILITY",
9: "SEND_STATUS_UPDATES",
10: "STICKERS_PACKS_INSTALLED",
11: "STICKERS_PACKS_PENDING",
12: "STICKERS_RECENT_STICKERS",
}
var SyncSetting_Type_value = map[string]int32{
"UNKNOWN": 0,
"CURRENCY": 1,
"GIF_RECENTS": 2,
"GIF_FAVOURITES": 3,
"MESSAGES_FROM_CONTACTS_ONLY": 4,
"PREFERRED_NAME": 5,
"PREVIEW_PRIVACY": 6,
"PROFILE_PICTURES_SHOW_TO": 7,
"PROFILE_PICTURES_VISIBILITY": 8,
"SEND_STATUS_UPDATES": 9,
"STICKERS_PACKS_INSTALLED": 10,
"STICKERS_PACKS_PENDING": 11,
"STICKERS_RECENT_STICKERS": 12,
}
func (x SyncSetting_Type) String() string {
return proto.EnumName(SyncSetting_Type_name, int32(x))
}
func (SyncSetting_Type) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_e2f7a0bce2873c78, []int{0, 0}
}
type SyncSetting struct {
Type SyncSetting_Type `protobuf:"varint,1,opt,name=type,proto3,enum=protobuf.SyncSetting_Type" json:"type,omitempty"`
Clock uint64 `protobuf:"varint,2,opt,name=clock,proto3" json:"clock,omitempty"`
// Types that are valid to be assigned to Value:
// *SyncSetting_ValueString
// *SyncSetting_ValueBytes
// *SyncSetting_ValueBool
// *SyncSetting_ValueInt64
Value isSyncSetting_Value `protobuf_oneof:"value"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SyncSetting) Reset() { *m = SyncSetting{} }
func (m *SyncSetting) String() string { return proto.CompactTextString(m) }
func (*SyncSetting) ProtoMessage() {}
func (*SyncSetting) Descriptor() ([]byte, []int) {
return fileDescriptor_e2f7a0bce2873c78, []int{0}
}
func (m *SyncSetting) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SyncSetting.Unmarshal(m, b)
}
func (m *SyncSetting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SyncSetting.Marshal(b, m, deterministic)
}
func (m *SyncSetting) XXX_Merge(src proto.Message) {
xxx_messageInfo_SyncSetting.Merge(m, src)
}
func (m *SyncSetting) XXX_Size() int {
return xxx_messageInfo_SyncSetting.Size(m)
}
func (m *SyncSetting) XXX_DiscardUnknown() {
xxx_messageInfo_SyncSetting.DiscardUnknown(m)
}
var xxx_messageInfo_SyncSetting proto.InternalMessageInfo
func (m *SyncSetting) GetType() SyncSetting_Type {
if m != nil {
return m.Type
}
return SyncSetting_UNKNOWN
}
func (m *SyncSetting) GetClock() uint64 {
if m != nil {
return m.Clock
}
return 0
}
type isSyncSetting_Value interface {
isSyncSetting_Value()
}
type SyncSetting_ValueString struct {
ValueString string `protobuf:"bytes,3,opt,name=value_string,json=valueString,proto3,oneof"`
}
type SyncSetting_ValueBytes struct {
ValueBytes []byte `protobuf:"bytes,4,opt,name=value_bytes,json=valueBytes,proto3,oneof"`
}
type SyncSetting_ValueBool struct {
ValueBool bool `protobuf:"varint,5,opt,name=value_bool,json=valueBool,proto3,oneof"`
}
type SyncSetting_ValueInt64 struct {
ValueInt64 int64 `protobuf:"varint,6,opt,name=value_int64,json=valueInt64,proto3,oneof"`
}
func (*SyncSetting_ValueString) isSyncSetting_Value() {}
func (*SyncSetting_ValueBytes) isSyncSetting_Value() {}
func (*SyncSetting_ValueBool) isSyncSetting_Value() {}
func (*SyncSetting_ValueInt64) isSyncSetting_Value() {}
func (m *SyncSetting) GetValue() isSyncSetting_Value {
if m != nil {
return m.Value
}
return nil
}
func (m *SyncSetting) GetValueString() string {
if x, ok := m.GetValue().(*SyncSetting_ValueString); ok {
return x.ValueString
}
return ""
}
func (m *SyncSetting) GetValueBytes() []byte {
if x, ok := m.GetValue().(*SyncSetting_ValueBytes); ok {
return x.ValueBytes
}
return nil
}
func (m *SyncSetting) GetValueBool() bool {
if x, ok := m.GetValue().(*SyncSetting_ValueBool); ok {
return x.ValueBool
}
return false
}
func (m *SyncSetting) GetValueInt64() int64 {
if x, ok := m.GetValue().(*SyncSetting_ValueInt64); ok {
return x.ValueInt64
}
return 0
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*SyncSetting) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*SyncSetting_ValueString)(nil),
(*SyncSetting_ValueBytes)(nil),
(*SyncSetting_ValueBool)(nil),
(*SyncSetting_ValueInt64)(nil),
}
}
func init() {
proto.RegisterEnum("protobuf.SyncSetting_Type", SyncSetting_Type_name, SyncSetting_Type_value)
proto.RegisterType((*SyncSetting)(nil), "protobuf.SyncSetting")
}
func init() {
proto.RegisterFile("sync_settings.proto", fileDescriptor_e2f7a0bce2873c78)
}
Sync Settings (#2478) * Sync Settings * Added valueHandlers and Database singleton Some issues remain, need a way to comparing incoming sql.DB to check if the connection is to a different file or not. Maybe make singleton instance per filename * Added functionality to check the sqlite filename * Refactor of Database.SaveSyncSettings to be used as a handler * Implemented inteface for setting sync protobuf factories * Refactored and completed adhoc send setting sync * Tidying up * Immutability refactor * Refactor settings into dedicated package * Breakout structs * Tidy up * Refactor of bulk settings sync * Bug fixes * Addressing feedback * Fix code dropped during rebase * Fix for db closed * Fix for node config related crashes * Provisional fix for type assertion - issue 2 * Adding robust type assertion checks * Partial fix for null literal db storage and json encoding * Fix for passively handling nil sql.DB, and checking if elem has len and if len is 0 * Added test for preferred name behaviour * Adding saved sync settings to MessengerResponse * Completed granular initial sync and clock from network on save * add Settings to isEmpty * Refactor of protobufs, partially done * Added syncSetting receiver handling, some bug fixes * Fix for sticker packs * Implement inactive flag on sync protobuf factory * Refactor of types and structs * Added SettingField.CanSync functionality * Addressing rebase artifact * Refactor of Setting SELECT queries * Refactor of string return queries * VERSION bump and migration index bump * Deactiveate Sync Settings * Deactiveated preferred_name and send_status_updates Co-authored-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2022-03-23 18:47:00 +00:00
var fileDescriptor_e2f7a0bce2873c78 = []byte{
// 447 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0xcd, 0x8e, 0xd3, 0x30,
0x10, 0x80, 0x9b, 0x36, 0xfd, 0x9b, 0x94, 0x5d, 0xcb, 0x45, 0x10, 0x2d, 0x48, 0x1b, 0x96, 0x4b,
0x4e, 0x41, 0x02, 0xc4, 0x85, 0x53, 0x9a, 0x38, 0xad, 0xd5, 0xd4, 0x89, 0x6c, 0xa7, 0x55, 0xb9,
0x58, 0xb4, 0x0a, 0xab, 0x8a, 0x2a, 0xa9, 0x36, 0x29, 0x52, 0x9e, 0x89, 0x97, 0xe0, 0xd1, 0x50,
0x12, 0xca, 0xdf, 0x9e, 0xec, 0xf9, 0xe6, 0x9b, 0xf1, 0x68, 0x64, 0x98, 0x16, 0x55, 0xb6, 0x57,
0x45, 0x5a, 0x96, 0x87, 0xec, 0xbe, 0x70, 0x4e, 0x0f, 0x79, 0x99, 0xe3, 0x51, 0x73, 0xec, 0xce,
0x5f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