@@ -59,7 +59,7 @@ type MessageView struct {
5959 UserId string `json:"user_id"`
6060 MessageId string `json:"message_id"`
6161 Category string `json:"category"`
62- Data string `json:"data "`
62+ DataBase64 string `json:"data_base64 "`
6363 RepresentativeId string `json:"representative_id"`
6464 QuoteMessageId string `json:"quote_message_id"`
6565 Status string `json:"status"`
@@ -187,7 +187,7 @@ func (b *BlazeClient) SendMessage(ctx context.Context, conversationId, recipient
187187 "recipient_id" : recipientId ,
188188 "message_id" : messageId ,
189189 "category" : category ,
190- "data " : base64 .StdEncoding .EncodeToString ([]byte (content )),
190+ "data_base64 " : base64 .RawURLEncoding .EncodeToString ([]byte (content )),
191191 "representative_id" : representativeId ,
192192 }
193193 if err := writeMessageAndWait (ctx , b .mc , createMessageAction , params ); err != nil {
@@ -202,7 +202,7 @@ func (b *BlazeClient) SendPlainText(ctx context.Context, msg MessageView, conten
202202 "recipient_id" : msg .UserId ,
203203 "message_id" : UuidNewV4 ().String (),
204204 "category" : MessageCategoryPlainText ,
205- "data " : base64 .StdEncoding .EncodeToString ([]byte (content )),
205+ "data_base64 " : base64 .RawURLEncoding .EncodeToString ([]byte (content )),
206206 }
207207 if err := writeMessageAndWait (ctx , b .mc , createMessageAction , params ); err != nil {
208208 return BlazeServerError (ctx , err )
@@ -220,7 +220,7 @@ func (b *BlazeClient) SendRecallMessage(ctx context.Context, conversationId, rec
220220 "recipient_id" : recipientId ,
221221 "message_id" : UuidNewV4 ().String (),
222222 "category" : MessageCategoryMessageRecall ,
223- "data " : base64 .StdEncoding .EncodeToString (a ),
223+ "data_base64 " : base64 .RawURLEncoding .EncodeToString (a ),
224224 }
225225 if err := writeMessageAndWait (ctx , b .mc , createMessageAction , params ); err != nil {
226226 return BlazeServerError (ctx , err )
@@ -234,7 +234,7 @@ func (b *BlazeClient) SendPost(ctx context.Context, msg MessageView, content str
234234 "recipient_id" : msg .UserId ,
235235 "message_id" : UuidNewV4 ().String (),
236236 "category" : MessageCategoryPlainPost ,
237- "data " : base64 .StdEncoding .EncodeToString ([]byte (content )),
237+ "data_base64 " : base64 .RawURLEncoding .EncodeToString ([]byte (content )),
238238 }
239239 if err := writeMessageAndWait (ctx , b .mc , createMessageAction , params ); err != nil {
240240 return BlazeServerError (ctx , err )
@@ -250,7 +250,7 @@ func (b *BlazeClient) SendContact(ctx context.Context, conversationId, recipient
250250 "recipient_id" : recipientId ,
251251 "message_id" : UuidNewV4 ().String (),
252252 "category" : MessageCategoryPlainContact ,
253- "data " : base64 .StdEncoding .EncodeToString (contactData ),
253+ "data_base64 " : base64 .RawURLEncoding .EncodeToString (contactData ),
254254 }
255255 if err := writeMessageAndWait (ctx , b .mc , createMessageAction , params ); err != nil {
256256 return BlazeServerError (ctx , err )
@@ -273,7 +273,7 @@ func (b *BlazeClient) SendAppCard(ctx context.Context, conversationId, recipient
273273 "recipient_id" : recipientId ,
274274 "message_id" : UuidNewV4 ().String (),
275275 "category" : MessageCategoryAppCard ,
276- "data " : base64 .StdEncoding .EncodeToString (data ),
276+ "data_base64 " : base64 .RawURLEncoding .EncodeToString (data ),
277277 }
278278 err = writeMessageAndWait (ctx , b .mc , createMessageAction , params )
279279 if err != nil {
@@ -296,7 +296,7 @@ func (b *BlazeClient) SendAppButton(ctx context.Context, conversationId, recipie
296296 "recipient_id" : recipientId ,
297297 "message_id" : UuidNewV4 ().String (),
298298 "category" : MessageCategoryAppButtonGroup ,
299- "data " : base64 .StdEncoding .EncodeToString (btns ),
299+ "data_base64 " : base64 .RawURLEncoding .EncodeToString (btns ),
300300 }
301301 err = writeMessageAndWait (ctx , b .mc , createMessageAction , params )
302302 if err != nil {
@@ -318,7 +318,7 @@ func (b *BlazeClient) SendGroupAppButton(ctx context.Context, conversationId, re
318318 "recipient_id" : recipientId ,
319319 "message_id" : UuidNewV4 ().String (),
320320 "category" : MessageCategoryAppButtonGroup ,
321- "data " : base64 .StdEncoding .EncodeToString (btns ),
321+ "data_base64 " : base64 .RawURLEncoding .EncodeToString (btns ),
322322 }
323323 err = writeMessageAndWait (ctx , b .mc , createMessageAction , params )
324324 if err != nil {
0 commit comments