2015-10-21 19:50:40 +03:00
|
|
|
/*
|
2016-01-07 07:06:39 +03:00
|
|
|
Copyright 2015, 2016 OpenMarket Ltd
|
2015-10-21 19:50:40 +03: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 17:09:57 +03:00
|
|
|
import React from 'react';
|
|
|
|
import { _t } from '../../../languageHandler';
|
2015-10-21 19:50:40 +03:00
|
|
|
|
2015-11-27 18:02:32 +03:00
|
|
|
module.exports = React.createClass({
|
2015-11-30 18:19:43 +03:00
|
|
|
displayName: 'UnknownBody',
|
2015-10-21 19:50:40 +03:00
|
|
|
|
2015-11-27 18:02:32 +03:00
|
|
|
render: function() {
|
2017-09-14 18:02:16 +03:00
|
|
|
let tooltip = _t("Removed or unknown message type");
|
|
|
|
if (this.props.mxEvent.isRedacted()) {
|
2017-10-25 19:24:45 +03:00
|
|
|
tooltip = _t("Message removed by %(userId)s", {
|
|
|
|
userId: this.props.mxEvent.getUnsigned().redacted_because.sender,
|
|
|
|
});
|
2017-09-14 18:02:16 +03:00
|
|
|
}
|
|
|
|
|
2017-03-06 13:26:26 +03:00
|
|
|
const text = this.props.mxEvent.getContent().body;
|
2015-11-27 18:02:32 +03:00
|
|
|
return (
|
2017-09-14 18:02:16 +03:00
|
|
|
<span className="mx_UnknownBody" title={tooltip}>
|
2017-09-28 13:21:06 +03:00
|
|
|
{ text }
|
2015-11-27 18:02:32 +03:00
|
|
|
</span>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|