Skip to content

Commit 3588dba

Browse files
committed
added tooltips
1 parent 569a0ae commit 3588dba

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/components/views/messages/TextualBody.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,12 @@ export default class TextualBody extends React.Component<IBodyProps, IState> {
568568
let body: ReactNode;
569569
const client = MatrixClientPeg.get();
570570
const room = client.getRoom(mxEvent.getRoomId());
571-
let emotesEvent=room.currentState.getStateEvents("m.room.emotes", "");
572-
let rawEmotes = emotesEvent ? (emotesEvent.getContent() || {}) : {};
573-
let finalEmotes = {};
574-
for (let key in rawEmotes) {
575-
finalEmotes[":"+key+":"] = "<img class='mx_Emote' src="+mediaFromMxc(rawEmotes[key]).srcHttp+"/>";
576-
}
571+
let emotesEvent = room.currentState.getStateEvents("m.room.emotes", "");
572+
let rawEmotes = emotesEvent ? (emotesEvent.getContent() || {}) : {};
573+
let finalEmotes = {};
574+
for (let key in rawEmotes) {
575+
finalEmotes[":" + key + ":"] = "<img class='mx_Emote' title=':"+key+ ":'src=" + mediaFromMxc(rawEmotes[key]).srcHttp + "/>";
576+
}
577577
if (SettingsStore.isEnabled("feature_extensible_events")) {
578578
const extev = this.props.mxEvent.unstableExtensibleEvent as MessageEvent;
579579
if (extev?.isEquivalentTo(M_MESSAGE)) {
@@ -598,14 +598,14 @@ export default class TextualBody extends React.Component<IBodyProps, IState> {
598598
if (!body) {
599599
isEmote = content.msgtype === MsgType.Emote;
600600
isNotice = content.msgtype === MsgType.Notice;
601-
body = (HtmlUtils.bodyToHtml(content, this.props.highlights, {
601+
body = HtmlUtils.bodyToHtml(content, this.props.highlights, {
602602
disableBigEmoji: isEmote
603603
|| !SettingsStore.getValue<boolean>('TextualBody.enableBigEmoji'),
604604
// Part of Replies fallback support
605605
stripReplyFallback: stripReply,
606606
ref: this.contentRef,
607607
returnString: false,
608-
})as any).replace(/:[\w+-]+:/, m => finalEmotes[m] ? finalEmotes[m] : m);
608+
});
609609

610610
}
611611
//console.log(body);

0 commit comments

Comments
 (0)