This commit is contained in:
Bruno Windels 2021-06-11 11:30:11 +02:00
parent 6bdbbee83e
commit 75ee509361
6 changed files with 6 additions and 12 deletions

View file

@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import {ViewModel} from "../../../ViewModel.js";
import {ObservableMap} from "../../../../observable/map/ObservableMap.js"; import {ObservableMap} from "../../../../observable/map/ObservableMap.js";
export class ReactionsViewModel { export class ReactionsViewModel {

View file

@ -28,7 +28,6 @@ import {EventEntry} from "./timeline/entries/EventEntry.js";
import {ObservedEventMap} from "./ObservedEventMap.js"; import {ObservedEventMap} from "./ObservedEventMap.js";
import {DecryptionSource} from "../e2ee/common.js"; import {DecryptionSource} from "../e2ee/common.js";
import {ensureLogItem} from "../../logging/utils.js"; import {ensureLogItem} from "../../logging/utils.js";
import {ANNOTATION_RELATION_TYPE, getRelation} from "./timeline/relations.js";
const EVENT_ENCRYPTED_TYPE = "m.room.encrypted"; const EVENT_ENCRYPTED_TYPE = "m.room.encrypted";

View file

@ -22,7 +22,7 @@ import {TimelineReader} from "./persistence/TimelineReader.js";
import {PendingEventEntry} from "./entries/PendingEventEntry.js"; import {PendingEventEntry} from "./entries/PendingEventEntry.js";
import {RoomMember} from "../members/RoomMember.js"; import {RoomMember} from "../members/RoomMember.js";
import {PowerLevels} from "./PowerLevels.js"; import {PowerLevels} from "./PowerLevels.js";
import {getRelationFromContent, getRelation, ANNOTATION_RELATION_TYPE} from "./relations.js"; import {getRelation, ANNOTATION_RELATION_TYPE} from "./relations.js";
import {REDACTION_TYPE} from "../common.js"; import {REDACTION_TYPE} from "../common.js";
export class Timeline { export class Timeline {
@ -158,7 +158,7 @@ export class Timeline {
// also look for a relation target to update with this redaction // also look for a relation target to update with this redaction
if (pee.redactingRelation) { if (pee.redactingRelation) {
const eventId = pee.redactingRelation.event_id; const eventId = pee.redactingRelation.event_id;
const found = this._remoteEntries.findAndUpdate( this._remoteEntries.findAndUpdate(
e => e.id === eventId, e => e.id === eventId,
updateOrFalse updateOrFalse
); );

View file

@ -16,7 +16,7 @@ limitations under the License.
import {BaseEntry} from "./BaseEntry.js"; import {BaseEntry} from "./BaseEntry.js";
import {REDACTION_TYPE} from "../../common.js"; import {REDACTION_TYPE} from "../../common.js";
import {createAnnotation, getRelationFromContent, ANNOTATION_RELATION_TYPE} from "../relations.js"; import {createAnnotation, ANNOTATION_RELATION_TYPE} from "../relations.js";
import {PendingAnnotations} from "../PendingAnnotations.js"; import {PendingAnnotations} from "../PendingAnnotations.js";
export class BaseEventEntry extends BaseEntry { export class BaseEventEntry extends BaseEntry {

View file

@ -92,6 +92,7 @@ export class PendingEventEntry extends BaseEventEntry {
if (this._redactionTarget) { if (this._redactionTarget) {
return getRelationFromContent(this._redactionTarget.content); return getRelationFromContent(this._redactionTarget.content);
} }
return null;
} }
/** /**
* returns either the relationship on this entry, * returns either the relationship on this entry,
@ -105,9 +106,4 @@ export class PendingEventEntry extends BaseEventEntry {
return getRelationFromContent(this._pendingEvent.content); return getRelationFromContent(this._pendingEvent.content);
} }
} }
getOwnAnnotationId(_, key) {
// TODO: implement this once local reactions are implemented
return null;
}
} }

View file

@ -23,7 +23,7 @@ export class ReactionsView extends ListView {
className: "Timeline_messageReactions", className: "Timeline_messageReactions",
tagName: "div", tagName: "div",
list: reactionsViewModel.reactions, list: reactionsViewModel.reactions,
onItemClick: (reactionView, evt) => reactionView.onClick(), onItemClick: reactionView => reactionView.onClick(),
} }
super(options, reactionVM => new ReactionView(reactionVM)); super(options, reactionVM => new ReactionView(reactionVM));
} }
@ -40,4 +40,4 @@ class ReactionView extends TemplateView {
onClick() { onClick() {
this.value.toggleReaction(); this.value.toggleReaction();
} }
} }