feat: complete Ancestor quote bot with production-ready Docker support

This commit is contained in:
unfunny
2026-09-13 14:14:38 -04:00
parent f2016da05a
commit fe7351a7dc
1145 changed files with 30890 additions and 97684 deletions

View File

@@ -1,4 +1,15 @@
import _defineProperty from "@babel/runtime/helpers/defineProperty";
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupCallStats = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _callStatsReportGatherer = require("./callStatsReportGatherer");
var _statsReportEmitter = require("./statsReportEmitter");
var _summaryStatsReportGatherer = require("./summaryStatsReportGatherer");
var _logger = require("../../logger");
/*
Copyright 2023 The Matrix.org Foundation C.I.C.
@@ -14,19 +25,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { CallStatsReportGatherer } from "./callStatsReportGatherer.js";
import { StatsReportEmitter } from "./statsReportEmitter.js";
import { SummaryStatsReportGatherer } from "./summaryStatsReportGatherer.js";
import { logger } from "../../logger.js";
export class GroupCallStats {
class GroupCallStats {
constructor(groupCallId, userId, interval = 10000) {
_defineProperty(this, "timer", void 0);
_defineProperty(this, "gatherers", new Map());
_defineProperty(this, "reports", new StatsReportEmitter());
_defineProperty(this, "summaryStatsReportGatherer", new SummaryStatsReportGatherer(this.reports));
this.groupCallId = groupCallId;
this.userId = userId;
this.interval = interval;
(0, _defineProperty2.default)(this, "timer", void 0);
(0, _defineProperty2.default)(this, "gatherers", new Map());
(0, _defineProperty2.default)(this, "reports", new _statsReportEmitter.StatsReportEmitter());
(0, _defineProperty2.default)(this, "summaryStatsReportGatherer", new _summaryStatsReportGatherer.SummaryStatsReportGatherer(this.reports));
}
start() {
if (this.timer === undefined && this.interval > 0) {
@@ -48,7 +56,7 @@ export class GroupCallStats {
if (this.hasStatsReportGatherer(callId)) {
return false;
}
this.gatherers.set(callId, new CallStatsReportGatherer(callId, opponentMemberId, peerConnection, this.reports));
this.gatherers.set(callId, new _callStatsReportGatherer.CallStatsReportGatherer(callId, opponentMemberId, peerConnection, this.reports));
return true;
}
removeStatsReportGatherer(callId) {
@@ -58,7 +66,8 @@ export class GroupCallStats {
return this.hasStatsReportGatherer(callId) ? this.gatherers.get(callId) : undefined;
}
updateOpponentMember(callId, opponentMember) {
this.getStatsReportGatherer(callId)?.setOpponentMemberId(opponentMember);
var _this$getStatsReportG;
(_this$getStatsReportG = this.getStatsReportGatherer(callId)) === null || _this$getStatsReportG === void 0 ? void 0 : _this$getStatsReportG.setOpponentMemberId(opponentMember);
}
processStats() {
const summary = [];
@@ -66,11 +75,12 @@ export class GroupCallStats {
summary.push(c.processStats(this.groupCallId, this.userId));
});
Promise.all(summary).then(s => this.summaryStatsReportGatherer.build(s)).catch(err => {
logger.error("Could not build summary stats report", err);
_logger.logger.error("Could not build summary stats report", err);
});
}
setInterval(interval) {
this.interval = interval;
}
}
exports.GroupCallStats = GroupCallStats;
//# sourceMappingURL=groupCallStats.js.map