does not crash on deleted messages
This commit is contained in:
@@ -91,6 +91,7 @@
|
|||||||
"numeric_confirmation_code_prompt": "Numbers only",
|
"numeric_confirmation_code_prompt": "Numbers only",
|
||||||
"button_confirm": "Confirm",
|
"button_confirm": "Confirm",
|
||||||
"save_attachment": "save",
|
"save_attachment": "save",
|
||||||
|
"deleted_content": "content deleted",
|
||||||
"invalid_content": "invalid content",
|
"invalid_content": "invalid content",
|
||||||
"user_not_found": "Not found",
|
"user_not_found": "Not found",
|
||||||
"badge_you": "you",
|
"badge_you": "you",
|
||||||
|
|||||||
+2
-1
@@ -149,5 +149,6 @@
|
|||||||
"clear_messages_warning": "Вы действительно хотите удалить все сообщения в чате? Их будет невозможно восстановить.",
|
"clear_messages_warning": "Вы действительно хотите удалить все сообщения в чате? Их будет невозможно восстановить.",
|
||||||
"topic_delete_warning": "Вы действительно хотите удалить этот чат?",
|
"topic_delete_warning": "Вы действительно хотите удалить этот чат?",
|
||||||
"topic_block_warning": "Вы действительно хотите заблокировать этот чат?",
|
"topic_block_warning": "Вы действительно хотите заблокировать этот чат?",
|
||||||
"search_no_results": "Ничего не найдено"
|
"search_no_results": "Ничего не найдено",
|
||||||
|
"deleted_content": "удалено"
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -149,5 +149,6 @@
|
|||||||
"clear_messages_warning": ":!![MISSING]!!:Are you sure you want to clear all messages? It cannot be undone.",
|
"clear_messages_warning": ":!![MISSING]!!:Are you sure you want to clear all messages? It cannot be undone.",
|
||||||
"topic_delete_warning": ":!![MISSING]!!:Are you sure you want to delete this conversation?",
|
"topic_delete_warning": ":!![MISSING]!!:Are you sure you want to delete this conversation?",
|
||||||
"topic_block_warning": ":!![MISSING]!!:Are you sure you want to block this conversation?",
|
"topic_block_warning": ":!![MISSING]!!:Are you sure you want to block this conversation?",
|
||||||
"search_no_results": ":!![MISSING]!!:Search returned no results"
|
"search_no_results": ":!![MISSING]!!:Search returned no results",
|
||||||
|
"deleted_content": "内容已删除"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,7 @@
|
|||||||
"numeric_confirmation_code_prompt": "Numbers only",
|
"numeric_confirmation_code_prompt": "Numbers only",
|
||||||
"button_confirm": "Confirm",
|
"button_confirm": "Confirm",
|
||||||
"save_attachment": "save",
|
"save_attachment": "save",
|
||||||
|
"deleted_content": "content deleted",
|
||||||
"invalid_content": "invalid content",
|
"invalid_content": "invalid content",
|
||||||
"user_not_found": "Not found",
|
"user_not_found": "Not found",
|
||||||
"badge_you": "you",
|
"badge_you": "you",
|
||||||
|
|||||||
@@ -541,7 +541,7 @@ class MessagesView extends React.Component {
|
|||||||
messageNodes.push(
|
messageNodes.push(
|
||||||
<ChatMessage
|
<ChatMessage
|
||||||
tinode={this.props.tinode}
|
tinode={this.props.tinode}
|
||||||
content={msg.content}
|
content={msg.content} delRange={msg.delRange}
|
||||||
mimeType={msg.head ? msg.head.mime : null}
|
mimeType={msg.head ? msg.head.mime : null}
|
||||||
timestamp={msg.ts} response={isReply} seq={msg.seq}
|
timestamp={msg.ts} response={isReply} seq={msg.seq}
|
||||||
userFrom={userFrom} userName={userName} userAvatar={userAvatar}
|
userFrom={userFrom} userName={userName} userAvatar={userAvatar}
|
||||||
|
|||||||
@@ -97,8 +97,14 @@ export default class ChatMessage extends React.Component {
|
|||||||
key={i} />);
|
key={i} />);
|
||||||
}, this);
|
}, this);
|
||||||
content = React.createElement('span', null, Drafty.format(content, draftyFormatter, this));
|
content = React.createElement('span', null, Drafty.format(content, draftyFormatter, this));
|
||||||
|
} else if (this.props.delRange) {
|
||||||
|
// Message represents a range of deleted messages.
|
||||||
|
content = <><i className="material-icons">block</i> <i className="gray">
|
||||||
|
<FormattedMessage id="deleted_content"
|
||||||
|
defaultMessage="content deleted" description="Shown when messages are deleted" />
|
||||||
|
</i></>
|
||||||
} else if (typeof content != 'string') {
|
} else if (typeof content != 'string') {
|
||||||
content = <><i className="material-icons">error_outline</i> <i>
|
content = <><i className="material-icons">error_outline</i> <i className="gray">
|
||||||
<FormattedMessage id="invalid_content"
|
<FormattedMessage id="invalid_content"
|
||||||
defaultMessage="invalid content" description="Shown when message is unreadable" />
|
defaultMessage="invalid content" description="Shown when message is unreadable" />
|
||||||
</i></>
|
</i></>
|
||||||
@@ -121,9 +127,11 @@ export default class ChatMessage extends React.Component {
|
|||||||
<div className="message-content">
|
<div className="message-content">
|
||||||
{content}
|
{content}
|
||||||
{attachments}
|
{attachments}
|
||||||
<ReceivedMarker
|
{this.props.timestamp ?
|
||||||
timestamp={this.props.timestamp}
|
<ReceivedMarker
|
||||||
received={this.props.received} />
|
timestamp={this.props.timestamp}
|
||||||
|
received={this.props.received} />
|
||||||
|
: null}
|
||||||
</div>
|
</div>
|
||||||
<span className="menuTrigger">
|
<span className="menuTrigger">
|
||||||
<a href="#" onClick={this.handleContextClick}>
|
<a href="#" onClick={this.handleContextClick}>
|
||||||
|
|||||||
+11
-3
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+31
-12
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user