add 'chn' to the list of permitted topic name prefixes

This commit is contained in:
or-else
2021-03-15 16:47:31 -07:00
parent 6cd180771a
commit e703490a1e
5 changed files with 14 additions and 9 deletions
+3 -2
View File
@@ -35,8 +35,9 @@ class NewTopicById extends React.PureComponent {
handleSubmit(e) {
e.preventDefault();
if (this.state.groupId) {
var name = this.state.groupId.trim();
if (name.length > 3 && (name.substr(0, 3) == 'usr' || name.substr(0, 3) == 'grp')) {
const name = this.state.groupId.trim();
const prefix = name.substr(0, 3);
if (name.length > 3 && ['usr', 'grp', 'chn'].includes(prefix)) {
this.props.onSubmit(name);
} else {
this.props.onError(this.props.intl.formatMessage(messages.invalid_id), 'err');
+8 -4
View File
@@ -5452,6 +5452,10 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
}
this.tinode.getMeTopic().contacts(c => {
if (!c.topic && !c.user) {
c.topic = c.name;
}
newState.chatList.push(c);
if (this.state.topicSelected == c.topic) {
@@ -7562,17 +7566,17 @@ class ContactList extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
const key = this.props.showMode ? c.user : c.topic || c.user;
if (this.props.filterFunc && this.props.filter) {
let content = [key];
const filterOn = [key];
if (c.private && c.private.comment) {
content.push(('' + c.private.comment).toLowerCase());
filterOn.push(('' + c.private.comment).toLowerCase());
}
if (c.public && c.public.fn) {
content.push(('' + c.public.fn).toLowerCase());
filterOn.push(('' + c.public.fn).toLowerCase());
}
if (!this.props.filterFunc(this.props.filter, content)) {
if (!this.props.filterFunc(this.props.filter, filterOn)) {
return;
}
}
+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