general updates
This commit is contained in:
parent
fb881df443
commit
bdc2e4fadf
5
Makefile
5
Makefile
|
@ -92,5 +92,6 @@ clean-more:
|
|||
ls -l autogenpb autogenpb.last
|
||||
-rm -f autogenpb.2*
|
||||
|
||||
Signal-Desktop:
|
||||
autogenpb --proto SignalService.proto --format
|
||||
reformat-signal.proto:
|
||||
make -C example proto-reformat-restore
|
||||
make -C example proto-reformat-comments
|
||||
|
|
|
@ -108,3 +108,4 @@ proto-reformat-restore:
|
|||
|
||||
proto-reformat-comments:
|
||||
../autogenpb --proto signal.proto --format-comments
|
||||
# autogenpb --proto SignalService.proto --format
|
||||
|
|
|
@ -115,7 +115,7 @@ message AccountData {
|
|||
string familyName = 5;
|
||||
string avatarUrlPath = 6;
|
||||
SubscriberData donationSubscriberData = 7;
|
||||
reserved 8; // A deprecated format // backupsSubscriberData
|
||||
reserved /*backupsSubscriberData*/ 8; // A deprecated format
|
||||
AccountSettings accountSettings = 9;
|
||||
IAPSubscriberData backupsSubscriberData = 10;
|
||||
string svrPin = 11;
|
||||
|
@ -230,7 +230,7 @@ message Group {
|
|||
// We would use Groups.proto if we could, but we want a plaintext version to improve export readability.
|
||||
// For documentation, defer to Groups.proto. The only name change is Group -> GroupSnapshot to avoid the naming conflict.
|
||||
message GroupSnapshot {
|
||||
reserved 1; // The field is deprecated in the context of static group state // publicKey
|
||||
reserved /*publicKey*/ 1; // The field is deprecated in the context of static group state
|
||||
GroupAttributeBlob title = 2;
|
||||
GroupAttributeBlob description = 11;
|
||||
string avatarUrl = 3;
|
||||
|
@ -264,8 +264,8 @@ message Group {
|
|||
|
||||
bytes userId = 1;
|
||||
Role role = 2;
|
||||
reserved 3; // This field is ignored in Backups, in favor of Contact frames for members // profileKey
|
||||
reserved 4; // This field is deprecated in the context of static group state // presentation
|
||||
reserved /*profileKey*/ 3; // This field is ignored in Backups, in favor of Contact frames for members
|
||||
reserved /*presentation*/ 4; // This field is deprecated in the context of static group state
|
||||
uint32 joinedAtVersion = 5;
|
||||
}
|
||||
|
||||
|
@ -277,8 +277,8 @@ message Group {
|
|||
|
||||
message MemberPendingAdminApproval {
|
||||
bytes userId = 1;
|
||||
reserved 2; // This field is ignored in Backups, in favor of Contact frames for members // profileKey
|
||||
reserved 3; // This field is deprecated in the context of static group state // presentation
|
||||
reserved /*profileKey*/ 2; // This field is ignored in Backups, in favor of Contact frames for members
|
||||
reserved /*presentation*/ 3; // This field is deprecated in the context of static group state
|
||||
uint64 timestamp = 4;
|
||||
}
|
||||
|
||||
|
@ -505,7 +505,7 @@ message DirectStoryReplyMessage {
|
|||
}
|
||||
|
||||
repeated Reaction reactions = 3;
|
||||
reserved 4; // storySentTimestamp
|
||||
reserved /*storySentTimestamp*/ 4;
|
||||
}
|
||||
|
||||
message PaymentNotification {
|
||||
|
@ -1312,4 +1312,4 @@ message ChatFolder {
|
|||
FolderType folderType = 6;
|
||||
repeated uint64 includedRecipientIds = 7; // generated recipient id of groups, contacts, and/or note to self
|
||||
repeated uint64 excludedRecipientIds = 8; // generated recipient id of groups, contacts, and/or note to self
|
||||
}
|
||||
}
|
|
@ -54,6 +54,8 @@ func protoReformatComments(filename string) error {
|
|||
}
|
||||
|
||||
var newfile string
|
||||
newfile = commentPreprocessorFull(string(data))
|
||||
saveFile(filename, newfile)
|
||||
|
||||
log.Info("filename", filename)
|
||||
alltest := makeLineIter(data)
|
||||
|
@ -61,7 +63,8 @@ func protoReformatComments(filename string) error {
|
|||
for line := range alltest {
|
||||
newfile += fmt.Sprintln(commentPreprocessor(line))
|
||||
}
|
||||
saveFile(filename, newfile)
|
||||
newfile = commentPreprocessorFull(newfile)
|
||||
// saveFile(filename, newfile)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -488,9 +491,8 @@ func (it *LinesScanner) Next() string {
|
|||
// END DEFINE THE ITERATOR
|
||||
|
||||
// turns: "/* test */ reserved /* linkPreviews */ 4;"
|
||||
// into:
|
||||
// into: reserved 1; // test // linkPreviews
|
||||
func commentPreprocessor(line string) string {
|
||||
|
||||
// Match all /* comment */ blocks
|
||||
re := regexp.MustCompile(`/\*([^*]+)\*/`)
|
||||
matches := re.FindAllStringSubmatch(line, -1)
|
||||
|
@ -514,3 +516,20 @@ func commentPreprocessor(line string) string {
|
|||
|
||||
return line
|
||||
}
|
||||
|
||||
// /* this
|
||||
// - thing
|
||||
// */
|
||||
//
|
||||
// becomes
|
||||
//
|
||||
// this
|
||||
// thing
|
||||
func commentPreprocessorFull(full string) string {
|
||||
// Match all /* comment */ blocks
|
||||
re := regexp.MustCompile(`/\*([^*]+)\*/`)
|
||||
|
||||
return re.ReplaceAllStringFunc(full, func(s string) string {
|
||||
return strings.ToUpper(s)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue