Commit Graph

79 Commits

Author SHA1 Message Date
Jordan Rose
e9b6439518 Un-nest builders for our proto wrapper types
We expose many of these builders to Objective-C, but Swift is unable
to map forward-declarations of those types (@class) back to the real
Swift classes because they're nested within the protos. Since we're
already using fully-qualified names even in Swift (e.g.
"SSKProtoContentBuilder"), nesting isn't worth the trouble it's
causing.
2022-05-19 15:40:21 -07:00
Evan Hahn
16aa421d3e More Python 3 script fixes 2022-03-24 10:28:27 -05:00
Evan Hahn
c254811765 Remove unnecessary coding: utf-8 heading from Python scripts
Python 3 uses UTF-8 for source files by default. This removes the
unnecessary `coding: utf-8` declaration comment from all files.
2022-03-21 14:43:45 -05:00
Evan Hahn
1101db6a29 Upgrade scripts to Python 3
Python 2 was [removed from macOS in 12.3][0]. This change:

- Automatically converts many files with [2to3][1]
- Manually updates all [shebangs][2] to use `python3` instead of
  versionless `python` or `python2.7`
- Manually applies a few fixes, many of which were noted by 2to3
- Manually undoes a few fixes that were automatically done by 2to3

[0]: https://www.macrumors.com/2022/01/28/apple-removing-python-2-in-macos-12-3/
[1]: https://docs.python.org/3/library/2to3.html
[2]: https://en.wikipedia.org/wiki/Shebang_(Unix)
2022-03-21 12:58:33 -05:00
Dimitris Apostolou
62724cf0be Fix typos 2022-03-18 11:31:06 -07:00
Michelle Linington
886a9f8e6f Generate CDS protos 2022-02-22 12:41:04 -08:00
Michelle Linington
e3d18733da Bump copyright 2022-01-28 13:23:47 -08:00
Matthew Chen
c2171db12d Assert when we emit invalid e164 in a proto. 2021-09-01 16:33:16 -03:00
Matthew Chen
953fe32300 Never emit invalid e164 in storage service contact records; be robust to invalid e164 incoming protos. 2021-09-01 16:33:16 -03:00
Michelle Linington
4eeb4e34be Tests should be runnable in Profiling scheme 2021-08-26 20:57:06 -07:00
Nora Trapp
0dba0878a2 Adhere proto wrappers to NSSecureCoding 2021-08-17 13:42:07 -07:00
Matthew Chen
2d0fdff372 Payments: Update proto schema. 2021-04-06 13:57:06 -03:00
Nora Trapp
26253a0a27 Set the proto address during initialization 2021-02-16 13:05:13 -08:00
Matthew Chen
b890fdeed8 Fix build warnings. 2021-01-23 22:45:33 -03:00
Jordan Rose
98884f9cba Proto wrappers: use structs when ObjC compatibility isn't needed
Shaves off about 20% of a deep serialization benchmark (that's
unfortunately using code that isn't checked in yet).

Also removes Equatable from oneof enums, which wasn't really doing the
right thing anyway when there were non-primitive payloads because the
proto classes didn't override isEqual.
2020-11-17 12:46:26 -08:00
Jordan Rose
a25f4b9e26 Proto builders: dramatically speed up add*() using in-place mutation
The Swift compiler ought to be smart enough to prove that
copy-out/mutate/copy-in is the same as mutate-in-place for structs,
but it currently isn't clever enough to do that.
(See https://bugs.swift.org/browse/SR-11895.)
2020-11-17 12:46:26 -08:00
Matthew Chen
b13ff0c879 Respond to CR. 2020-10-08 17:31:29 -03:00
Matthew Chen
3942ff7fb2 Cautious proto address parsing. 2020-08-19 13:24:16 -03:00
Nora Trapp
9696671f8a Add trustLevel to SignalServiceAddress 2020-08-05 14:36:43 -07:00
Nora Trapp
c5214e38b6 Add Codable adherance to proto wrappers 2020-07-22 14:34:24 -07:00
Nora Trapp
c4111f59d0 Generate interface for unknownFields 2020-07-22 14:34:24 -07:00
Matthew Chen
752bcdd6f9 Use blob protos for encrypted attributes. 2020-04-27 14:48:29 -03:00
Ehren Kret
429aa7bf32 Update proto wrapper script for python3 2020-04-09 12:45:34 -07:00
Nora Trapp
89450058b4 More proto changes: flatten and limit account to relevant data 2020-03-24 17:11:02 -07:00
Nora Trapp
45945a530c Add support for proto3 oneof and fix a few other proto3 paths 2020-03-24 17:11:01 -07:00
Matthew Chen
3d5954dcf0 Update proto wrappers for group v2 protos (proto3, swift-only, free-standing enums, etc.) 2019-11-19 11:06:42 -03:00
Matthew Chen
6415eef120 Restore the group proto changes. 2019-11-19 11:06:42 -03:00
Matthew Chen
f5e9a83834 Revert "Merge branch 'charlesmchen/groupsProtos'"
This reverts commit ede6b98234, reversing
changes made to 35271c6d3e.
2019-11-06 17:48:52 -03:00
Matthew Chen
353fca396e Add Groups protos. 2019-11-06 17:34:56 -03:00
Nora Trapp
19f3de798e Limit optional proto setters to ObjC only 2019-07-24 14:53:45 -07:00
Nora Trapp
a439c89e93 Change proto builder setters to accept optional input 2019-07-24 14:53:45 -07:00
Michael Kirk
fefc06530b ProtoWrappers generation optionally skips address helpers 2019-07-16 22:45:13 -06:00
Nora Trapp
430a4b872a If proto doesn't have uuid or e164 address should be nil 2019-07-16 09:23:15 -07:00
Nora Trapp
c416ee5a60 Generate proto address accessors 2019-07-10 13:31:03 -07:00
Nora Trapp
37406153c6 Add support for camel case conversion from upper and lower snake case 2019-06-18 19:04:08 -07:00
Matthew Chen
307a3f38a2 Respond to CR. 2019-05-29 11:26:40 -04:00
Matthew Chen
9ae86e438b Add "required" getter for optional enums. 2019-05-29 11:05:32 -04:00
Matthew Chen
5afe9de621 Add "required" getter for optional enums. 2019-05-29 11:05:01 -04:00
Matthew Chen
12f816b040 Remove @required from proto enums. 2019-05-29 11:05:01 -04:00
Matthew Chen
c05c314b80 Render "unknown protocol version" error messages. 2019-05-29 09:10:18 -04:00
Matthew Chen
e72961fa24 Handle unknown enum values. 2019-05-29 09:10:18 -04:00
Matthew Chen
0e04a59c70 Add protocol version to proto schema. 2019-05-29 09:10:18 -04:00
Matthew Chen
aa916965d0 Update protos to reflect link previews. 2019-01-14 16:19:42 -05:00
Matthew Chen
7441c565bb Fix missing server timestamps. 2018-10-05 12:56:42 -04:00
Matthew Chen
f4148edf97 Fix missing server timestamps. 2018-10-05 12:56:42 -04:00
Matthew Chen
0c0d2a702e Decrypt incoming UD messages. 2018-10-03 09:32:21 -04:00
Matthew Chen
a224401879 Respond to CR. 2018-10-01 09:12:38 -04:00
Matthew Chen
74e456f90e Modify proto wrapper builders to require required fields. 2018-10-01 09:08:23 -04:00
Matthew Chen
3738155c81 Fix build breakage from SMK. 2018-10-01 09:08:02 -04:00
Michael Kirk
2fc3a211f1 restrict debug methods 2018-08-23 10:16:40 -06:00