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,12 @@
import _defineProperty from "@babel/runtime/helpers/defineProperty";
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.EventContext = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _eventTimeline = require("./event-timeline");
/*
Copyright 2015 - 2021 The Matrix.org Foundation C.I.C.
@@ -15,8 +23,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { Direction } from "./event-timeline.js";
export class EventContext {
class EventContext {
/**
* Construct a new EventContext
*
@@ -30,13 +37,13 @@ export class EventContext {
* @param ourEvent - the event at the centre of this context
*/
constructor(ourEvent) {
_defineProperty(this, "timeline", void 0);
_defineProperty(this, "ourEventIndex", 0);
_defineProperty(this, "paginateTokens", {
[Direction.Backward]: null,
[Direction.Forward]: null
});
this.ourEvent = ourEvent;
(0, _defineProperty2.default)(this, "timeline", void 0);
(0, _defineProperty2.default)(this, "ourEventIndex", 0);
(0, _defineProperty2.default)(this, "paginateTokens", {
[_eventTimeline.Direction.Backward]: null,
[_eventTimeline.Direction.Forward]: null
});
this.timeline = [ourEvent];
}
@@ -73,7 +80,7 @@ export class EventContext {
* @param backwards - true to get the pagination token for going
*/
getPaginateToken(backwards = false) {
return this.paginateTokens[backwards ? Direction.Backward : Direction.Forward];
return this.paginateTokens[backwards ? _eventTimeline.Direction.Backward : _eventTimeline.Direction.Forward];
}
/**
@@ -86,7 +93,7 @@ export class EventContext {
* backwards in time
*/
setPaginateToken(token, backwards = false) {
this.paginateTokens[backwards ? Direction.Backward : Direction.Forward] = token ?? null;
this.paginateTokens[backwards ? _eventTimeline.Direction.Backward : _eventTimeline.Direction.Forward] = token !== null && token !== void 0 ? token : null;
}
/**
@@ -107,4 +114,5 @@ export class EventContext {
}
}
}
exports.EventContext = EventContext;
//# sourceMappingURL=event-context.js.map