Fix long polling retries, unpair handling and other things

This commit is contained in:
Tulir Asokan 2023-07-01 12:51:13 +03:00
parent 9aa0894115
commit b1e2634f33
10 changed files with 296 additions and 185 deletions

View file

@ -97,21 +97,24 @@ type MsgStatusCode int32
const ( const (
MsgStatusCode_UNKNOWN_STATUS MsgStatusCode = 0 MsgStatusCode_UNKNOWN_STATUS MsgStatusCode = 0
MsgStatusCode_SENDING MsgStatusCode = 5
MsgStatusCode_SENT MsgStatusCode = 1 MsgStatusCode_SENT MsgStatusCode = 1
MsgStatusCode_SENDING MsgStatusCode = 5
MsgStatusCode_READ MsgStatusCode = 11
) )
// Enum value maps for MsgStatusCode. // Enum value maps for MsgStatusCode.
var ( var (
MsgStatusCode_name = map[int32]string{ MsgStatusCode_name = map[int32]string{
0: "UNKNOWN_STATUS", 0: "UNKNOWN_STATUS",
5: "SENDING",
1: "SENT", 1: "SENT",
5: "SENDING",
11: "READ",
} }
MsgStatusCode_value = map[string]int32{ MsgStatusCode_value = map[string]int32{
"UNKNOWN_STATUS": 0, "UNKNOWN_STATUS": 0,
"SENDING": 5,
"SENT": 1, "SENT": 1,
"SENDING": 5,
"READ": 11,
} }
) )
@ -1149,7 +1152,7 @@ type MessageStatus struct {
// //
// // RCS // // RCS
// READ|SEEN = 11; // READ|SEEN = 11;
Code int64 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` Code MsgStatusCode `protobuf:"varint,2,opt,name=code,proto3,enum=conversations.MsgStatusCode" json:"code,omitempty"`
ErrMsg string `protobuf:"bytes,4,opt,name=errMsg,proto3" json:"errMsg,omitempty"` ErrMsg string `protobuf:"bytes,4,opt,name=errMsg,proto3" json:"errMsg,omitempty"`
MsgStatus string `protobuf:"bytes,5,opt,name=msgStatus,proto3" json:"msgStatus,omitempty"` MsgStatus string `protobuf:"bytes,5,opt,name=msgStatus,proto3" json:"msgStatus,omitempty"`
} }
@ -1186,11 +1189,11 @@ func (*MessageStatus) Descriptor() ([]byte, []int) {
return file_conversations_proto_rawDescGZIP(), []int{15} return file_conversations_proto_rawDescGZIP(), []int{15}
} }
func (x *MessageStatus) GetCode() int64 { func (x *MessageStatus) GetCode() MsgStatusCode {
if x != nil { if x != nil {
return x.Code return x.Code
} }
return 0 return MsgStatusCode_UNKNOWN_STATUS
} }
func (x *MessageStatus) GetErrMsg() string { func (x *MessageStatus) GetErrMsg() string {
@ -1849,94 +1852,97 @@ var file_conversations_proto_rawDesc = []byte{
0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f,
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x22, 0x0a, 0x08, 0x49, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x4d, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x22, 0x0a, 0x08, 0x49, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x4d,
0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x6f, 0x6d, 0x4d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x6f, 0x6d, 0x4d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x08, 0x52, 0x06, 0x66, 0x72, 0x6f, 0x6d, 0x4d, 0x65, 0x22, 0x59, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x08, 0x52, 0x06, 0x66, 0x72, 0x6f, 0x6d, 0x4d, 0x65, 0x22, 0x77, 0x0a, 0x0d, 0x4d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x30, 0x0a, 0x04, 0x63, 0x6f,
0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65,
0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74,
0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06,
0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x73, 0x67, 0x53, 0x74, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72,
0x61, 0x74, 0x75, 0x73, 0x22, 0x52, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x75, 0x73, 0x22, 0x52, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x6e,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xd2, 0x03, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xd2, 0x03, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x76, 0x65,
0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65,
0x44, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4d, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4c, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73,
0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6e,
0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73,
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x53, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74,
0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x53, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x73,
0x73, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x53, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74, 0x69,
0x52, 0x0b, 0x69, 0x73, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x74, 0x12, 0x2c, 0x0a, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x53, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x73, 0x47,
0x11, 0x73, 0x65, 0x6c, 0x66, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b,
0x49, 0x44, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x65, 0x6c, 0x66, 0x50, 0x61, 0x69, 0x73, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x73,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6c, 0x66, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x44,
0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x65, 0x6c, 0x66, 0x50, 0x61, 0x72, 0x74,
0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x48, 0x65, 0x78, 0x18, 0x0f, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x61, 0x73, 0x68, 0x48, 0x65, 0x78, 0x12, 0x1c, 0x0a, 0x74, 0x75, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x48, 0x65, 0x78, 0x18, 0x0f, 0x20, 0x01,
0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x12, 0x3e, 0x0a, 0x0c, 0x70, 0x28, 0x09, 0x52, 0x07, 0x68, 0x61, 0x73, 0x68, 0x48, 0x65, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x6d,
0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x12, 0x3e, 0x0a, 0x0c, 0x70, 0x61, 0x72,
0x73, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x0c, 0x70, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e,
0x74, 0x68, 0x65, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x0c, 0x70, 0x61, 0x72,
0x18, 0x15, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x6f, 0x74, 0x68,
0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x15,
0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xd1, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69,
0x0a, 0x0b, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
0x09, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x16, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xd1, 0x01, 0x0a, 0x0b,
0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x73,
0x2e, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x73, 0x6d, 0x61, 0x6c, 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18,
0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x48, 0x65, 0x78, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53,
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x61, 0x73, 0x68, 0x48, 0x65, 0x78, 0x12, 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x49,
0x12, 0x0a, 0x04, 0x69, 0x73, 0x4d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x48, 0x65, 0x78, 0x18, 0x05,
0x73, 0x4d, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x6d, 0x75, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x61, 0x73, 0x68, 0x48, 0x65, 0x78, 0x12, 0x12, 0x0a,
0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x04, 0x69, 0x73, 0x4d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4d,
0x6e, 0x73, 0x2e, 0x4d, 0x75, 0x74, 0x65, 0x64, 0x52, 0x05, 0x6d, 0x75, 0x74, 0x65, 0x64, 0x12, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x6d, 0x75, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b,
0x0e, 0x0a, 0x02, 0x62, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x62, 0x73, 0x12, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x20, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0f, 0x2e, 0x4d, 0x75, 0x74, 0x65, 0x64, 0x52, 0x05, 0x6d, 0x75, 0x74, 0x65, 0x64, 0x12, 0x0e, 0x0a,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x02, 0x62, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x62, 0x73, 0x12, 0x20, 0x0a,
0x65, 0x22, 0x5d, 0x0a, 0x09, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01,
0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x22,
0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x5d, 0x0a, 0x09, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04,
0x28, 0x09, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x61, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x09, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x44, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x74,
0x22, 0x63, 0x0a, 0x0d, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x44, 0x22, 0x63,
0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x0a, 0x0d, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
0x72, 0x6f, 0x6d, 0x4d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x72, 0x6f, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x6d, 0x4d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x6f,
0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x6d, 0x4d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x72, 0x6f, 0x6d, 0x4d,
0x79, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e,
0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x31, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x12, 0x16,
0x64, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x32, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
0x22, 0x21, 0x0a, 0x05, 0x4d, 0x75, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x4d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x31, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x32,
0x75, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x4d, 0x75, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x32, 0x22, 0x21,
0x74, 0x65, 0x64, 0x2a, 0xa0, 0x01, 0x0a, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x0a, 0x05, 0x4d, 0x75, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x4d, 0x75, 0x74,
0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x4d, 0x75, 0x74, 0x65,
0x12, 0x08, 0x0a, 0x04, 0x54, 0x45, 0x58, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4d, 0x64, 0x2a, 0xa0, 0x01, 0x0a, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70,
0x41, 0x47, 0x45, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x49, 0x44, 0x45, 0x4f, 0x10, 0x03, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08,
0x12, 0x09, 0x0a, 0x05, 0x41, 0x55, 0x44, 0x49, 0x4f, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x0a, 0x04, 0x54, 0x45, 0x58, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4d, 0x41, 0x47,
0x54, 0x54, 0x41, 0x43, 0x48, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x4c, 0x45, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x49, 0x44, 0x45, 0x4f, 0x10, 0x03, 0x12, 0x09,
0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x49, 0x43, 0x0a, 0x05, 0x41, 0x55, 0x44, 0x49, 0x4f, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x54, 0x54,
0x48, 0x5f, 0x43, 0x41, 0x52, 0x44, 0x10, 0x07, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x43, 0x41, 0x52, 0x41, 0x43, 0x48, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x4c, 0x4f, 0x43,
0x44, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x4d, 0x4d, 0x53, 0x5f, 0x4e, 0x45, 0x45, 0x44, 0x53, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x49, 0x43, 0x48, 0x5f,
0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x4c, 0x4f, 0x41, 0x44, 0x10, 0x09, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x43, 0x41, 0x52, 0x44, 0x10, 0x07, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x43, 0x41, 0x52, 0x44, 0x10,
0x45, 0x50, 0x4c, 0x59, 0x10, 0x0a, 0x2a, 0x3a, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x4d, 0x4d, 0x53, 0x5f, 0x4e, 0x45, 0x45, 0x44, 0x53, 0x5f, 0x44,
0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x4f, 0x57, 0x4e, 0x4c, 0x4f, 0x41, 0x44, 0x10, 0x09, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x45, 0x50,
0x57, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x4c, 0x59, 0x10, 0x0a, 0x2a, 0x44, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75,
0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x45, 0x4e, 0x54, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e,
0x10, 0x01, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2e, 0x2f, 0x2e, 0x2e, 0x2f, 0x62, 0x69, 0x6e, 0x61, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x45, 0x4e,
0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x54, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x05,
0x12, 0x08, 0x0a, 0x04, 0x52, 0x45, 0x41, 0x44, 0x10, 0x0b, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2e,
0x2f, 0x2e, 0x2e, 0x2f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
} }
var ( var (
@ -1995,16 +2001,17 @@ var file_conversations_proto_depIdxs = []int32{
15, // 11: conversations.MessageInfo.messageContent:type_name -> conversations.MessageContent 15, // 11: conversations.MessageInfo.messageContent:type_name -> conversations.MessageContent
13, // 12: conversations.MessageInfo.imageContent:type_name -> conversations.ImageContent 13, // 12: conversations.MessageInfo.imageContent:type_name -> conversations.ImageContent
14, // 13: conversations.ImageContent.pixels:type_name -> conversations.ImagePixels 14, // 13: conversations.ImageContent.pixels:type_name -> conversations.ImagePixels
19, // 14: conversations.Conversations.conversations:type_name -> conversations.Conversation 1, // 14: conversations.MessageStatus.code:type_name -> conversations.MsgStatusCode
22, // 15: conversations.Conversation.latestMessage:type_name -> conversations.LatestMessage 19, // 15: conversations.Conversations.conversations:type_name -> conversations.Conversation
20, // 16: conversations.Conversation.participants:type_name -> conversations.Participant 22, // 16: conversations.Conversation.latestMessage:type_name -> conversations.LatestMessage
21, // 17: conversations.Participant.smallInfo:type_name -> conversations.SmallInfo 20, // 17: conversations.Conversation.participants:type_name -> conversations.Participant
24, // 18: conversations.Participant.muted:type_name -> conversations.Muted 21, // 18: conversations.Participant.smallInfo:type_name -> conversations.SmallInfo
19, // [19:19] is the sub-list for method output_type 24, // 19: conversations.Participant.muted:type_name -> conversations.Muted
19, // [19:19] is the sub-list for method input_type 20, // [20:20] is the sub-list for method output_type
19, // [19:19] is the sub-list for extension type_name 20, // [20:20] is the sub-list for method input_type
19, // [19:19] is the sub-list for extension extendee 20, // [20:20] is the sub-list for extension type_name
0, // [0:19] is the sub-list for field type_name 20, // [20:20] is the sub-list for extension extendee
0, // [0:20] is the sub-list for field type_name
} }
func init() { file_conversations_proto_init() } func init() { file_conversations_proto_init() }

View file

@ -288,6 +288,53 @@ func (x *PairDeviceData) GetBrowser() *Device {
return nil return nil
} }
type UnpairDeviceData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Browser *Device `protobuf:"bytes,1,opt,name=browser,proto3" json:"browser,omitempty"`
}
func (x *UnpairDeviceData) Reset() {
*x = UnpairDeviceData{}
if protoimpl.UnsafeEnabled {
mi := &file_pairing_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UnpairDeviceData) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UnpairDeviceData) ProtoMessage() {}
func (x *UnpairDeviceData) ProtoReflect() protoreflect.Message {
mi := &file_pairing_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UnpairDeviceData.ProtoReflect.Descriptor instead.
func (*UnpairDeviceData) Descriptor() ([]byte, []int) {
return file_pairing_proto_rawDescGZIP(), []int{4}
}
func (x *UnpairDeviceData) GetBrowser() *Device {
if x != nil {
return x.Browser
}
return nil
}
type WebAuthKey struct { type WebAuthKey struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -300,7 +347,7 @@ type WebAuthKey struct {
func (x *WebAuthKey) Reset() { func (x *WebAuthKey) Reset() {
*x = WebAuthKey{} *x = WebAuthKey{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_pairing_proto_msgTypes[4] mi := &file_pairing_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -313,7 +360,7 @@ func (x *WebAuthKey) String() string {
func (*WebAuthKey) ProtoMessage() {} func (*WebAuthKey) ProtoMessage() {}
func (x *WebAuthKey) ProtoReflect() protoreflect.Message { func (x *WebAuthKey) ProtoReflect() protoreflect.Message {
mi := &file_pairing_proto_msgTypes[4] mi := &file_pairing_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -326,7 +373,7 @@ func (x *WebAuthKey) ProtoReflect() protoreflect.Message {
// Deprecated: Use WebAuthKey.ProtoReflect.Descriptor instead. // Deprecated: Use WebAuthKey.ProtoReflect.Descriptor instead.
func (*WebAuthKey) Descriptor() ([]byte, []int) { func (*WebAuthKey) Descriptor() ([]byte, []int) {
return file_pairing_proto_rawDescGZIP(), []int{4} return file_pairing_proto_rawDescGZIP(), []int{5}
} }
func (x *WebAuthKey) GetWebAuthKey() []byte { func (x *WebAuthKey) GetWebAuthKey() []byte {
@ -351,12 +398,13 @@ type Container struct {
PhoneRelay *PhoneRelayBody `protobuf:"bytes,1,opt,name=PhoneRelay,proto3" json:"PhoneRelay,omitempty"` PhoneRelay *PhoneRelayBody `protobuf:"bytes,1,opt,name=PhoneRelay,proto3" json:"PhoneRelay,omitempty"`
BrowserDetails *BrowserDetails `protobuf:"bytes,3,opt,name=browserDetails,proto3" json:"browserDetails,omitempty"` BrowserDetails *BrowserDetails `protobuf:"bytes,3,opt,name=browserDetails,proto3" json:"browserDetails,omitempty"`
PairDeviceData *PairDeviceData `protobuf:"bytes,4,opt,name=pairDeviceData,proto3" json:"pairDeviceData,omitempty"` PairDeviceData *PairDeviceData `protobuf:"bytes,4,opt,name=pairDeviceData,proto3" json:"pairDeviceData,omitempty"`
UnpairDeviceData *UnpairDeviceData `protobuf:"bytes,5,opt,name=unpairDeviceData,proto3" json:"unpairDeviceData,omitempty"`
} }
func (x *Container) Reset() { func (x *Container) Reset() {
*x = Container{} *x = Container{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_pairing_proto_msgTypes[5] mi := &file_pairing_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -369,7 +417,7 @@ func (x *Container) String() string {
func (*Container) ProtoMessage() {} func (*Container) ProtoMessage() {}
func (x *Container) ProtoReflect() protoreflect.Message { func (x *Container) ProtoReflect() protoreflect.Message {
mi := &file_pairing_proto_msgTypes[5] mi := &file_pairing_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -382,7 +430,7 @@ func (x *Container) ProtoReflect() protoreflect.Message {
// Deprecated: Use Container.ProtoReflect.Descriptor instead. // Deprecated: Use Container.ProtoReflect.Descriptor instead.
func (*Container) Descriptor() ([]byte, []int) { func (*Container) Descriptor() ([]byte, []int) {
return file_pairing_proto_rawDescGZIP(), []int{5} return file_pairing_proto_rawDescGZIP(), []int{6}
} }
func (x *Container) GetPhoneRelay() *PhoneRelayBody { func (x *Container) GetPhoneRelay() *PhoneRelayBody {
@ -406,6 +454,13 @@ func (x *Container) GetPairDeviceData() *PairDeviceData {
return nil return nil
} }
func (x *Container) GetUnpairDeviceData() *UnpairDeviceData {
if x != nil {
return x.UnpairDeviceData
}
return nil
}
type UrlData struct { type UrlData struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -419,7 +474,7 @@ type UrlData struct {
func (x *UrlData) Reset() { func (x *UrlData) Reset() {
*x = UrlData{} *x = UrlData{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_pairing_proto_msgTypes[6] mi := &file_pairing_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -432,7 +487,7 @@ func (x *UrlData) String() string {
func (*UrlData) ProtoMessage() {} func (*UrlData) ProtoMessage() {}
func (x *UrlData) ProtoReflect() protoreflect.Message { func (x *UrlData) ProtoReflect() protoreflect.Message {
mi := &file_pairing_proto_msgTypes[6] mi := &file_pairing_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -445,7 +500,7 @@ func (x *UrlData) ProtoReflect() protoreflect.Message {
// Deprecated: Use UrlData.ProtoReflect.Descriptor instead. // Deprecated: Use UrlData.ProtoReflect.Descriptor instead.
func (*UrlData) Descriptor() ([]byte, []int) { func (*UrlData) Descriptor() ([]byte, []int) {
return file_pairing_proto_rawDescGZIP(), []int{6} return file_pairing_proto_rawDescGZIP(), []int{7}
} }
func (x *UrlData) GetPairingKey() []byte { func (x *UrlData) GetPairingKey() []byte {
@ -508,11 +563,15 @@ var file_pairing_proto_rawDesc = []byte{
0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2a, 0x0a, 0x07, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2a, 0x0a, 0x07, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x73, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65,
0x72, 0x22, 0x3e, 0x0a, 0x10, 0x55, 0x6e, 0x70, 0x61, 0x69, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63,
0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2a, 0x0a, 0x07, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x73, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65,
0x72, 0x22, 0x48, 0x0a, 0x0a, 0x57, 0x65, 0x62, 0x41, 0x75, 0x74, 0x68, 0x4b, 0x65, 0x79, 0x12, 0x72, 0x22, 0x48, 0x0a, 0x0a, 0x57, 0x65, 0x62, 0x41, 0x75, 0x74, 0x68, 0x4b, 0x65, 0x79, 0x12,
0x1e, 0x0a, 0x0a, 0x77, 0x65, 0x62, 0x41, 0x75, 0x74, 0x68, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x1e, 0x0a, 0x0a, 0x77, 0x65, 0x62, 0x41, 0x75, 0x74, 0x68, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0c, 0x52, 0x0a, 0x77, 0x65, 0x62, 0x41, 0x75, 0x74, 0x68, 0x4b, 0x65, 0x79, 0x12, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x77, 0x65, 0x62, 0x41, 0x75, 0x74, 0x68, 0x4b, 0x65, 0x79, 0x12,
0x1a, 0x0a, 0x08, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x46, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x1a, 0x0a, 0x08, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x46, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28,
0x03, 0x52, 0x08, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x46, 0x6f, 0x72, 0x22, 0xc6, 0x01, 0x0a, 0x09, 0x03, 0x52, 0x08, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x46, 0x6f, 0x72, 0x22, 0x8d, 0x02, 0x0a, 0x09,
0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x0a, 0x50, 0x68, 0x6f, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x0a, 0x50, 0x68, 0x6f,
0x6e, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e,
0x70, 0x61, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x6c, 0x70, 0x61, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x6c,
@ -525,15 +584,19 @@ var file_pairing_proto_rawDesc = []byte{
0x65, 0x44, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, 0x65, 0x44, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61,
0x69, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x69, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x69, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65,
0x44, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x70, 0x61, 0x69, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x70, 0x61, 0x69, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65,
0x44, 0x61, 0x74, 0x61, 0x22, 0x6b, 0x0a, 0x07, 0x55, 0x72, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x44, 0x61, 0x74, 0x61, 0x12, 0x45, 0x0a, 0x10, 0x75, 0x6e, 0x70, 0x61, 0x69, 0x72, 0x44, 0x65,
0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x76, 0x69, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19,
0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x61, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x70, 0x61, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x55, 0x6e, 0x70, 0x61, 0x69, 0x72, 0x44,
0x22, 0x0a, 0x0c, 0x41, 0x45, 0x53, 0x43, 0x54, 0x52, 0x32, 0x35, 0x36, 0x4b, 0x65, 0x79, 0x18, 0x65, 0x76, 0x69, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x10, 0x75, 0x6e, 0x70, 0x61, 0x69,
0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x41, 0x45, 0x53, 0x43, 0x54, 0x52, 0x32, 0x35, 0x36, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x22, 0x6b, 0x0a, 0x07, 0x55,
0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x4b, 0x65, 0x79, 0x72, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x69, 0x72, 0x69, 0x6e,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x4b, 0x65, 0x67, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x61, 0x69, 0x72,
0x79, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2e, 0x2f, 0x2e, 0x2e, 0x2f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x45, 0x53, 0x43, 0x54, 0x52,
0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x32, 0x35, 0x36, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x41, 0x45,
0x53, 0x43, 0x54, 0x52, 0x32, 0x35, 0x36, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x48,
0x41, 0x32, 0x35, 0x36, 0x4b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x53,
0x48, 0x41, 0x32, 0x35, 0x36, 0x4b, 0x65, 0x79, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2e, 0x2f, 0x2e,
0x2e, 0x2f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -548,32 +611,35 @@ func file_pairing_proto_rawDescGZIP() []byte {
return file_pairing_proto_rawDescData return file_pairing_proto_rawDescData
} }
var file_pairing_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_pairing_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_pairing_proto_goTypes = []interface{}{ var file_pairing_proto_goTypes = []interface{}{
(*BrowserDetails)(nil), // 0: pairing.BrowserDetails (*BrowserDetails)(nil), // 0: pairing.BrowserDetails
(*PhoneRelayBody)(nil), // 1: pairing.PhoneRelayBody (*PhoneRelayBody)(nil), // 1: pairing.PhoneRelayBody
(*ECDSAKeys)(nil), // 2: pairing.ECDSAKeys (*ECDSAKeys)(nil), // 2: pairing.ECDSAKeys
(*PairDeviceData)(nil), // 3: pairing.PairDeviceData (*PairDeviceData)(nil), // 3: pairing.PairDeviceData
(*WebAuthKey)(nil), // 4: pairing.WebAuthKey (*UnpairDeviceData)(nil), // 4: pairing.UnpairDeviceData
(*Container)(nil), // 5: pairing.Container (*WebAuthKey)(nil), // 5: pairing.WebAuthKey
(*UrlData)(nil), // 6: pairing.UrlData (*Container)(nil), // 6: pairing.Container
(*Date)(nil), // 7: messages.Date (*UrlData)(nil), // 7: pairing.UrlData
(*Device)(nil), // 8: messages.Device (*Date)(nil), // 8: messages.Date
(*Device)(nil), // 9: messages.Device
} }
var file_pairing_proto_depIdxs = []int32{ var file_pairing_proto_depIdxs = []int32{
7, // 0: pairing.PhoneRelayBody.date:type_name -> messages.Date 8, // 0: pairing.PhoneRelayBody.date:type_name -> messages.Date
8, // 1: pairing.PairDeviceData.mobile:type_name -> messages.Device 9, // 1: pairing.PairDeviceData.mobile:type_name -> messages.Device
2, // 2: pairing.PairDeviceData.ecdsaKeys:type_name -> pairing.ECDSAKeys 2, // 2: pairing.PairDeviceData.ecdsaKeys:type_name -> pairing.ECDSAKeys
4, // 3: pairing.PairDeviceData.webAuthKeyData:type_name -> pairing.WebAuthKey 5, // 3: pairing.PairDeviceData.webAuthKeyData:type_name -> pairing.WebAuthKey
8, // 4: pairing.PairDeviceData.browser:type_name -> messages.Device 9, // 4: pairing.PairDeviceData.browser:type_name -> messages.Device
1, // 5: pairing.Container.PhoneRelay:type_name -> pairing.PhoneRelayBody 9, // 5: pairing.UnpairDeviceData.browser:type_name -> messages.Device
0, // 6: pairing.Container.browserDetails:type_name -> pairing.BrowserDetails 1, // 6: pairing.Container.PhoneRelay:type_name -> pairing.PhoneRelayBody
3, // 7: pairing.Container.pairDeviceData:type_name -> pairing.PairDeviceData 0, // 7: pairing.Container.browserDetails:type_name -> pairing.BrowserDetails
8, // [8:8] is the sub-list for method output_type 3, // 8: pairing.Container.pairDeviceData:type_name -> pairing.PairDeviceData
8, // [8:8] is the sub-list for method input_type 4, // 9: pairing.Container.unpairDeviceData:type_name -> pairing.UnpairDeviceData
8, // [8:8] is the sub-list for extension type_name 10, // [10:10] is the sub-list for method output_type
8, // [8:8] is the sub-list for extension extendee 10, // [10:10] is the sub-list for method input_type
0, // [0:8] is the sub-list for field type_name 10, // [10:10] is the sub-list for extension type_name
10, // [10:10] is the sub-list for extension extendee
0, // [0:10] is the sub-list for field type_name
} }
func init() { file_pairing_proto_init() } func init() { file_pairing_proto_init() }
@ -632,7 +698,7 @@ func file_pairing_proto_init() {
} }
} }
file_pairing_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_pairing_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WebAuthKey); i { switch v := v.(*UnpairDeviceData); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -644,7 +710,7 @@ func file_pairing_proto_init() {
} }
} }
file_pairing_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_pairing_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Container); i { switch v := v.(*WebAuthKey); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -656,6 +722,18 @@ func file_pairing_proto_init() {
} }
} }
file_pairing_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { file_pairing_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Container); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pairing_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UrlData); i { switch v := v.(*UrlData); i {
case 0: case 0:
return &v.state return &v.state
@ -674,7 +752,7 @@ func file_pairing_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pairing_proto_rawDesc, RawDescriptor: file_pairing_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 7, NumMessages: 8,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View file

@ -115,8 +115,9 @@ message IsFromMe {
enum MsgStatusCode { enum MsgStatusCode {
UNKNOWN_STATUS = 0; UNKNOWN_STATUS = 0;
SENDING = 5;
SENT = 1; SENT = 1;
SENDING = 5;
READ = 11;
} }
message MessageStatus { message MessageStatus {
@ -129,7 +130,7 @@ message MessageStatus {
// RCS // RCS
READ|SEEN = 11; READ|SEEN = 11;
*/ */
int64 code = 2; MsgStatusCode code = 2;
string errMsg = 4; string errMsg = 4;
string msgStatus = 5; string msgStatus = 5;
} }

View file

@ -31,6 +31,10 @@ message PairDeviceData {
messages.Device browser = 3; messages.Device browser = 3;
} }
message UnpairDeviceData {
messages.Device browser = 1;
}
message WebAuthKey { message WebAuthKey {
bytes webAuthKey = 1; bytes webAuthKey = 1;
int64 validFor = 2; int64 validFor = 2;
@ -40,6 +44,7 @@ message Container {
PhoneRelayBody PhoneRelay = 1; PhoneRelayBody PhoneRelay = 1;
BrowserDetails browserDetails = 3; BrowserDetails browserDetails = 3;
PairDeviceData pairDeviceData = 4; PairDeviceData pairDeviceData = 4;
UnpairDeviceData unpairDeviceData = 5;
} }
message UrlData { message UrlData {

View file

@ -95,8 +95,14 @@ func (c *Client) Connect(rpcKey []byte) error {
} }
c.rpc.rpcSessionID = receiveMesageSessionID c.rpc.rpcSessionID = receiveMesageSessionID
c.rpcKey = rpcKey c.rpcKey = rpcKey
c.rpc.ListenReceiveMessages(rpcPayload) go c.rpc.ListenReceiveMessages(rpcPayload)
c.Logger.Debug().Any("rpcKey", rpcKey).Msg("Successfully connected to server") c.Logger.Debug().Any("rpcKey", rpcKey).Msg("Successfully connected to server")
if c.devicePair != nil {
sendInitialDataErr := c.rpc.sendInitialData()
if sendInitialDataErr != nil {
panic(sendInitialDataErr)
}
}
return nil return nil
} }

View file

@ -1,16 +1,25 @@
package libgm package libgm
import ( import (
"encoding/base64"
"google.golang.org/protobuf/proto"
"go.mau.fi/mautrix-gmessages/libgm/binary" "go.mau.fi/mautrix-gmessages/libgm/binary"
) )
func (c *Client) handleEventOpCode(response *Response) { func (c *Client) handleEventOpCode(response *Response) {
c.Logger.Debug().Any("res", response).Msg("got event response?") c.Logger.Debug().Any("res", response).Msg("got event response?")
eventData := &binary.Event{} eventData := &binary.Event{}
decryptedErr := c.cryptor.DecryptAndDecodeData(response.Data.EncryptedData, eventData) data, decryptedErr := c.cryptor.Decrypt(response.Data.EncryptedData)
if decryptedErr != nil { if decryptedErr != nil {
panic(decryptedErr) panic(decryptedErr)
} }
c.Logger.Debug().Str("protobuf_data", base64.StdEncoding.EncodeToString(data)).Msg("decrypted data")
err := proto.Unmarshal(data, eventData)
if err != nil {
panic(err)
}
switch evt := eventData.Event.(type) { switch evt := eventData.Event.(type) {
case *binary.Event_MessageEvent: case *binary.Event_MessageEvent:
c.handleMessageEvent(response, evt) c.handleMessageEvent(response, evt)

View file

@ -1,18 +1,15 @@
package events package events
import ( import (
"go.mau.fi/mautrix-gmessages/libgm/binary"
"go.mau.fi/mautrix-gmessages/libgm/util" "go.mau.fi/mautrix-gmessages/libgm/util"
) )
type ClientReady struct { type ClientReady struct {
Session *util.SessionResponse Session *util.SessionResponse
Conversations []*binary.Conversation
} }
func NewClientReady(session *util.SessionResponse, conversationList *binary.Conversations) *ClientReady { func NewClientReady(session *util.SessionResponse) *ClientReady {
return &ClientReady{ return &ClientReady{
Session: session, Session: session,
Conversations: conversationList.Conversations,
} }
} }

View file

@ -18,8 +18,17 @@ func (c *Client) handleSeperateOpCode(msgData *binary.MessageData) {
if err != nil { if err != nil {
panic(err) panic(err)
} }
if decodedData.UnpairDeviceData != nil {
c.Logger.Warn().Any("data", decodedData).Msg("Unpaired?")
return
}
// TODO unpairing
c.Logger.Debug().Any("data", decodedData).Msg("Paired device decoded data") c.Logger.Debug().Any("data", decodedData).Msg("Paired device decoded data")
if c.pairer != nil {
c.pairer.pairCallback(decodedData) c.pairer.pairCallback(decodedData)
} else {
c.Logger.Warn().Msg("No pairer to receive callback")
}
default: default:
decodedData := &binary.EncodedResponse{} decodedData := &binary.EncodedResponse{}
err = binary.DecodeProtoMessage(decodedBytes, decodedData) err = binary.DecodeProtoMessage(decodedBytes, decodedData)

View file

@ -153,4 +153,5 @@ func (p *Pairer) pairCallback(pairData *binary.Container) {
p.client.devicePair = &DevicePair{Mobile: pairData.PairDeviceData.Mobile, Browser: pairData.PairDeviceData.Browser} p.client.devicePair = &DevicePair{Mobile: pairData.PairDeviceData.Mobile, Browser: pairData.PairDeviceData.Browser}
p.client.pairer.GetWebEncryptionKey() p.client.pairer.GetWebEncryptionKey()
p.client.triggerEvent(&events.PairSuccessful{Container: pairData}) p.client.triggerEvent(&events.PairSuccessful{Container: pairData})
p.client.pairer = nil
} }

View file

@ -22,6 +22,8 @@ type RPC struct {
} }
func (r *RPC) ListenReceiveMessages(payload []byte) { func (r *RPC) ListenReceiveMessages(payload []byte) {
for {
r.client.Logger.Debug().Msg("Starting new long-polling request")
req, err := http.NewRequest("POST", util.RECEIVE_MESSAGES, bytes.NewReader(payload)) req, err := http.NewRequest("POST", util.RECEIVE_MESSAGES, bytes.NewReader(payload))
if err != nil { if err != nil {
panic(fmt.Errorf("Error creating request: %v", err)) panic(fmt.Errorf("Error creating request: %v", err))
@ -33,7 +35,8 @@ func (r *RPC) ListenReceiveMessages(payload []byte) {
panic(fmt.Errorf("Error making request: %v", err)) panic(fmt.Errorf("Error making request: %v", err))
} }
r.conn = resp.Body r.conn = resp.Body
go r.startReadingData(resp.Body) r.startReadingData(resp.Body)
}
} }
/* /*
@ -156,12 +159,7 @@ func (r *RPC) sendInitialData() error {
return err return err
} }
conversationList, convErr := r.client.Conversations.List(25) evtData := events.NewClientReady(sessionResponse)
if convErr != nil {
return convErr
}
evtData := events.NewClientReady(sessionResponse, conversationList)
r.client.triggerEvent(evtData) r.client.triggerEvent(evtData)
r.client.sessionHandler.startAckInterval() r.client.sessionHandler.startAckInterval()
return nil return nil