This commit is contained in:
or-else
2021-08-22 19:11:11 -07:00
25 changed files with 465 additions and 583 deletions
+13 -3
View File
@@ -120,6 +120,7 @@ class TinodeWeb extends React.Component {
this.handleStartTopicRequest = this.handleStartTopicRequest.bind(this);
this.handleNewTopicCreated = this.handleNewTopicCreated.bind(this);
this.handleTopicUpdateRequest = this.handleTopicUpdateRequest.bind(this);
this.handleUnarchive = this.handleUnarchive.bind(this);
this.handleChangePermissions = this.handleChangePermissions.bind(this);
this.handleTagsUpdateRequest = this.handleTagsUpdateRequest.bind(this);
this.handleLogout = this.handleLogout.bind(this);
@@ -1238,7 +1239,8 @@ class TinodeWeb extends React.Component {
}
params.public = pub;
}
if (priv) {
if (typeof priv == 'string') {
params.private = (priv === Tinode.DEL_CHAR) ?
Tinode.DEL_CHAR : {comment: priv};
}
@@ -1251,6 +1253,13 @@ class TinodeWeb extends React.Component {
}
}
handleUnarchive(topicName) {
const topic = this.tinode.getTopic(topicName);
if (topic) {
topic.archive(false);
}
}
handleUpdatePasswordRequest(password) {
this.handleError();
@@ -1433,7 +1442,7 @@ class TinodeWeb extends React.Component {
subscribed && deleter ? 'messages_clear_hard' : null,
muted ? (blocked ? null : 'topic_unmute') : 'topic_mute',
self_blocked ? 'topic_unblock' : 'topic_block',
!archived ? 'topic_restore' : 'topic_archive',
archived ? 'topic_restore' : 'topic_archive',
'topic_delete'
];
}
@@ -1521,7 +1530,7 @@ class TinodeWeb extends React.Component {
handlePasswordResetRequest(method, value) {
// If already connected, connnect() will return a resolved promise.
this.tinode.connect()
return this.tinode.connect()
.then(() => {
return this.tinode.requestResetAuthSecret('basic', method, value);
})
@@ -1708,6 +1717,7 @@ class TinodeWeb extends React.Component {
onReportTopic={this.handleReportTopic}
onAddMember={this.handleManageGroupMembers}
onTopicTagsUpdateRequest={this.handleTagsUpdateRequest}
onTopicUnArchive={this.handleUnarchive}
onInitFind={this.tnInitFind}
onError={this.handleError}