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