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