Merge branch 'next' into next-reply

This commit is contained in:
aforge
2021-08-14 16:31:09 +03:00
26 changed files with 316 additions and 65 deletions
+4 -4
View File
@@ -501,7 +501,7 @@ div.trusted-badge {
position: relative;
display: flex;
height: 100%;
max-width: 80rem;
max-width: 84rem;
overflow: hidden;
margin-left: auto;
margin-right: auto;
@@ -653,8 +653,8 @@ table.permission-editor td.checkbox {
}
.permission-editor .material-icons {
font-size: 1.1rem;
line-height: 1.1rem;
font-size: 1.3rem;
line-height: 1.3rem;
}
.material-icons.clickable {
@@ -1531,7 +1531,7 @@ img.channel {
.chat-box .bubble {
position: relative;
display: flex;
max-width: 40rem;
max-width: 36rem;
min-width: 9rem;
height: auto;
padding: 0.75rem 0.5rem 0.75rem 0.5rem;
+1 -1
View File
File diff suppressed because one or more lines are too long
+5 -5
View File
@@ -22,11 +22,11 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,500,700,700i" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<link rel="stylesheet" href="css/base.min.css" />
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/react@17.0.1/umd/react.production.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/react-dom@17.0.1/umd/react-dom.production.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/react-intl@5.18.3/react-intl.iife.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/firebase@8.7.1/firebase-app.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/firebase@8.7.1/firebase-messaging.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/react@17.0.2/umd/react.production.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/react-dom@17.0.2/umd/react-dom.production.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/react-intl@5.20.7/react-intl.iife.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/firebase@8.9.1/firebase-app.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/firebase@8.9.1/firebase-messaging.js"></script>
</head>
<body>
<noscript><div id="noscript-message"><div id="noscript-title">Javascript support is required.</div>
+5 -4
View File
@@ -54,7 +54,8 @@
"ko",
"ro",
"ru",
"zh"
"zh",
"zh-TW"
],
"main": "umd/index.prod.js",
"bugs": {
@@ -65,9 +66,9 @@
"author": "Tinode Authors <info@tinode.co>",
"license": "Apache-2.0",
"dependencies": {
"firebase": "^8.7.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"firebase": "^8.9.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-intl": "^5.20.2",
"tinode-sdk": "^0.18.0-alpha1"
},
+2 -2
View File
@@ -1,6 +1,6 @@
// Must be located at the root.
importScripts('https://cdn.jsdelivr.net/npm/firebase@8.7.1/firebase-app.js');
importScripts('https://cdn.jsdelivr.net/npm/firebase@8.7.1/firebase-messaging.js');
importScripts('https://cdn.jsdelivr.net/npm/firebase@8.9.1/firebase-app.js');
importScripts('https://cdn.jsdelivr.net/npm/firebase@8.9.1/firebase-messaging.js');
importScripts('firebase-init.js');
importScripts('version.js');
+15 -1
View File
@@ -1224,7 +1224,7 @@
},
"topic_delete_warning": {
"translation": "Möchten Sie diese Unterhaltung wirklich löschen?",
"defaultMessage": "Are you sure you want to delete this conversation?",
"defaultMessage": "Are you sure you want to delete this conversation? It cannot be undone.",
"description": "Alert warning when deleting entire topic",
"missing": false,
"obsolete": false
@@ -1333,5 +1333,19 @@
"description": "Title for editing default authenticated permissions",
"missing": true,
"obsolete": false
},
"topic_delete": {
"translation": "Chat löschen",
"defaultMessage": "Delete Conversation",
"description": "Alert title when deleting the topic.",
"missing": false,
"obsolete": false
},
"permissions_user": {
"translation": "",
"defaultMessage": "User's Permissions",
"description": "Title for editing user's permissions",
"missing": true,
"obsolete": false
}
}
+15 -1
View File
@@ -1231,7 +1231,7 @@
},
"topic_delete_warning": {
"translation": "Are you sure you want to delete this conversation?",
"defaultMessage": "Are you sure you want to delete this conversation?",
"defaultMessage": "Are you sure you want to delete this conversation? It cannot be undone.",
"description": "Alert warning when deleting entire topic",
"missing": false,
"obsolete": false
@@ -1361,5 +1361,19 @@
"description": "Title for editing default authenticated permissions",
"missing": false,
"obsolete": false
},
"topic_delete": {
"translation": "Delete Conversation",
"defaultMessage": "Delete Conversation",
"description": "Alert title when deleting the topic.",
"missing": false,
"obsolete": false
},
"permissions_user": {
"translation": "User's Permissions",
"defaultMessage": "User's Permissions",
"description": "Title for editing user's permissions",
"missing": false,
"obsolete": false
}
}
+15 -1
View File
@@ -1224,7 +1224,7 @@
},
"topic_delete_warning": {
"translation": "¿Estás seguro de que quieres eliminar esta conversación?",
"defaultMessage": "Are you sure you want to delete this conversation?",
"defaultMessage": "Are you sure you want to delete this conversation? It cannot be undone.",
"description": "Alert warning when deleting entire topic",
"missing": false,
"obsolete": false
@@ -1354,5 +1354,19 @@
"description": "Title for editing default authenticated permissions",
"missing": true,
"obsolete": false
},
"topic_delete": {
"translation": "Eliminar chat",
"defaultMessage": "Delete Conversation",
"description": "Alert title when deleting the topic.",
"missing": false,
"obsolete": false
},
"permissions_user": {
"translation": "",
"defaultMessage": "User's Permissions",
"description": "Title for editing user's permissions",
"missing": true,
"obsolete": false
}
}
+9 -1
View File
@@ -569,6 +569,10 @@
"defaultMessage": "Authenticated",
"description": "Title for editing default authenticated permissions"
},
"permissions_user": {
"defaultMessage": "User's Permissions",
"description": "Title for editing user's permissions"
},
"phone_dative": {
"defaultMessage": "phone",
"description": "Dative case of 'phone', i.e. 'phone' in 'by phone'"
@@ -713,8 +717,12 @@
"defaultMessage": "Are you sure you want to block this conversation?",
"description": "Alert warning when blocking a topic."
},
"topic_delete": {
"defaultMessage": "Delete Conversation",
"description": "Alert title when deleting the topic."
},
"topic_delete_warning": {
"defaultMessage": "Are you sure you want to delete this conversation?",
"defaultMessage": "Are you sure you want to delete this conversation? It cannot be undone.",
"description": "Alert warning when deleting entire topic"
},
"topic_name_editing_placeholder": {
+15 -1
View File
@@ -1224,7 +1224,7 @@
},
"topic_delete_warning": {
"translation": "이대화를삭제하시겠습니까?",
"defaultMessage": "Are you sure you want to delete this conversation?",
"defaultMessage": "Are you sure you want to delete this conversation? It cannot be undone.",
"description": "Alert warning when deleting entire topic",
"missing": false,
"obsolete": false
@@ -1364,5 +1364,19 @@
"description": "Title for editing default authenticated permissions",
"missing": true,
"obsolete": false
},
"topic_delete": {
"translation": "채팅 삭제",
"defaultMessage": "Delete Conversation",
"description": "Alert title when deleting the topic.",
"missing": false,
"obsolete": false
},
"permissions_user": {
"translation": "",
"defaultMessage": "User's Permissions",
"description": "Title for editing user's permissions",
"missing": true,
"obsolete": false
}
}
+15 -1
View File
@@ -1224,7 +1224,7 @@
},
"topic_delete_warning": {
"translation": "Ești sigur că dorești să șterge această conversație?",
"defaultMessage": "Are you sure you want to delete this conversation?",
"defaultMessage": "Are you sure you want to delete this conversation? It cannot be undone.",
"description": "Alert warning when deleting entire topic",
"missing": false,
"obsolete": false
@@ -1354,5 +1354,19 @@
"description": "Title for editing default authenticated permissions",
"missing": true,
"obsolete": false
},
"topic_delete": {
"translation": "Ștergeți Chat",
"defaultMessage": "Delete Conversation",
"description": "Alert title when deleting the topic.",
"missing": false,
"obsolete": false
},
"permissions_user": {
"translation": "",
"defaultMessage": "User's Permissions",
"description": "Title for editing user's permissions",
"missing": true,
"obsolete": false
}
}
+15 -1
View File
@@ -1224,7 +1224,7 @@
},
"topic_delete_warning": {
"translation": "Вы действительно хотите удалить этот чат?",
"defaultMessage": "Are you sure you want to delete this conversation?",
"defaultMessage": "Are you sure you want to delete this conversation? It cannot be undone.",
"description": "Alert warning when deleting entire topic",
"missing": false,
"obsolete": false
@@ -1354,5 +1354,19 @@
"description": "Title for editing default authenticated permissions",
"missing": true,
"obsolete": false
},
"topic_delete": {
"translation": "Удалить чат",
"defaultMessage": "Delete Conversation",
"description": "Alert title when deleting the topic.",
"missing": false,
"obsolete": false
},
"permissions_user": {
"translation": "",
"defaultMessage": "User's Permissions",
"description": "Title for editing user's permissions",
"missing": true,
"obsolete": false
}
}
+15 -1
View File
@@ -1218,7 +1218,7 @@
},
"topic_delete_warning": {
"translation": "您確定要刪除此對話嗎?",
"defaultMessage": "Are you sure you want to delete this conversation?",
"defaultMessage": "Are you sure you want to delete this conversation? It cannot be undone.",
"description": "Alert warning when deleting entire topic",
"missing": false,
"obsolete": false
@@ -1353,5 +1353,19 @@
"description": "Title for editing default authenticated permissions",
"missing": true,
"obsolete": false
},
"topic_delete": {
"translation": "刪除聊天",
"defaultMessage": "Delete Conversation",
"description": "Alert title when deleting the topic.",
"missing": false,
"obsolete": false
},
"permissions_user": {
"translation": "",
"defaultMessage": "User's Permissions",
"description": "Title for editing user's permissions",
"missing": true,
"obsolete": false
}
}
+15 -1
View File
@@ -1224,7 +1224,7 @@
},
"topic_delete_warning": {
"translation": "您确定要删除此对话吗?",
"defaultMessage": "Are you sure you want to delete this conversation?",
"defaultMessage": "Are you sure you want to delete this conversation? It cannot be undone.",
"description": "Alert warning when deleting entire topic",
"missing": false,
"obsolete": false
@@ -1354,5 +1354,19 @@
"description": "Title for editing default authenticated permissions",
"missing": true,
"obsolete": false
},
"topic_delete": {
"translation": "删除聊天",
"defaultMessage": "Delete Conversation",
"description": "Alert title when deleting the topic.",
"missing": false,
"obsolete": false
},
"permissions_user": {
"translation": "",
"defaultMessage": "User's Permissions",
"description": "Title for editing user's permissions",
"missing": true,
"obsolete": false
}
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+8 -1
View File
@@ -66,6 +66,11 @@ const messages = defineMessages({
defaultMessage: 'Anonymous',
description: 'Title for editing default anonymous permissions'
},
perm_user: {
id: 'permissions_user',
defaultMessage: 'User\'s Permissions',
description: 'Title for editing user\'s permissions'
},
edit_permissions: {
id: 'menu_item_edit_permissions',
defaultMessage: 'Edit permissions',
@@ -252,6 +257,7 @@ class InfoView extends React.Component {
}
handlePermissionsChanged(which, perm) {
console.log("handlePermissionsChanged", which, perm);
switch (which) {
case 'auth':
this.props.onTopicDescUpdate(this.props.topic, null, null, {auth: perm});
@@ -407,6 +413,7 @@ class InfoView extends React.Component {
render() {
const args = (this.props.panel || 'info').split('/');
console.log("args:", args);
const view = args[0];
args.shift();
@@ -449,7 +456,7 @@ class InfoView extends React.Component {
userTitle={this.state.userPermissionsTitle}
item={this.state.userPermissionsEdited}
userAvatar={this.state.userPermissionsAvatar}
onSubmit={this.handlePermissionsChanged.bind(...args)}
onSubmit={(mode) => this.handlePermissionsChanged(args[0], mode)}
onCancel={this.handleBackNavigate} />
:
view == 'general' ?
+24 -3
View File
@@ -124,6 +124,7 @@ class TinodeWeb extends React.Component {
this.handleTagsUpdated = this.handleTagsUpdated.bind(this);
this.handleLogout = this.handleLogout.bind(this);
this.handleDeleteAccount = this.handleDeleteAccount.bind(this);
this.handleDeleteTopicRequest = this.handleDeleteTopicRequest.bind(this);
this.handleDeleteMessagesRequest = this.handleDeleteMessagesRequest.bind(this);
this.handleLeaveUnsubRequest = this.handleLeaveUnsubRequest.bind(this);
this.handleBlockTopicRequest = this.handleBlockTopicRequest.bind(this);
@@ -1225,10 +1226,14 @@ class TinodeWeb extends React.Component {
const params = {};
let attachments;
if (pub) {
params.public = pub;
if (pub.photo && pub.photo.ref) {
attachments = [pub.photo.ref];
if (pub.photo) {
if (pub.photo.ref && pub.photo.ref != Tinode.DEL_CHAR) {
attachments = [pub.photo.ref];
} else if (!pub.photo.data || pub.photo.data == Tinode.DEL_CHAR) {
pub.photo = Tinode.DEL_CHAR;
}
}
params.public = pub;
}
if (priv) {
params.private = (priv === Tinode.DEL_CHAR) ?
@@ -1313,6 +1318,21 @@ class TinodeWeb extends React.Component {
});
}
handleDeleteTopicRequest(topicName) {
const topic = this.tinode.getTopic(topicName);
if (!topic) {
return;
}
// Request to hard-delete topic.
topic.delTopic(true).then((ctrl) => {
// Hide MessagesView and InfoView panels.
HashNavigation.navigateTo(HashNavigation.setUrlTopic(window.location.hash, ''));
}).catch((err) => {
this.handleError(err.message, 'err');
});
}
handleDeleteMessagesRequest(topicName) {
const topic = this.tinode.getTopic(topicName);
if (!topic) {
@@ -1678,6 +1698,7 @@ class TinodeWeb extends React.Component {
onShowAlert={this.handleShowAlert}
onChangePermissions={this.handleChangePermissions}
onMemberUpdateRequest={this.handleMemberUpdateRequest}
onDeleteTopic={this.handleDeleteTopicRequest}
onDeleteMessages={this.handleDeleteMessagesRequest}
onLeaveTopic={this.handleLeaveUnsubRequest}
onBlockTopic={this.handleBlockTopicRequest}
+1 -1
View File
@@ -57,7 +57,7 @@ const messages = defineMessages({
},
topic_delete_warning: {
id: 'topic_delete_warning',
defaultMessage: 'Are you sure you want to delete this conversation?',
defaultMessage: 'Are you sure you want to delete this conversation? It cannot be undone.',
description: 'Alert warning when deleting entire topic'
},
delete_messages_warning: {
+3 -3
View File
@@ -67,7 +67,7 @@ class PermissionsEditor extends React.Component {
handleChange(val) {
let mode = this.state.mode;
let idx = mode.indexOf(val);
const idx = mode.indexOf(val);
if (idx == -1) {
mode += val;
} else {
@@ -78,8 +78,8 @@ class PermissionsEditor extends React.Component {
handleSubmit() {
// Normalize string, otherwise cannot check if mode has changed.
var mode = (this.state.mode || 'N').split('').sort().join('');
var before = (this.props.mode || 'N').split('').sort().join('')
const mode = (this.state.mode || 'N').split('').sort().join('');
const before = (this.props.mode || 'N').split('').sort().join('')
if (mode !== before) {
this.props.onSubmit(mode);
} else {
+33 -3
View File
@@ -27,6 +27,16 @@ const messages = defineMessages({
defaultMessage: 'Are you sure you want to delete all messages for everyone? It cannot be undone.',
description: 'Alert dialog warning when hard-deleting all messages.'
},
topic_delete: {
id: 'topic_delete',
defaultMessage: 'Delete Conversation',
description: 'Alert title when deleting the topic.'
},
topic_delete_warning: {
id: 'topic_delete_warning',
defaultMessage: 'Are you sure you want to delete this conversation? It cannot be undone.',
description: 'Alert warning when deleting entire topic'
},
leave_chat: {
id: 'action_leave_chat',
defaultMessage: 'Leave Conversation',
@@ -106,12 +116,26 @@ class TopicSecurity extends React.Component {
anon: defacs ? defacs.anon : null,
};
this.handleDeleteTopic = this.handleDeleteTopic.bind(this);
this.handleDeleteMessages = this.handleDeleteMessages.bind(this);
this.handleLeave = this.handleLeave.bind(this);
this.handleBlock = this.handleBlock.bind(this);
this.handleReport = this.handleReport.bind(this);
}
handleDeleteTopic(e) {
e.preventDefault();
const {formatMessage} = this.props.intl;
this.props.onShowAlert(
formatMessage(messages.topic_delete), // title
formatMessage(messages.topic_delete_warning), // content
(() => { this.props.onDeleteTopic(this.props.topic); }), // onConfirm
null, // "OK"
true, // Show Reject button
null // "Cancel"
);
}
handleDeleteMessages(e) {
e.preventDefault();
const {formatMessage} = this.props.intl;
@@ -178,9 +202,15 @@ class TopicSecurity extends React.Component {
:
null
}
<a href="#" className="danger flat-button" onClick={this.handleLeave}>
<i className="material-icons">exit_to_app</i> &nbsp;{formatMessage(messages.leave_chat)}
</a>
{this.state.owner ?
<a href="#" className="danger flat-button" onClick={this.handleDeleteTopic}>
<i className="material-icons">delete</i> &nbsp;{formatMessage(messages.topic_delete)}
</a>
:
<a href="#" className="danger flat-button" onClick={this.handleLeave}>
<i className="material-icons">exit_to_app</i> &nbsp;{formatMessage(messages.leave_chat)}
</a>
}
{!this.state.groupTopic ?
<a href="#" className="danger flat-button" onClick={this.handleBlock}>
<i className="material-icons">block</i> &nbsp;{formatMessage(messages.block_contact)}
+82 -20
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+14 -4
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long