about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen <eugen@zeonfederated.com>2017-01-08 00:19:24 +0100
committerGitHub <noreply@github.com>2017-01-08 00:19:24 +0100
commit679aa35e152d690ab8460d8c819c9496b2061ed8 (patch)
tree16b6142fe77a5ccd9bd89e10eee32b2dba06e22c /app
parent165df323ae8c2fbe128939896e4cab174b020779 (diff)
parent57ff221c0fb2424a7ce5eea043e54bb31725ef7c (diff)
Merge pull request #429 from blackle/emojify_usernames
Emojify display names in notifcations
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/components/features/notifications/components/notification.jsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/features/notifications/components/notification.jsx b/app/assets/javascripts/components/features/notifications/components/notification.jsx
index 37715dd05..140ba9134 100644
--- a/app/assets/javascripts/components/features/notifications/components/notification.jsx
+++ b/app/assets/javascripts/components/features/notifications/components/notification.jsx
@@ -4,6 +4,8 @@ import StatusContainer from '../../../containers/status_container';
 import AccountContainer from '../../../containers/account_container';
 import { FormattedMessage } from 'react-intl';
 import Permalink from '../../../components/permalink';
+import emojify from '../../../emoji';
+import escapeTextContentForBrowser from 'react/lib/escapeTextContentForBrowser';
 
 const messageStyle = {
   marginLeft: '68px',
@@ -83,7 +85,8 @@ const Notification = React.createClass({
     const { notification } = this.props;
     const account          = notification.get('account');
     const displayName      = account.get('display_name').length > 0 ? account.get('display_name') : account.get('username');
-    const link             = <Permalink className='notification__display-name' style={linkStyle} href={account.get('url')} to={`/accounts/${account.get('id')}`}>{displayName}</Permalink>;
+    const displayNameHTML = { __html: emojify(escapeTextContentForBrowser(displayName)) };
+    const link             = <Permalink className='notification__display-name' style={linkStyle} href={account.get('url')} to={`/accounts/${account.get('id')}`} dangerouslySetInnerHTML={displayNameHTML} />;
 
     switch(notification.get('type')) {
       case 'follow':