Fix protobuf type of incoming message/conversation events
This commit is contained in:
parent
8fcb4283a9
commit
821849a25b
4 changed files with 19 additions and 15 deletions
|
@ -190,19 +190,23 @@ func (c *Client) handleUpdatesEvent(msg *IncomingRPCMessage) {
|
|||
c.triggerEvent(evt.SettingsEvent)
|
||||
|
||||
case *gmproto.UpdateEvents_ConversationEvent:
|
||||
if c.deduplicateUpdate(evt.ConversationEvent.GetData().GetConversationID(), msg) {
|
||||
return
|
||||
for _, part := range evt.ConversationEvent.GetData() {
|
||||
if c.deduplicateUpdate(part.GetConversationID(), msg) {
|
||||
return
|
||||
}
|
||||
c.triggerEvent(part)
|
||||
}
|
||||
c.triggerEvent(evt.ConversationEvent.GetData())
|
||||
|
||||
case *gmproto.UpdateEvents_MessageEvent:
|
||||
if c.deduplicateUpdate(evt.MessageEvent.GetData().GetMessageID(), msg) {
|
||||
return
|
||||
for _, part := range evt.MessageEvent.GetData() {
|
||||
if c.deduplicateUpdate(part.GetMessageID(), msg) {
|
||||
return
|
||||
}
|
||||
c.triggerEvent(&WrappedMessage{
|
||||
Message: part,
|
||||
Data: msg.DecryptedData,
|
||||
})
|
||||
}
|
||||
c.triggerEvent(&WrappedMessage{
|
||||
Message: evt.MessageEvent.GetData(),
|
||||
Data: msg.DecryptedData,
|
||||
})
|
||||
|
||||
case *gmproto.UpdateEvents_TypingEvent:
|
||||
c.logContent(msg, "", nil)
|
||||
|
|
|
@ -290,7 +290,7 @@ type ConversationEvent struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Data *Conversation `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
|
||||
Data []*Conversation `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ConversationEvent) Reset() {
|
||||
|
@ -325,7 +325,7 @@ func (*ConversationEvent) Descriptor() ([]byte, []int) {
|
|||
return file_events_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ConversationEvent) GetData() *Conversation {
|
||||
func (x *ConversationEvent) GetData() []*Conversation {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ type MessageEvent struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Data *Message `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
|
||||
Data []*Message `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"`
|
||||
}
|
||||
|
||||
func (x *MessageEvent) Reset() {
|
||||
|
@ -419,7 +419,7 @@ func (*MessageEvent) Descriptor() ([]byte, []int) {
|
|||
return file_events_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *MessageEvent) GetData() *Message {
|
||||
func (x *MessageEvent) GetData() []*Message {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -35,7 +35,7 @@ message UpdateEvents {
|
|||
}
|
||||
|
||||
message ConversationEvent {
|
||||
conversations.Conversation data = 2;
|
||||
repeated conversations.Conversation data = 2;
|
||||
}
|
||||
|
||||
message TypingEvent {
|
||||
|
@ -43,7 +43,7 @@ message TypingEvent {
|
|||
}
|
||||
|
||||
message MessageEvent {
|
||||
conversations.Message data = 2;
|
||||
repeated conversations.Message data = 2;
|
||||
}
|
||||
|
||||
message UserAlertEvent {
|
||||
|
|
Loading…
Reference in a new issue