Skip to content

Commit

Permalink
removed check on attributes.updateconversation == false. Now conversa…
Browse files Browse the repository at this point in the history
…tions are always updated
  • Loading branch information
sponzillo committed Nov 6, 2022
1 parent 43e314b commit 91b0b20
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
available on:
▶️ https://www.npmjs.com/package/@chat21/chat21-server

## v0.2.26 - online
- removed if (savedMessage.attributes && savedMessage.attributes.updateconversation == false) {update_conversation = false}. Now conversations are always updated. Same modification also on chat21client.js

## v0.2.25 - online
- all negative acks removed. All callback(false) => callback(true) to avoid queue blocks
- minor fixes
Expand Down
3 changes: 3 additions & 0 deletions mqttclient/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Chat21Client.js CHANGELOG

### v0.1.12.2
- - removed if (savedMessage.attributes && savedMessage.attributes.updateconversation == false) {update_conversation = false}. Now conversations are always updated. Same modification also on observer.js

### v0.1.12.1
- some console.log() hidden

Expand Down
11 changes: 5 additions & 6 deletions mqttclient/chat21client.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Chat21Client
v0.1.12.1
v0.1.12.2
@Author Andrea Sponziello
(c) Tiledesk 2020
Expand Down Expand Up @@ -630,12 +630,11 @@ class Chat21Client {
// Observing conversations added from messages
// console.log("Observing conversations added from messages", message_json);
// if (this.onConversationAddedCallbacks) {
// console.log("callbacks ok........");
let update_conversation = true;
if (message_json.attributes && message_json.attributes.updateconversation == false) {
update_conversation = false
}
// console.log("update_conversation........", update_conversation);
// temporarily ignoring the updateconversation = false option
// if (message_json.attributes && message_json.attributes.updateconversation == false) {
// update_conversation = false
// }
if (update_conversation && this.onConversationAddedCallbacks) {
this.onConversationAddedCallbacks.forEach((callback, handler, map) => {
message_json.is_new = true;
Expand Down
7 changes: 4 additions & 3 deletions observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,9 +663,10 @@ function process_persist(topic, message_string, callback) {
savedMessage.conversWith = convers_with

let update_conversation = true
if (savedMessage.attributes && savedMessage.attributes.updateconversation == false) {
update_conversation = false
}
// temporarily ignoring the updateconversation = false option
// if (savedMessage.attributes && savedMessage.attributes.updateconversation == false) {
// update_conversation = false
// }
// logger.debug("updateconversation = " + update_conversation)
chatdb.saveOrUpdateMessage(savedMessage, function(err, msg) {
// logger.debug("Message saved", savedMessage)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chat21/chat21-server",
"version": "0.2.25",
"version": "0.2.26",
"description": "Chat21 AMQP/MQTT messages dispatcher",
"dependencies": {
"aedes": "^0.40.1",
Expand Down

0 comments on commit 91b0b20

Please sign in to comment.