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
|
ls -l autogenpb autogenpb.last
|
||||||
-rm -f autogenpb.2*
|
-rm -f autogenpb.2*
|
||||||
|
|
||||||
Signal-Desktop:
|
reformat-signal.proto:
|
||||||
autogenpb --proto SignalService.proto --format
|
make -C example proto-reformat-restore
|
||||||
|
make -C example proto-reformat-comments
|
||||||
|
|
|
@ -108,3 +108,4 @@ proto-reformat-restore:
|
||||||
|
|
||||||
proto-reformat-comments:
|
proto-reformat-comments:
|
||||||
../autogenpb --proto signal.proto --format-comments
|
../autogenpb --proto signal.proto --format-comments
|
||||||
|
# autogenpb --proto SignalService.proto --format
|
||||||
|
|
|
@ -115,7 +115,7 @@ message AccountData {
|
||||||
string familyName = 5;
|
string familyName = 5;
|
||||||
string avatarUrlPath = 6;
|
string avatarUrlPath = 6;
|
||||||
SubscriberData donationSubscriberData = 7;
|
SubscriberData donationSubscriberData = 7;
|
||||||
reserved 8; // A deprecated format // backupsSubscriberData
|
reserved /*backupsSubscriberData*/ 8; // A deprecated format
|
||||||
AccountSettings accountSettings = 9;
|
AccountSettings accountSettings = 9;
|
||||||
IAPSubscriberData backupsSubscriberData = 10;
|
IAPSubscriberData backupsSubscriberData = 10;
|
||||||
string svrPin = 11;
|
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.
|
// 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.
|
// For documentation, defer to Groups.proto. The only name change is Group -> GroupSnapshot to avoid the naming conflict.
|
||||||
message GroupSnapshot {
|
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 title = 2;
|
||||||
GroupAttributeBlob description = 11;
|
GroupAttributeBlob description = 11;
|
||||||
string avatarUrl = 3;
|
string avatarUrl = 3;
|
||||||
|
@ -264,8 +264,8 @@ message Group {
|
||||||
|
|
||||||
bytes userId = 1;
|
bytes userId = 1;
|
||||||
Role role = 2;
|
Role role = 2;
|
||||||
reserved 3; // This field is ignored in Backups, in favor of Contact frames for members // profileKey
|
reserved /*profileKey*/ 3; // This field is ignored in Backups, in favor of Contact frames for members
|
||||||
reserved 4; // This field is deprecated in the context of static group state // presentation
|
reserved /*presentation*/ 4; // This field is deprecated in the context of static group state
|
||||||
uint32 joinedAtVersion = 5;
|
uint32 joinedAtVersion = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,8 +277,8 @@ message Group {
|
||||||
|
|
||||||
message MemberPendingAdminApproval {
|
message MemberPendingAdminApproval {
|
||||||
bytes userId = 1;
|
bytes userId = 1;
|
||||||
reserved 2; // This field is ignored in Backups, in favor of Contact frames for members // profileKey
|
reserved /*profileKey*/ 2; // This field is ignored in Backups, in favor of Contact frames for members
|
||||||
reserved 3; // This field is deprecated in the context of static group state // presentation
|
reserved /*presentation*/ 3; // This field is deprecated in the context of static group state
|
||||||
uint64 timestamp = 4;
|
uint64 timestamp = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -505,7 +505,7 @@ message DirectStoryReplyMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
repeated Reaction reactions = 3;
|
repeated Reaction reactions = 3;
|
||||||
reserved 4; // storySentTimestamp
|
reserved /*storySentTimestamp*/ 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PaymentNotification {
|
message PaymentNotification {
|
||||||
|
|
|
@ -54,6 +54,8 @@ func protoReformatComments(filename string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
var newfile string
|
var newfile string
|
||||||
|
newfile = commentPreprocessorFull(string(data))
|
||||||
|
saveFile(filename, newfile)
|
||||||
|
|
||||||
log.Info("filename", filename)
|
log.Info("filename", filename)
|
||||||
alltest := makeLineIter(data)
|
alltest := makeLineIter(data)
|
||||||
|
@ -61,7 +63,8 @@ func protoReformatComments(filename string) error {
|
||||||
for line := range alltest {
|
for line := range alltest {
|
||||||
newfile += fmt.Sprintln(commentPreprocessor(line))
|
newfile += fmt.Sprintln(commentPreprocessor(line))
|
||||||
}
|
}
|
||||||
saveFile(filename, newfile)
|
newfile = commentPreprocessorFull(newfile)
|
||||||
|
// saveFile(filename, newfile)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -488,9 +491,8 @@ func (it *LinesScanner) Next() string {
|
||||||
// END DEFINE THE ITERATOR
|
// END DEFINE THE ITERATOR
|
||||||
|
|
||||||
// turns: "/* test */ reserved /* linkPreviews */ 4;"
|
// turns: "/* test */ reserved /* linkPreviews */ 4;"
|
||||||
// into:
|
// into: reserved 1; // test // linkPreviews
|
||||||
func commentPreprocessor(line string) string {
|
func commentPreprocessor(line string) string {
|
||||||
|
|
||||||
// Match all /* comment */ blocks
|
// Match all /* comment */ blocks
|
||||||
re := regexp.MustCompile(`/\*([^*]+)\*/`)
|
re := regexp.MustCompile(`/\*([^*]+)\*/`)
|
||||||
matches := re.FindAllStringSubmatch(line, -1)
|
matches := re.FindAllStringSubmatch(line, -1)
|
||||||
|
@ -514,3 +516,20 @@ func commentPreprocessor(line string) string {
|
||||||
|
|
||||||
return line
|
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