Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1234 from matrix-org/luke/feature-mention-pill
Browse files Browse the repository at this point in the history
Add mx_UserPill_me class to user pills that match credentials.userId
  • Loading branch information
lukebarnard1 authored Jul 19, 2017
2 parents 61d5d07 + 5d1b33d commit ecaf6e5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/views/messages/TextualBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { _t } from '../../../languageHandler';
import UserSettingsStore from "../../../UserSettingsStore";
import MatrixClientPeg from '../../../MatrixClientPeg';
import {RoomMember} from 'matrix-js-sdk';
import classNames from 'classnames';

linkifyMatrix(linkify);

Expand Down Expand Up @@ -205,8 +206,15 @@ module.exports = React.createClass({
}
if (avatar) {
const avatarContainer = document.createElement('span');
node.className = "mx_MTextBody_pill " +
(resourceType === "user" ? "mx_UserPill" : "mx_RoomPill");
node.className = classNames(
"mx_MTextBody_pill",
{
"mx_UserPill": match[1] === "user",
"mx_RoomPill": match[1] === "room",
"mx_UserPill_me":
userId === MatrixClientPeg.get().credentials.userId,
},
);
ReactDOM.render(avatar, avatarContainer);
node.insertBefore(avatarContainer, node.firstChild);
}
Expand Down

0 comments on commit ecaf6e5

Please sign in to comment.