mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
commit
a16b0674ad
@ -146,7 +146,12 @@ export class RoomViewModel extends ViewModel {
|
||||
async _sendMessage(message) {
|
||||
if (message) {
|
||||
try {
|
||||
await this._room.sendEvent("m.room.message", {msgtype: "m.text", body: message});
|
||||
let msgtype = "m.text";
|
||||
if (message.startsWith("/me")) {
|
||||
message = message.substr(3).trim();
|
||||
msgtype = "m.emote";
|
||||
}
|
||||
await this._room.sendEvent("m.room.message", {msgtype, body: message});
|
||||
} catch (err) {
|
||||
console.error(`room.sendMessage(): ${err.message}:\n${err.stack}`);
|
||||
this._sendError = err;
|
||||
|
@ -21,7 +21,7 @@ export class TextTile extends MessageTile {
|
||||
const content = this._getContent();
|
||||
const body = content && content.body;
|
||||
if (content.msgtype === "m.emote") {
|
||||
return `* ${this._entry.sender} ${body}`;
|
||||
return `* ${this.displayName} ${body}`;
|
||||
} else {
|
||||
return body;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user