Skip to content

Commit 944aa5d

Browse files
committed
api [nfc]: Use RawParameter when passing queue_id
Strings in general should not be JSON-encoded in Zulip APIs. We will handle local_id separately because that's a bit different.
1 parent 818bc6d commit 944aa5d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/api/route/messages.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ Future<SendMessageResult> sendMessage(
193193
'to': destination.userIds,
194194
}}),
195195
'content': RawParameter(content),
196-
if (queueId != null) 'queue_id': queueId, // TODO should this use RawParameter?
196+
if (queueId != null) 'queue_id': RawParameter(queueId),
197197
if (localId != null) 'local_id': localId, // TODO should this use RawParameter?
198198
if (readBySender != null) 'read_by_sender': readBySender,
199199
},

test/api/route/messages_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ void main() {
362362
'to': streamId.toString(),
363363
'topic': topic,
364364
'content': content,
365-
'queue_id': '"abc:123"',
365+
'queue_id': 'abc:123',
366366
'local_id': '"456"',
367367
'read_by_sender': 'true',
368368
});

0 commit comments

Comments
 (0)