diff --git a/src/client.js b/src/client.js index 20b29d13a..1f86301d3 100644 --- a/src/client.js +++ b/src/client.js @@ -1735,11 +1735,11 @@ MatrixClient.prototype._sendCompleteEvent = function(roomId, eventObject, txnId, // that hasn't been sent yet (e.g. with a local id starting with a ~) // then listen for the remote echo of that event so that by the time // this event does get sent, we have the correct event_id - const targetId = localEvent.getRelatedId(); + const targetId = localEvent.getAssociatedId(); if (targetId && targetId.startsWith("~")) { const target = room.getPendingEvents().find(e => e.getId() === targetId); target.once("Event.localEventIdReplaced", () => { - localEvent.updateRelatedId(target.getId()); + localEvent.updateAssociatedId(target.getId()); }); } const type = localEvent.getType(); diff --git a/src/models/event.js b/src/models/event.js index 43036acc9..a1784d6b4 100644 --- a/src/models/event.js +++ b/src/models/event.js @@ -900,7 +900,7 @@ utils.extend(module.exports.MatrixEvent.prototype, { * * @return {string?} */ - getRelatedId() { + getAssociatedId() { const relation = this.getRelation(); if (relation) { return relation.event_id; @@ -917,7 +917,7 @@ utils.extend(module.exports.MatrixEvent.prototype, { * * @param {string} eventId the new event id */ - updateRelatedId(eventId) { + updateAssociatedId(eventId) { const relation = this.getRelation(); if (relation) { relation.event_id = eventId; diff --git a/src/scheduler.js b/src/scheduler.js index cda8c21ec..b3461bebd 100644 --- a/src/scheduler.js +++ b/src/scheduler.js @@ -177,7 +177,8 @@ MatrixScheduler.RETRY_BACKOFF_RATELIMIT = function(event, attempts, err) { * @see module:scheduler~queueAlgorithm */ MatrixScheduler.QUEUE_MESSAGES = function(event) { - if (event.getType() === "m.room.message" || !!event.getRelatedId()) { + // enqueue messages or events that associate with another event (redactions and relations) + if (event.getType() === "m.room.message" || !!event.getAssociatedId()) { // put these events in the 'message' queue. return "message"; }