Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 63 additions & 5 deletions protobuf/SignalService.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ message Envelope {
optional bool story = 16; // indicates that the content is a story.
optional bytes report_spam_token = 17; // token sent when reporting spam
reserved 18; // internal server use
// next: 19
optional bytes sourceServiceIdBinary = 19; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI)
optional bytes destinationServiceIdBinary = 20; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI)
optional bytes serverGuidBinary = 21; // 16-byte UUID
optional bytes updatedPniBinary = 22; // 16-byte UUID
// next: 22
}

message Content {
Expand Down Expand Up @@ -177,6 +181,7 @@ message DataMessage {
enum Type {
NORMAL = 0;
GIFT_BADGE = 1;
POLL = 2;
}

message QuotedAttachment {
Expand All @@ -192,6 +197,7 @@ message DataMessage {
repeated QuotedAttachment attachments = 4;
repeated BodyRange bodyRanges = 6;
optional Type type = 7;
optional bytes authorAciBinary = 8; // 16-byte UUID
}

message Contact {
Expand Down Expand Up @@ -276,6 +282,7 @@ message DataMessage {
reserved /* targetAuthorE164 */ 3;
optional string targetAuthorAci = 4;
optional uint64 targetSentTimestamp = 5;
optional bytes targetAuthorAciBinary = 6; // 16-byte UUID
}

message Delete {
Expand All @@ -289,6 +296,7 @@ message DataMessage {
message StoryContext {
optional string authorAci = 1;
optional uint64 sentTimestamp = 2;
optional bytes authorAciBinary = 3; // 16-byte UUID
}

enum ProtocolVersion {
Expand All @@ -302,13 +310,45 @@ message DataMessage {
CDN_SELECTOR_ATTACHMENTS = 5;
MENTIONS = 6;
PAYMENTS = 7;
CURRENT = 7;
POLLS = 8;
CURRENT = 8;
}

message GiftBadge {
optional bytes receiptCredentialPresentation = 1;
}

message PollCreate {
optional string question = 1;
optional bool allowMultiple = 2;
repeated string options = 3;
}

message PollTerminate {
optional uint64 targetSentTimestamp = 1;
}

message PollVote {
optional bytes targetAuthorAciBinary = 1;
optional uint64 targetSentTimestamp = 2;
repeated uint32 optionIndexes = 3; // must be in the range [0, options.length) from the PollCreate
optional uint32 voteCount = 4; // increment this by 1 each time you vote on a given poll
}

message PinMessage {
optional bytes targetAuthorAciBinary = 1; // 16-byte UUID
optional uint64 targetSentTimestamp = 2;
oneof pinDuration {
uint32 pinDurationSeconds = 3;
bool pinDurationForever = 4;
}
}

message UnpinMessage {
optional bytes targetAuthorAciBinary = 1; // 16-byte UUID
optional uint64 targetSentTimestamp = 2;
}

optional string body = 1;
repeated AttachmentPointer attachments = 2;
reserved /*groupV1*/ 3;
Expand All @@ -331,7 +371,12 @@ message DataMessage {
optional Payment payment = 20;
optional StoryContext storyContext = 21;
optional GiftBadge giftBadge = 22;
// NEXT ID: 24
optional PollCreate pollCreate = 24;
optional PollTerminate pollTerminate = 25;
optional PollVote pollVote = 26;
optional PinMessage pinMessage = 27;
optional UnpinMessage unpinMessage = 28;
// NEXT ID: 29
}

message NullMessage {
Expand Down Expand Up @@ -420,6 +465,7 @@ message Verified {
optional bytes identityKey = 2;
optional State state = 3;
optional bytes nullMessage = 4;
optional bytes destinationAciBinary = 6; // 16-byte UUID
}

message SyncMessage {
Expand All @@ -430,13 +476,15 @@ message SyncMessage {
optional bool unidentified = 2;
reserved /*destinationPni */ 4;
optional bytes destinationPniIdentityKey = 5; // Only set for PNI destinations
optional bytes destinationServiceIdBinary = 6; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI)
}

message StoryMessageRecipient {
optional string destinationServiceId = 1;
repeated string distributionListIds = 2;
optional bool isAllowedToReply = 3;
reserved /*destinationPni */ 4;
optional bytes destinationServiceIdBinary = 5; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI)
}

optional string destinationE164 = 1;
Expand All @@ -450,7 +498,8 @@ message SyncMessage {
repeated StoryMessageRecipient storyMessageRecipients = 9;
optional EditMessage editMessage = 10;
reserved /*destinationPni */ 11;
// Next ID: 12
optional bytes destinationServiceIdBinary = 12; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI)
// Next ID: 13
}

message Contacts {
Expand All @@ -462,6 +511,7 @@ message SyncMessage {
repeated string numbers = 1;
repeated string acis = 3;
repeated bytes groupIds = 2;
repeated bytes acisBinary = 4; // 16-byte UUID
}

message Request {
Expand All @@ -482,12 +532,14 @@ message SyncMessage {
reserved /*senderE164*/ 1;
optional string senderAci = 3;
optional uint64 timestamp = 2;
optional bytes senderAciBinary = 4; // 16-byte UUID
}

message Viewed {
reserved /*senderE164*/ 1;
optional string senderAci = 3;
optional uint64 timestamp = 2;
optional bytes senderAciBinary = 4; // 16-byte UUID
}

message Configuration {
Expand All @@ -514,6 +566,7 @@ message SyncMessage {
reserved /*senderE164*/ 1;
optional string senderAci = 3;
optional uint64 timestamp = 2;
optional bytes senderAciBinary = 4; // 16-byte UUID
}

message FetchLatest {
Expand Down Expand Up @@ -554,6 +607,7 @@ message SyncMessage {
optional string threadAci = 2;
optional bytes groupId = 3;
optional Type type = 4;
optional bytes threadAciBinary = 5; // 16-byte UUID
}

message OutgoingPayment {
Expand Down Expand Up @@ -801,6 +855,7 @@ message ContactDetails {

optional string number = 1;
optional string aci = 9;
optional bytes aciBinary = 13; // 16-byte UUID
optional string name = 2;
optional Avatar avatar = 3;
reserved /* color */ 4;
Expand All @@ -811,7 +866,7 @@ message ContactDetails {
optional uint32 expireTimerVersion = 12;
optional uint32 inboxPosition = 10;
reserved /* archived */ 11;
// NEXT ID: 13
// NEXT ID: 14
}

message PaymentAddress {
Expand Down Expand Up @@ -858,13 +913,15 @@ message BodyRange {
oneof associatedValue {
string mentionAci = 3;
Style style = 4;
bytes mentionAciBinary = 5; // 16-byte UUID
}
}

message AddressableMessage {
oneof author {
string authorServiceId = 1;
string authorE164 = 2;
bytes authorServiceIdBinary = 4; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI)
}
optional uint64 sentTimestamp = 3;
}
Expand All @@ -874,5 +931,6 @@ message ConversationIdentifier {
string threadServiceId = 1;
bytes threadGroupId = 2;
string threadE164 = 3;
bytes threadServiceIdBinary = 4; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI)
}
}
4 changes: 2 additions & 2 deletions protobuf/update-protos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set -euo pipefail
update_proto() {
case "$1" in
Signal-Android)
git_revision="77e678e05cfd2c643aede05ab0d8fad494b686a7"
git_revision="d88a862e0985cc2bbc463c5f504f5bb4e91ad4fc"
prefix="libsignal-service/src/main/protowire/";;
Signal-Desktop)
git_revision="4c4aa84525d19e7566f55daadae9ef80b921ca20"
git_revision="3a772b05c3a2e5da754b538a6d91929deb1ef665"
prefix="protos/";;
esac
curl -LOf https://raw.githubusercontent.com/signalapp/${1}/${git_revision}/${prefix}${2}
Expand Down
5 changes: 5 additions & 0 deletions src/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ where
);
MessageRequestResponse {
thread_aci: Some(aci.to_string()),
thread_aci_binary: Some(aci.into_bytes().to_vec()),
group_id: None,
r#type: Some(action.into()),
}
Expand All @@ -773,6 +774,7 @@ where
);
MessageRequestResponse {
thread_aci: None,
thread_aci_binary: None,
group_id: Some(id.to_vec()),
r#type: Some(action.into()),
}
Expand Down Expand Up @@ -1079,6 +1081,9 @@ where
destination_service_id: Some(
recipient.service_id_string(),
),
destination_service_id_binary: Some(
recipient.service_id_binary(),
),
unidentified: Some(*unidentified),
destination_pni_identity_key: Some(
used_identity_key.serialize().into(),
Expand Down
Loading