Skip to content

Commit b2aad4c

Browse files
committed
Ensure messages in multiline batches will not have forbidden tags.
1 parent 152c323 commit b2aad4c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

data/src/client.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use chrono::{DateTime, Utc};
1010
use futures::channel::mpsc;
1111
use futures::{Future, FutureExt};
1212
use indexmap::IndexMap;
13-
use irc::proto::{self, Command, Tags, command};
13+
use irc::proto::{self, Command, Tags, command, tags};
1414
use itertools::{Either, Itertools};
1515
use tokio::fs;
1616

@@ -606,10 +606,10 @@ impl Client {
606606
opening_batch.tags.insert("label".to_string(), label);
607607
}
608608

609+
// Overwrite any existing tags, since messages in the batch can only
610+
// have draft/multiline-concat and batch tags
609611
for message in messages.iter_mut() {
610-
message
611-
.tags
612-
.insert("batch".to_string(), reference_tag.clone());
612+
message.tags = tags![ "batch" => reference_tag.clone() ];
613613
}
614614

615615
let closing_batch: message::Encoded =

0 commit comments

Comments
 (0)