Add support for draft/event-playback

This commit is contained in:
Simon Ser
2021-06-04 19:45:51 +02:00
parent 651e255ddb
commit 34078d5da7
4 changed files with 65 additions and 34 deletions

View File

@@ -13,6 +13,7 @@ const permanentCaps = [
"setname",
"draft/chathistory",
"draft/event-playback",
"soju.im/bouncer-networks",
];
@@ -160,6 +161,7 @@ export default class Client extends EventTarget {
msgBatch = this.batches.get(msg.tags["batch"]);
if (msgBatch) {
msgBatch.messages.push(msg);
msg.batch = msgBatch;
}
}

View File

@@ -533,3 +533,14 @@ export function parseMembershipModes(str) {
}
return memberships;
}
export function findBatchByType(msg, type) {
var batch = msg.batch;
while (batch) {
if (batch.type === type) {
return batch;
}
batch = batch.parent;
}
return null;
}