This commit is contained in:
or-else
2020-08-01 15:12:20 -07:00
parent 45c6cf22ff
commit 4d3682c0ef
6 changed files with 19 additions and 18 deletions
+13 -12
View File
@@ -2976,7 +2976,6 @@ class MessagesView extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Componen
if (topic && !topic.isSubscribed() && this.props.ready && (this.state.topic != prevState.topic || !prevProps.ready)) { if (topic && !topic.isSubscribed() && this.props.ready && (this.state.topic != prevState.topic || !prevProps.ready)) {
const newTopic = this.props.newTopicParams && this.props.newTopicParams._topicName == this.props.topic; const newTopic = this.props.newTopicParams && this.props.newTopicParams._topicName == this.props.topic;
let getQuery = topic.startMetaQuery().withLaterDesc(); let getQuery = topic.startMetaQuery().withLaterDesc();
console.log("subscribing:", this.state.isSharer, newTopic, topic.isChannel());
if (this.state.isSharer || newTopic && !topic.isChannel()) { if (this.state.isSharer || newTopic && !topic.isChannel()) {
getQuery = getQuery.withLaterSub(); getQuery = getQuery.withLaterSub();
@@ -3590,7 +3589,8 @@ class MessagesView extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Componen
}); });
} else { } else {
const topic = this.props.tinode.getTopic(this.state.topic); const topic = this.props.tinode.getTopic(this.state.topic);
const groupTopic = topic.getType() == 'grp' && !topic.isChannel(); const isChannel = topic.isChannel();
const groupTopic = topic.getType() == 'grp' && !isChannel;
let messageNodes = []; let messageNodes = [];
let previousFrom = null; let previousFrom = null;
let chatBoxClass = null; let chatBoxClass = null;
@@ -3600,35 +3600,36 @@ class MessagesView extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Componen
let nextFrom = null; let nextFrom = null;
if (i + 1 < this.state.messages.length) { if (i + 1 < this.state.messages.length) {
nextFrom = this.state.messages[i + 1].from; nextFrom = this.state.messages[i + 1].from || 'chan';
} }
let sequence = 'single'; let sequence = 'single';
let thisFrom = msg.from || 'chan';
if (msg.from == previousFrom) { if (thisFrom == previousFrom) {
if (msg.from == nextFrom) { if (thisFrom == nextFrom) {
sequence = 'middle'; sequence = 'middle';
} else { } else {
sequence = 'last'; sequence = 'last';
} }
} else if (msg.from == nextFrom) { } else if (thisFrom == nextFrom) {
sequence = 'first'; sequence = 'first';
} }
previousFrom = msg.from; previousFrom = thisFrom;
const isReply = !(msg.from == this.props.myUserId); const isReply = !(thisFrom == this.props.myUserId);
const deliveryStatus = topic.msgStatus(msg); const deliveryStatus = topic.msgStatus(msg);
let userName, userAvatar, userFrom; let userName, userAvatar, userFrom;
if (groupTopic) { if (groupTopic) {
const user = topic.userDesc(msg.from); const user = topic.userDesc(thisFrom);
if (user && user.public) { if (user && user.public) {
userName = user.public.fn; userName = user.public.fn;
userAvatar = Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_14__["makeImageUrl"])(user.public.photo); userAvatar = Object(_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_14__["makeImageUrl"])(user.public.photo);
} }
userFrom = msg.from; userFrom = thisFrom;
chatBoxClass = 'chat-box group'; chatBoxClass = 'chat-box group';
} else { } else {
chatBoxClass = 'chat-box'; chatBoxClass = 'chat-box';
@@ -3688,9 +3689,9 @@ class MessagesView extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Componen
avatar: avatar, avatar: avatar,
topic: this.state.topic, topic: this.state.topic,
title: this.state.title title: this.state.title
}), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { }), !isChannel ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
className: online className: online
})), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { }) : null), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
id: "topic-title-group" id: "topic-title-group"
}, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
id: "topic-title", id: "topic-title",
+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
+2 -2
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