You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Merge branch 'develop' into matthew/rework-cross-signing-login
This commit is contained in:
@@ -393,6 +393,9 @@ export function MatrixClient(opts) {
|
||||
this._clientWellKnown = undefined;
|
||||
this._clientWellKnownPromise = undefined;
|
||||
|
||||
this._turnServers = [];
|
||||
this._turnServersExpiry = null;
|
||||
|
||||
// The SDK doesn't really provide a clean way for events to recalculate the push
|
||||
// actions for themselves, so we have to kinda help them out when they are encrypted.
|
||||
// We do this so that push rules are correctly executed on events in their decrypted
|
||||
@@ -4963,6 +4966,15 @@ MatrixClient.prototype.getTurnServers = function() {
|
||||
return this._turnServers || [];
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the unix timestamp (in seconds) at which the current
|
||||
* TURN credentials (from getTurnServers) expire
|
||||
* @return {number} The expiry timestamp, in seconds, or null if no credentials
|
||||
*/
|
||||
MatrixClient.prototype.getTurnServersExpiry = function() {
|
||||
return this._turnServersExpiry;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set whether to allow a fallback ICE server should be used for negotiating a
|
||||
* WebRTC connection if the homeserver doesn't provide any servers. Defaults to
|
||||
@@ -5434,6 +5446,9 @@ async function(roomId, eventId, relationType, eventType, opts = {}) {
|
||||
}));
|
||||
events = events.filter(e => e.getType() === eventType);
|
||||
}
|
||||
if (originalEvent && relationType === "m.replace") {
|
||||
events = events.filter(e => e.getSender() === originalEvent.getSender());
|
||||
}
|
||||
return {
|
||||
originalEvent,
|
||||
events,
|
||||
@@ -5458,6 +5473,7 @@ function checkTurnServers(client) {
|
||||
credential: res.password,
|
||||
};
|
||||
client._turnServers = [servers];
|
||||
client._turnServersExpiry = Date.now() + res.ttl;
|
||||
// re-fetch when we're about to reach the TTL
|
||||
client._checkTurnServersTimeoutID = setTimeout(() => {
|
||||
checkTurnServers(client);
|
||||
|
||||
Reference in New Issue
Block a user