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