make subscriber count work with older server
This commit is contained in:
@@ -1684,7 +1684,9 @@ class MessagesView extends React.Component {
|
|||||||
|
|
||||||
let lastSeen = null;
|
let lastSeen = null;
|
||||||
if (isChannel) {
|
if (isChannel) {
|
||||||
|
if (topic.subcnt) {
|
||||||
lastSeen = formatMessage(messages.subscriber_count, {count: topic.subcnt});
|
lastSeen = formatMessage(messages.subscriber_count, {count: topic.subcnt});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const cont = this.props.tinode.getMeTopic().getContact(this.state.topic);
|
const cont = this.props.tinode.getMeTopic().getContact(this.state.topic);
|
||||||
if (cont) {
|
if (cont) {
|
||||||
@@ -1697,10 +1699,12 @@ class MessagesView extends React.Component {
|
|||||||
// TODO: also handle user agent in c.seen.ua
|
// TODO: also handle user agent in c.seen.ua
|
||||||
}
|
}
|
||||||
} else if (Tinode.isGroupTopicName(cont.topic)) {
|
} else if (Tinode.isGroupTopicName(cont.topic)) {
|
||||||
|
if (topic.subcnt) {
|
||||||
lastSeen = formatMessage(messages.member_count, {count: topic.subcnt});
|
lastSeen = formatMessage(messages.member_count, {count: topic.subcnt});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const avatar = this.state.avatar || true;
|
const avatar = this.state.avatar || true;
|
||||||
const online = this.state.deleted || topic.isSelfType() ? null :
|
const online = this.state.deleted || topic.isSelfType() ? null :
|
||||||
this.props.online ? 'online' + (this.state.typingIndicator ? ' typing' : '') : 'offline';
|
this.props.online ? 'online' + (this.state.typingIndicator ? ' typing' : '') : 'offline';
|
||||||
|
|||||||
@@ -11133,9 +11133,11 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
});
|
});
|
||||||
let lastSeen = null;
|
let lastSeen = null;
|
||||||
if (isChannel) {
|
if (isChannel) {
|
||||||
|
if (topic.subcnt) {
|
||||||
lastSeen = formatMessage(messages.subscriber_count, {
|
lastSeen = formatMessage(messages.subscriber_count, {
|
||||||
count: topic.subcnt
|
count: topic.subcnt
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const cont = this.props.tinode.getMeTopic().getContact(this.state.topic);
|
const cont = this.props.tinode.getMeTopic().getContact(this.state.topic);
|
||||||
if (cont) {
|
if (cont) {
|
||||||
@@ -11148,12 +11150,14 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.isGroupTopicName(cont.topic)) {
|
} else if (tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.isGroupTopicName(cont.topic)) {
|
||||||
|
if (topic.subcnt) {
|
||||||
lastSeen = formatMessage(messages.member_count, {
|
lastSeen = formatMessage(messages.member_count, {
|
||||||
count: topic.subcnt
|
count: topic.subcnt
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const avatar = this.state.avatar || true;
|
const avatar = this.state.avatar || true;
|
||||||
const online = this.state.deleted || topic.isSelfType() ? null : this.props.online ? 'online' + (this.state.typingIndicator ? ' typing' : '') : 'offline';
|
const online = this.state.deleted || topic.isSelfType() ? null : this.props.online ? 'online' + (this.state.typingIndicator ? ' typing' : '') : 'offline';
|
||||||
const titleClass = 'panel-title' + (this.state.deleted ? ' deleted' : '');
|
const titleClass = 'panel-title' + (this.state.deleted ? ' deleted' : '');
|
||||||
|
|||||||
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
Reference in New Issue
Block a user