2015-10-21 18:50:40 +02:00
|
|
|
/*
|
2016-01-07 05:06:39 +01:00
|
|
|
Copyright 2015, 2016 OpenMarket Ltd
|
2015-10-21 18:50:40 +02:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2017-05-30 16:09:57 +02:00
|
|
|
import React from 'react';
|
|
|
|
import { _t } from '../../../languageHandler';
|
2015-10-21 18:50:40 +02:00
|
|
|
|
2015-11-27 16:02:32 +01:00
|
|
|
module.exports = React.createClass({
|
2015-11-30 16:19:43 +01:00
|
|
|
displayName: 'UnknownBody',
|
2015-10-21 18:50:40 +02:00
|
|
|
|
2015-11-27 16:02:32 +01:00
|
|
|
render: function() {
|
2017-09-14 17:02:16 +02:00
|
|
|
let tooltip = _t("Removed or unknown message type");
|
|
|
|
if (this.props.mxEvent.isRedacted()) {
|
|
|
|
tooltip = _t("Message removed by %(userId)s", {userId: this.props.mxEvent.getSender()});
|
|
|
|
}
|
|
|
|
|
2017-03-06 11:26:26 +01:00
|
|
|
const text = this.props.mxEvent.getContent().body;
|
2015-11-27 16:02:32 +01:00
|
|
|
return (
|
2017-09-14 17:02:16 +02:00
|
|
|
<span className="mx_UnknownBody" title={tooltip}>
|
2017-09-28 12:21:06 +02:00
|
|
|
{ text }
|
2015-11-27 16:02:32 +01:00
|
|
|
</span>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|