mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-24 12:04:57 +01:00
very basic way of sending a reaction
This commit is contained in:
parent
b722691e85
commit
20abb01ee8
@ -122,6 +122,10 @@ export class BaseMessageTile extends SimpleTile {
|
||||
return this._reactions;
|
||||
}
|
||||
|
||||
react(key) {
|
||||
this._room.sendEvent("m.reaction", this._entry.annotate(key));
|
||||
}
|
||||
|
||||
_updateReactions() {
|
||||
const {annotations} = this._entry;
|
||||
if (!annotations) {
|
||||
|
@ -16,6 +16,7 @@ limitations under the License.
|
||||
|
||||
import {BaseEntry} from "./BaseEntry.js";
|
||||
import {REDACTION_TYPE} from "../../common.js";
|
||||
import {createAnnotation} from "../relations.js";
|
||||
|
||||
export class BaseEventEntry extends BaseEntry {
|
||||
constructor(fragmentIdComparer) {
|
||||
@ -80,4 +81,8 @@ export class BaseEventEntry extends BaseEntry {
|
||||
// so don't clear _pendingRedactions here
|
||||
}
|
||||
}
|
||||
|
||||
annotate(key) {
|
||||
return createAnnotation(this.id, key);
|
||||
}
|
||||
}
|
@ -99,6 +99,7 @@ export class BaseMessageView extends TemplateView {
|
||||
} else if (vm.canRedact) {
|
||||
options.push(Menu.option(vm.i18n`Delete`, () => vm.redact()).setDestructive());
|
||||
}
|
||||
options.push(Menu.option(vm.i18n`React with 👍`, () => vm.react("👍")))
|
||||
return options;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user