summaryrefslogtreecommitdiffstats
path: root/src/store
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2021-05-03 11:17:54 +0200
committerGitHub <noreply@github.com>2021-05-03 11:17:54 +0200
commit254a54036a6055c04580890b825f7764504904ef (patch)
treea94f7237ce9f5c136c91631971f7436b39536398 /src/store
parent79c6c08cdcae368aa3b6c781b2b5b127e588ed11 (diff)
parentcfcdde4eb14e21ccc25ece3f0a45ade3c7768874 (diff)
Merge pull request #5538 from nextcloud/bugfix/3023/only-show-public-messages-as-last-messages
Only show public messages as last messages
Diffstat (limited to 'src/store')
-rw-r--r--src/store/conversationsStore.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/store/conversationsStore.js b/src/store/conversationsStore.js
index ae044a4ca..eab4e982f 100644
--- a/src/store/conversationsStore.js
+++ b/src/store/conversationsStore.js
@@ -331,7 +331,17 @@ const actions = {
},
async updateConversationLastMessage({ commit }, { token, lastMessage }) {
- commit('updateConversationLastMessage', { token, lastMessage })
+ /**
+ * Only use the last message as lastmessage when:
+ * 1. It's not a command reply
+ * 2. It's not a temporary message starting with "/" which is a user posting a command
+ */
+ if ((lastMessage.actorType !== 'bots'
+ || lastMessage.actorId === 'changelog')
+ && ((typeof lastMessage.id.startsWith === 'function' && !lastMessage.id.startsWith('temp-'))
+ || !lastMessage.message.startsWith('/'))) {
+ commit('updateConversationLastMessage', { token, lastMessage })
+ }
},
async updateConversationLastReadMessage({ commit }, { token, lastReadMessage }) {