This repository has been archived by the owner on Jul 7, 2020. It is now read-only.
forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.go
1562 lines (1385 loc) · 38.6 KB
/
common.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Auto-generated by avdl-compiler v1.3.22 (https://github.com/keybase/node-avdl-compiler)
// Input file: avdl/chat1/common.avdl
package chat1
import (
"errors"
gregor1 "github.com/keybase/client/go/protocol/gregor1"
keybase1 "github.com/keybase/client/go/protocol/keybase1"
"github.com/keybase/go-framed-msgpack-rpc/rpc"
)
type ThreadID []byte
func (o ThreadID) DeepCopy() ThreadID {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type MessageID uint
func (o MessageID) DeepCopy() MessageID {
return o
}
type TLFConvOrdinal uint
func (o TLFConvOrdinal) DeepCopy() TLFConvOrdinal {
return o
}
type TopicID []byte
func (o TopicID) DeepCopy() TopicID {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type ConversationID []byte
func (o ConversationID) DeepCopy() ConversationID {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type TLFID []byte
func (o TLFID) DeepCopy() TLFID {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type Hash []byte
func (o Hash) DeepCopy() Hash {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type InboxVers uint64
func (o InboxVers) DeepCopy() InboxVers {
return o
}
type ConversationVers uint64
func (o ConversationVers) DeepCopy() ConversationVers {
return o
}
type OutboxID []byte
func (o OutboxID) DeepCopy() OutboxID {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type TopicNameState []byte
func (o TopicNameState) DeepCopy() TopicNameState {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type InboxVersInfo struct {
Uid gregor1.UID `codec:"uid" json:"uid"`
Vers InboxVers `codec:"vers" json:"vers"`
}
func (o InboxVersInfo) DeepCopy() InboxVersInfo {
return InboxVersInfo{
Uid: o.Uid.DeepCopy(),
Vers: o.Vers.DeepCopy(),
}
}
type ConversationExistence int
const (
ConversationExistence_ACTIVE ConversationExistence = 0
ConversationExistence_ARCHIVED ConversationExistence = 1
ConversationExistence_DELETED ConversationExistence = 2
)
func (o ConversationExistence) DeepCopy() ConversationExistence { return o }
var ConversationExistenceMap = map[string]ConversationExistence{
"ACTIVE": 0,
"ARCHIVED": 1,
"DELETED": 2,
}
var ConversationExistenceRevMap = map[ConversationExistence]string{
0: "ACTIVE",
1: "ARCHIVED",
2: "DELETED",
}
func (e ConversationExistence) String() string {
if v, ok := ConversationExistenceRevMap[e]; ok {
return v
}
return ""
}
type ConversationMembersType int
const (
ConversationMembersType_KBFS ConversationMembersType = 0
ConversationMembersType_TEAM ConversationMembersType = 1
ConversationMembersType_IMPTEAMNATIVE ConversationMembersType = 2
ConversationMembersType_IMPTEAMUPGRADE ConversationMembersType = 3
)
func (o ConversationMembersType) DeepCopy() ConversationMembersType { return o }
var ConversationMembersTypeMap = map[string]ConversationMembersType{
"KBFS": 0,
"TEAM": 1,
"IMPTEAMNATIVE": 2,
"IMPTEAMUPGRADE": 3,
}
var ConversationMembersTypeRevMap = map[ConversationMembersType]string{
0: "KBFS",
1: "TEAM",
2: "IMPTEAMNATIVE",
3: "IMPTEAMUPGRADE",
}
func (e ConversationMembersType) String() string {
if v, ok := ConversationMembersTypeRevMap[e]; ok {
return v
}
return ""
}
type SyncInboxResType int
const (
SyncInboxResType_CURRENT SyncInboxResType = 0
SyncInboxResType_INCREMENTAL SyncInboxResType = 1
SyncInboxResType_CLEAR SyncInboxResType = 2
)
func (o SyncInboxResType) DeepCopy() SyncInboxResType { return o }
var SyncInboxResTypeMap = map[string]SyncInboxResType{
"CURRENT": 0,
"INCREMENTAL": 1,
"CLEAR": 2,
}
var SyncInboxResTypeRevMap = map[SyncInboxResType]string{
0: "CURRENT",
1: "INCREMENTAL",
2: "CLEAR",
}
func (e SyncInboxResType) String() string {
if v, ok := SyncInboxResTypeRevMap[e]; ok {
return v
}
return ""
}
type MessageType int
const (
MessageType_NONE MessageType = 0
MessageType_TEXT MessageType = 1
MessageType_ATTACHMENT MessageType = 2
MessageType_EDIT MessageType = 3
MessageType_DELETE MessageType = 4
MessageType_METADATA MessageType = 5
MessageType_TLFNAME MessageType = 6
MessageType_HEADLINE MessageType = 7
MessageType_ATTACHMENTUPLOADED MessageType = 8
MessageType_JOIN MessageType = 9
MessageType_LEAVE MessageType = 10
MessageType_SYSTEM MessageType = 11
MessageType_DELETEHISTORY MessageType = 12
)
func (o MessageType) DeepCopy() MessageType { return o }
var MessageTypeMap = map[string]MessageType{
"NONE": 0,
"TEXT": 1,
"ATTACHMENT": 2,
"EDIT": 3,
"DELETE": 4,
"METADATA": 5,
"TLFNAME": 6,
"HEADLINE": 7,
"ATTACHMENTUPLOADED": 8,
"JOIN": 9,
"LEAVE": 10,
"SYSTEM": 11,
"DELETEHISTORY": 12,
}
var MessageTypeRevMap = map[MessageType]string{
0: "NONE",
1: "TEXT",
2: "ATTACHMENT",
3: "EDIT",
4: "DELETE",
5: "METADATA",
6: "TLFNAME",
7: "HEADLINE",
8: "ATTACHMENTUPLOADED",
9: "JOIN",
10: "LEAVE",
11: "SYSTEM",
12: "DELETEHISTORY",
}
type TopicType int
const (
TopicType_NONE TopicType = 0
TopicType_CHAT TopicType = 1
TopicType_DEV TopicType = 2
)
func (o TopicType) DeepCopy() TopicType { return o }
var TopicTypeMap = map[string]TopicType{
"NONE": 0,
"CHAT": 1,
"DEV": 2,
}
var TopicTypeRevMap = map[TopicType]string{
0: "NONE",
1: "CHAT",
2: "DEV",
}
type TeamType int
const (
TeamType_NONE TeamType = 0
TeamType_SIMPLE TeamType = 1
TeamType_COMPLEX TeamType = 2
)
func (o TeamType) DeepCopy() TeamType { return o }
var TeamTypeMap = map[string]TeamType{
"NONE": 0,
"SIMPLE": 1,
"COMPLEX": 2,
}
var TeamTypeRevMap = map[TeamType]string{
0: "NONE",
1: "SIMPLE",
2: "COMPLEX",
}
func (e TeamType) String() string {
if v, ok := TeamTypeRevMap[e]; ok {
return v
}
return ""
}
type NotificationKind int
const (
NotificationKind_GENERIC NotificationKind = 0
NotificationKind_ATMENTION NotificationKind = 1
)
func (o NotificationKind) DeepCopy() NotificationKind { return o }
var NotificationKindMap = map[string]NotificationKind{
"GENERIC": 0,
"ATMENTION": 1,
}
var NotificationKindRevMap = map[NotificationKind]string{
0: "GENERIC",
1: "ATMENTION",
}
type GlobalAppNotificationSetting int
const (
GlobalAppNotificationSetting_NEWMESSAGES GlobalAppNotificationSetting = 0
GlobalAppNotificationSetting_PLAINTEXTMOBILE GlobalAppNotificationSetting = 1
GlobalAppNotificationSetting_PLAINTEXTDESKTOP GlobalAppNotificationSetting = 2
)
func (o GlobalAppNotificationSetting) DeepCopy() GlobalAppNotificationSetting { return o }
var GlobalAppNotificationSettingMap = map[string]GlobalAppNotificationSetting{
"NEWMESSAGES": 0,
"PLAINTEXTMOBILE": 1,
"PLAINTEXTDESKTOP": 2,
}
var GlobalAppNotificationSettingRevMap = map[GlobalAppNotificationSetting]string{
0: "NEWMESSAGES",
1: "PLAINTEXTMOBILE",
2: "PLAINTEXTDESKTOP",
}
func (e GlobalAppNotificationSetting) String() string {
if v, ok := GlobalAppNotificationSettingRevMap[e]; ok {
return v
}
return ""
}
type GlobalAppNotificationSettings struct {
Settings map[GlobalAppNotificationSetting]bool `codec:"settings" json:"settings"`
}
func (o GlobalAppNotificationSettings) DeepCopy() GlobalAppNotificationSettings {
return GlobalAppNotificationSettings{
Settings: (func(x map[GlobalAppNotificationSetting]bool) map[GlobalAppNotificationSetting]bool {
if x == nil {
return nil
}
ret := make(map[GlobalAppNotificationSetting]bool)
for k, v := range x {
kCopy := k.DeepCopy()
vCopy := v
ret[kCopy] = vCopy
}
return ret
})(o.Settings),
}
}
type ConversationStatus int
const (
ConversationStatus_UNFILED ConversationStatus = 0
ConversationStatus_FAVORITE ConversationStatus = 1
ConversationStatus_IGNORED ConversationStatus = 2
ConversationStatus_BLOCKED ConversationStatus = 3
ConversationStatus_MUTED ConversationStatus = 4
ConversationStatus_REPORTED ConversationStatus = 5
)
func (o ConversationStatus) DeepCopy() ConversationStatus { return o }
var ConversationStatusMap = map[string]ConversationStatus{
"UNFILED": 0,
"FAVORITE": 1,
"IGNORED": 2,
"BLOCKED": 3,
"MUTED": 4,
"REPORTED": 5,
}
var ConversationStatusRevMap = map[ConversationStatus]string{
0: "UNFILED",
1: "FAVORITE",
2: "IGNORED",
3: "BLOCKED",
4: "MUTED",
5: "REPORTED",
}
func (e ConversationStatus) String() string {
if v, ok := ConversationStatusRevMap[e]; ok {
return v
}
return ""
}
type ConversationMember struct {
Uid gregor1.UID `codec:"uid" json:"uid"`
ConvID ConversationID `codec:"convID" json:"convID"`
}
func (o ConversationMember) DeepCopy() ConversationMember {
return ConversationMember{
Uid: o.Uid.DeepCopy(),
ConvID: o.ConvID.DeepCopy(),
}
}
type ConversationIDMessageIDPair struct {
ConvID ConversationID `codec:"convID" json:"convID"`
MsgID MessageID `codec:"msgID" json:"msgID"`
}
func (o ConversationIDMessageIDPair) DeepCopy() ConversationIDMessageIDPair {
return ConversationIDMessageIDPair{
ConvID: o.ConvID.DeepCopy(),
MsgID: o.MsgID.DeepCopy(),
}
}
type ConversationIDMessageIDPairs struct {
Pairs []ConversationIDMessageIDPair `codec:"pairs" json:"pairs"`
}
func (o ConversationIDMessageIDPairs) DeepCopy() ConversationIDMessageIDPairs {
return ConversationIDMessageIDPairs{
Pairs: (func(x []ConversationIDMessageIDPair) []ConversationIDMessageIDPair {
if x == nil {
return nil
}
var ret []ConversationIDMessageIDPair
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.Pairs),
}
}
type ConversationMemberStatus int
const (
ConversationMemberStatus_ACTIVE ConversationMemberStatus = 0
ConversationMemberStatus_REMOVED ConversationMemberStatus = 1
ConversationMemberStatus_LEFT ConversationMemberStatus = 2
ConversationMemberStatus_PREVIEW ConversationMemberStatus = 3
ConversationMemberStatus_RESET ConversationMemberStatus = 4
)
func (o ConversationMemberStatus) DeepCopy() ConversationMemberStatus { return o }
var ConversationMemberStatusMap = map[string]ConversationMemberStatus{
"ACTIVE": 0,
"REMOVED": 1,
"LEFT": 2,
"PREVIEW": 3,
"RESET": 4,
}
var ConversationMemberStatusRevMap = map[ConversationMemberStatus]string{
0: "ACTIVE",
1: "REMOVED",
2: "LEFT",
3: "PREVIEW",
4: "RESET",
}
func (e ConversationMemberStatus) String() string {
if v, ok := ConversationMemberStatusRevMap[e]; ok {
return v
}
return ""
}
type Pagination struct {
Next []byte `codec:"next" json:"next"`
Previous []byte `codec:"previous" json:"previous"`
Num int `codec:"num" json:"num"`
Last bool `codec:"last" json:"last"`
}
func (o Pagination) DeepCopy() Pagination {
return Pagination{
Next: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.Next),
Previous: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.Previous),
Num: o.Num,
Last: o.Last,
}
}
type RateLimit struct {
Name string `codec:"name" json:"name"`
CallsRemaining int `codec:"callsRemaining" json:"callsRemaining"`
WindowReset int `codec:"windowReset" json:"windowReset"`
MaxCalls int `codec:"maxCalls" json:"maxCalls"`
}
func (o RateLimit) DeepCopy() RateLimit {
return RateLimit{
Name: o.Name,
CallsRemaining: o.CallsRemaining,
WindowReset: o.WindowReset,
MaxCalls: o.MaxCalls,
}
}
type GetInboxQuery struct {
ConvID *ConversationID `codec:"convID,omitempty" json:"convID,omitempty"`
TopicType *TopicType `codec:"topicType,omitempty" json:"topicType,omitempty"`
TlfID *TLFID `codec:"tlfID,omitempty" json:"tlfID,omitempty"`
TlfVisibility *keybase1.TLFVisibility `codec:"tlfVisibility,omitempty" json:"tlfVisibility,omitempty"`
Before *gregor1.Time `codec:"before,omitempty" json:"before,omitempty"`
After *gregor1.Time `codec:"after,omitempty" json:"after,omitempty"`
OneChatTypePerTLF *bool `codec:"oneChatTypePerTLF,omitempty" json:"oneChatTypePerTLF,omitempty"`
Status []ConversationStatus `codec:"status" json:"status"`
MemberStatus []ConversationMemberStatus `codec:"memberStatus" json:"memberStatus"`
Existences []ConversationExistence `codec:"existences" json:"existences"`
ConvIDs []ConversationID `codec:"convIDs" json:"convIDs"`
UnreadOnly bool `codec:"unreadOnly" json:"unreadOnly"`
ReadOnly bool `codec:"readOnly" json:"readOnly"`
ComputeActiveList bool `codec:"computeActiveList" json:"computeActiveList"`
SummarizeMaxMsgs bool `codec:"summarizeMaxMsgs" json:"summarizeMaxMsgs"`
}
func (o GetInboxQuery) DeepCopy() GetInboxQuery {
return GetInboxQuery{
ConvID: (func(x *ConversationID) *ConversationID {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.ConvID),
TopicType: (func(x *TopicType) *TopicType {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TopicType),
TlfID: (func(x *TLFID) *TLFID {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TlfID),
TlfVisibility: (func(x *keybase1.TLFVisibility) *keybase1.TLFVisibility {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TlfVisibility),
Before: (func(x *gregor1.Time) *gregor1.Time {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Before),
After: (func(x *gregor1.Time) *gregor1.Time {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.After),
OneChatTypePerTLF: (func(x *bool) *bool {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.OneChatTypePerTLF),
Status: (func(x []ConversationStatus) []ConversationStatus {
if x == nil {
return nil
}
var ret []ConversationStatus
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.Status),
MemberStatus: (func(x []ConversationMemberStatus) []ConversationMemberStatus {
if x == nil {
return nil
}
var ret []ConversationMemberStatus
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.MemberStatus),
Existences: (func(x []ConversationExistence) []ConversationExistence {
if x == nil {
return nil
}
var ret []ConversationExistence
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.Existences),
ConvIDs: (func(x []ConversationID) []ConversationID {
if x == nil {
return nil
}
var ret []ConversationID
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.ConvIDs),
UnreadOnly: o.UnreadOnly,
ReadOnly: o.ReadOnly,
ComputeActiveList: o.ComputeActiveList,
SummarizeMaxMsgs: o.SummarizeMaxMsgs,
}
}
type ConversationIDTriple struct {
Tlfid TLFID `codec:"tlfid" json:"tlfid"`
TopicType TopicType `codec:"topicType" json:"topicType"`
TopicID TopicID `codec:"topicID" json:"topicID"`
}
func (o ConversationIDTriple) DeepCopy() ConversationIDTriple {
return ConversationIDTriple{
Tlfid: o.Tlfid.DeepCopy(),
TopicType: o.TopicType.DeepCopy(),
TopicID: o.TopicID.DeepCopy(),
}
}
type ConversationFinalizeInfo struct {
ResetUser string `codec:"resetUser" json:"resetUser"`
ResetDate string `codec:"resetDate" json:"resetDate"`
ResetFull string `codec:"resetFull" json:"resetFull"`
ResetTimestamp gregor1.Time `codec:"resetTimestamp" json:"resetTimestamp"`
}
func (o ConversationFinalizeInfo) DeepCopy() ConversationFinalizeInfo {
return ConversationFinalizeInfo{
ResetUser: o.ResetUser,
ResetDate: o.ResetDate,
ResetFull: o.ResetFull,
ResetTimestamp: o.ResetTimestamp.DeepCopy(),
}
}
type ConversationResolveInfo struct {
NewTLFName string `codec:"newTLFName" json:"newTLFName"`
}
func (o ConversationResolveInfo) DeepCopy() ConversationResolveInfo {
return ConversationResolveInfo{
NewTLFName: o.NewTLFName,
}
}
type Expunge struct {
Upto MessageID `codec:"upto" json:"upto"`
Basis MessageID `codec:"basis" json:"basis"`
}
func (o Expunge) DeepCopy() Expunge {
return Expunge{
Upto: o.Upto.DeepCopy(),
Basis: o.Basis.DeepCopy(),
}
}
type ConversationMetadata struct {
IdTriple ConversationIDTriple `codec:"idTriple" json:"idTriple"`
ConversationID ConversationID `codec:"conversationID" json:"conversationID"`
Visibility keybase1.TLFVisibility `codec:"visibility" json:"visibility"`
Status ConversationStatus `codec:"status" json:"status"`
MembersType ConversationMembersType `codec:"membersType" json:"membersType"`
TeamType TeamType `codec:"teamType" json:"teamType"`
Existence ConversationExistence `codec:"existence" json:"existence"`
Version ConversationVers `codec:"version" json:"version"`
FinalizeInfo *ConversationFinalizeInfo `codec:"finalizeInfo,omitempty" json:"finalizeInfo,omitempty"`
Supersedes []ConversationMetadata `codec:"supersedes" json:"supersedes"`
SupersededBy []ConversationMetadata `codec:"supersededBy" json:"supersededBy"`
ActiveList []gregor1.UID `codec:"activeList" json:"activeList"`
AllList []gregor1.UID `codec:"allList" json:"allList"`
ResetList []gregor1.UID `codec:"resetList" json:"resetList"`
}
func (o ConversationMetadata) DeepCopy() ConversationMetadata {
return ConversationMetadata{
IdTriple: o.IdTriple.DeepCopy(),
ConversationID: o.ConversationID.DeepCopy(),
Visibility: o.Visibility.DeepCopy(),
Status: o.Status.DeepCopy(),
MembersType: o.MembersType.DeepCopy(),
TeamType: o.TeamType.DeepCopy(),
Existence: o.Existence.DeepCopy(),
Version: o.Version.DeepCopy(),
FinalizeInfo: (func(x *ConversationFinalizeInfo) *ConversationFinalizeInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.FinalizeInfo),
Supersedes: (func(x []ConversationMetadata) []ConversationMetadata {
if x == nil {
return nil
}
var ret []ConversationMetadata
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.Supersedes),
SupersededBy: (func(x []ConversationMetadata) []ConversationMetadata {
if x == nil {
return nil
}
var ret []ConversationMetadata
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.SupersededBy),
ActiveList: (func(x []gregor1.UID) []gregor1.UID {
if x == nil {
return nil
}
var ret []gregor1.UID
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.ActiveList),
AllList: (func(x []gregor1.UID) []gregor1.UID {
if x == nil {
return nil
}
var ret []gregor1.UID
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.AllList),
ResetList: (func(x []gregor1.UID) []gregor1.UID {
if x == nil {
return nil
}
var ret []gregor1.UID
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.ResetList),
}
}
type ConversationNotificationInfo struct {
ChannelWide bool `codec:"channelWide" json:"channelWide"`
Settings map[keybase1.DeviceType]map[NotificationKind]bool `codec:"settings" json:"settings"`
}
func (o ConversationNotificationInfo) DeepCopy() ConversationNotificationInfo {
return ConversationNotificationInfo{
ChannelWide: o.ChannelWide,
Settings: (func(x map[keybase1.DeviceType]map[NotificationKind]bool) map[keybase1.DeviceType]map[NotificationKind]bool {
if x == nil {
return nil
}
ret := make(map[keybase1.DeviceType]map[NotificationKind]bool)
for k, v := range x {
kCopy := k.DeepCopy()
vCopy := (func(x map[NotificationKind]bool) map[NotificationKind]bool {
if x == nil {
return nil
}
ret := make(map[NotificationKind]bool)
for k, v := range x {
kCopy := k.DeepCopy()
vCopy := v
ret[kCopy] = vCopy
}
return ret
})(v)
ret[kCopy] = vCopy
}
return ret
})(o.Settings),
}
}
type ConversationReaderInfo struct {
Mtime gregor1.Time `codec:"mtime" json:"mtime"`
ReadMsgid MessageID `codec:"readMsgid" json:"readMsgid"`
MaxMsgid MessageID `codec:"maxMsgid" json:"maxMsgid"`
Status ConversationMemberStatus `codec:"status" json:"status"`
}
func (o ConversationReaderInfo) DeepCopy() ConversationReaderInfo {
return ConversationReaderInfo{
Mtime: o.Mtime.DeepCopy(),
ReadMsgid: o.ReadMsgid.DeepCopy(),
MaxMsgid: o.MaxMsgid.DeepCopy(),
Status: o.Status.DeepCopy(),
}
}
type ConversationCreatorInfo struct {
Ctime gregor1.Time `codec:"ctime" json:"ctime"`
Uid gregor1.UID `codec:"uid" json:"uid"`
}
func (o ConversationCreatorInfo) DeepCopy() ConversationCreatorInfo {
return ConversationCreatorInfo{
Ctime: o.Ctime.DeepCopy(),
Uid: o.Uid.DeepCopy(),
}
}
type ConversationCreatorInfoLocal struct {
Ctime gregor1.Time `codec:"ctime" json:"ctime"`
Username string `codec:"username" json:"username"`
}
func (o ConversationCreatorInfoLocal) DeepCopy() ConversationCreatorInfoLocal {
return ConversationCreatorInfoLocal{
Ctime: o.Ctime.DeepCopy(),
Username: o.Username,
}
}
type Conversation struct {
Metadata ConversationMetadata `codec:"metadata" json:"metadata"`
ReaderInfo *ConversationReaderInfo `codec:"readerInfo,omitempty" json:"readerInfo,omitempty"`
Notifications *ConversationNotificationInfo `codec:"notifications,omitempty" json:"notifications,omitempty"`
MaxMsgs []MessageBoxed `codec:"maxMsgs" json:"maxMsgs"`
MaxMsgSummaries []MessageSummary `codec:"maxMsgSummaries" json:"maxMsgSummaries"`
CreatorInfo *ConversationCreatorInfo `codec:"creatorInfo,omitempty" json:"creatorInfo,omitempty"`
Expunge Expunge `codec:"expunge" json:"expunge"`
ConvRetention *RetentionPolicy `codec:"convRetention,omitempty" json:"convRetention,omitempty"`
TeamRetention *RetentionPolicy `codec:"teamRetention,omitempty" json:"teamRetention,omitempty"`
}
func (o Conversation) DeepCopy() Conversation {
return Conversation{
Metadata: o.Metadata.DeepCopy(),
ReaderInfo: (func(x *ConversationReaderInfo) *ConversationReaderInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.ReaderInfo),
Notifications: (func(x *ConversationNotificationInfo) *ConversationNotificationInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Notifications),
MaxMsgs: (func(x []MessageBoxed) []MessageBoxed {
if x == nil {
return nil
}
var ret []MessageBoxed
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.MaxMsgs),
MaxMsgSummaries: (func(x []MessageSummary) []MessageSummary {
if x == nil {
return nil
}
var ret []MessageSummary
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.MaxMsgSummaries),
CreatorInfo: (func(x *ConversationCreatorInfo) *ConversationCreatorInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.CreatorInfo),
Expunge: o.Expunge.DeepCopy(),
ConvRetention: (func(x *RetentionPolicy) *RetentionPolicy {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.ConvRetention),
TeamRetention: (func(x *RetentionPolicy) *RetentionPolicy {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TeamRetention),
}
}
type MessageSummary struct {
MsgID MessageID `codec:"msgID" json:"msgID"`
MessageType MessageType `codec:"messageType" json:"messageType"`
TlfName string `codec:"tlfName" json:"tlfName"`
TlfPublic bool `codec:"tlfPublic" json:"tlfPublic"`
Ctime gregor1.Time `codec:"ctime" json:"ctime"`
}
func (o MessageSummary) DeepCopy() MessageSummary {
return MessageSummary{
MsgID: o.MsgID.DeepCopy(),
MessageType: o.MessageType.DeepCopy(),
TlfName: o.TlfName,
TlfPublic: o.TlfPublic,
Ctime: o.Ctime.DeepCopy(),
}
}
type MessageServerHeader struct {
MessageID MessageID `codec:"messageID" json:"messageID"`
SupersededBy MessageID `codec:"supersededBy" json:"supersededBy"`
Ctime gregor1.Time `codec:"ctime" json:"ctime"`
}
func (o MessageServerHeader) DeepCopy() MessageServerHeader {
return MessageServerHeader{
MessageID: o.MessageID.DeepCopy(),
SupersededBy: o.SupersededBy.DeepCopy(),
Ctime: o.Ctime.DeepCopy(),
}
}
type MessagePreviousPointer struct {
Id MessageID `codec:"id" json:"id"`
Hash Hash `codec:"hash" json:"hash"`
}
func (o MessagePreviousPointer) DeepCopy() MessagePreviousPointer {
return MessagePreviousPointer{
Id: o.Id.DeepCopy(),