Add support for labeled-response

It's just used to avoid mixing up messages coming from the server
so far.
This commit is contained in:
Simon Ser 2021-06-04 20:38:01 +02:00
parent 34078d5da7
commit 0dfb7623db
3 changed files with 43 additions and 5 deletions

View file

@ -544,3 +544,19 @@ export function findBatchByType(msg, type) {
}
return null;
}
export function getMessageLabel(msg) {
if (msg.tags.label) {
return msg.tags.label;
}
var batch = msg.batch;
while (batch) {
if (batch.tags.label) {
return batch.tags.label;
}
batch = batch.parent;
}
return null;
}