2020-06-30 07:50:59 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package protobuf;
|
|
|
|
|
2020-11-05 17:35:20 +00:00
|
|
|
import "chat_identity.proto";
|
|
|
|
|
2020-07-02 08:08:19 +00:00
|
|
|
message PushNotificationRegistration {
|
2020-06-30 07:50:59 +00:00
|
|
|
enum TokenType {
|
|
|
|
UNKNOWN_TOKEN_TYPE = 0;
|
|
|
|
APN_TOKEN = 1;
|
|
|
|
FIREBASE_TOKEN = 2;
|
|
|
|
}
|
|
|
|
TokenType token_type = 1;
|
2020-07-22 07:41:40 +00:00
|
|
|
string device_token = 2;
|
2020-06-30 07:50:59 +00:00
|
|
|
string installation_id = 3;
|
|
|
|
string access_token = 4;
|
2020-07-01 08:37:54 +00:00
|
|
|
bool enabled = 5;
|
|
|
|
uint64 version = 6;
|
2020-07-22 07:41:40 +00:00
|
|
|
repeated bytes allowed_key_list = 7;
|
2020-07-01 08:37:54 +00:00
|
|
|
repeated bytes blocked_chat_list = 8;
|
|
|
|
bool unregister = 9;
|
2020-07-13 08:53:13 +00:00
|
|
|
bytes grant = 10;
|
2020-07-20 08:06:24 +00:00
|
|
|
bool allow_from_contacts_only = 11;
|
2020-07-30 08:24:30 +00:00
|
|
|
string apn_topic = 12;
|
2020-09-01 13:27:01 +00:00
|
|
|
bool block_mentions = 13;
|
|
|
|
repeated bytes allowed_mentions_chat_list = 14;
|
2020-06-30 07:50:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message PushNotificationRegistrationResponse {
|
|
|
|
bool success = 1;
|
|
|
|
ErrorType error = 2;
|
|
|
|
bytes request_id = 3;
|
|
|
|
|
|
|
|
enum ErrorType {
|
|
|
|
UNKNOWN_ERROR_TYPE = 0;
|
|
|
|
MALFORMED_MESSAGE = 1;
|
|
|
|
VERSION_MISMATCH = 2;
|
|
|
|
UNSUPPORTED_TOKEN_TYPE = 3;
|
|
|
|
INTERNAL_ERROR = 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message ContactCodeAdvertisement {
|
2020-07-22 07:41:40 +00:00
|
|
|
repeated PushNotificationQueryInfo push_notification_info = 1;
|
2020-11-05 17:35:20 +00:00
|
|
|
ChatIdentity chat_identity = 2;
|
2020-06-30 07:50:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message PushNotificationQuery {
|
|
|
|
repeated bytes public_keys = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PushNotificationQueryInfo {
|
|
|
|
string access_token = 1;
|
|
|
|
string installation_id = 2;
|
|
|
|
bytes public_key = 3;
|
2020-07-22 07:41:40 +00:00
|
|
|
repeated bytes allowed_key_list = 4;
|
2020-07-13 08:53:13 +00:00
|
|
|
bytes grant = 5;
|
2020-07-17 11:41:49 +00:00
|
|
|
uint64 version = 6;
|
2020-07-22 07:41:40 +00:00
|
|
|
bytes server_public_key = 7;
|
2020-06-30 07:50:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message PushNotificationQueryResponse {
|
|
|
|
repeated PushNotificationQueryInfo info = 1;
|
2020-07-09 16:52:26 +00:00
|
|
|
bytes message_id = 2;
|
|
|
|
bool success = 3;
|
2020-06-30 07:50:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message PushNotification {
|
|
|
|
string access_token = 1;
|
2020-08-25 09:46:01 +00:00
|
|
|
bytes chat_id = 2;
|
2020-07-03 08:02:28 +00:00
|
|
|
bytes public_key = 3;
|
|
|
|
string installation_id = 4;
|
|
|
|
bytes message = 5;
|
2020-08-18 11:28:05 +00:00
|
|
|
PushNotificationType type = 6;
|
|
|
|
enum PushNotificationType {
|
|
|
|
UNKNOWN_PUSH_NOTIFICATION_TYPE = 0;
|
|
|
|
MESSAGE = 1;
|
|
|
|
MENTION = 2;
|
|
|
|
}
|
2020-09-07 08:25:57 +00:00
|
|
|
bytes author = 7;
|
2020-06-30 07:50:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message PushNotificationRequest {
|
|
|
|
repeated PushNotification requests = 1;
|
2020-07-10 13:26:06 +00:00
|
|
|
bytes message_id = 2;
|
2020-07-03 08:02:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message PushNotificationReport {
|
|
|
|
bool success = 1;
|
|
|
|
ErrorType error = 2;
|
|
|
|
enum ErrorType {
|
|
|
|
UNKNOWN_ERROR_TYPE = 0;
|
|
|
|
WRONG_TOKEN = 1;
|
|
|
|
INTERNAL_ERROR = 2;
|
|
|
|
NOT_REGISTERED = 3;
|
|
|
|
}
|
|
|
|
bytes public_key = 3;
|
|
|
|
string installation_id = 4;
|
2020-06-30 07:50:59 +00:00
|
|
|
}
|
|
|
|
|
2020-07-03 08:02:28 +00:00
|
|
|
message PushNotificationResponse {
|
2020-07-10 13:26:06 +00:00
|
|
|
bytes message_id = 1;
|
2020-07-03 08:02:28 +00:00
|
|
|
repeated PushNotificationReport reports = 2;
|
2020-06-30 07:50:59 +00:00
|
|
|
}
|