Skip to content

Commit a4d6e43

Browse files
committed
properly decode messages with correct protobuf type
1 parent 650ded2 commit a4d6e43

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sogs/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010

1111
def message_body(data: bytes):
1212
"""given a bunch of bytes for a protobuf message return the message's body"""
13-
msg = protobuf.DataMessage()
13+
msg = protobuf.Content()
1414
msg.ParseFromString(data)
15-
return msg.body
15+
if msg.dataMessage is None:
16+
return None
17+
return msg.dataMessage.body
1618

1719

1820
def encode_base64(data: bytes):

0 commit comments

Comments
 (0)