From 832a851b8f0149d610c2b5870aa8a7b5ed4415b8 Mon Sep 17 00:00:00 2001 From: Lennart <1247198+totalimmersion@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:11:28 +0100 Subject: [PATCH] [CHA-242] Adding new property to channel config (#291) * feat: adding new property to channel config * fix: test --- channel_config.go | 2 ++ message_history_test.go | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/channel_config.go b/channel_config.go index faa0708..67de9a5 100644 --- a/channel_config.go +++ b/channel_config.go @@ -43,6 +43,8 @@ type ChannelConfig struct { // Dynamic Partitioning PartitionSize int `json:"partition_size,omitempty"` PartitionTTL *DurationString `json:"partition_ttl,omitempty"` + + SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs,omitempty"` } // DurationString is a duration that's encoded to as a string in JSON. diff --git a/message_history_test.go b/message_history_test.go index 4067ddf..f3240e7 100644 --- a/message_history_test.go +++ b/message_history_test.go @@ -20,7 +20,7 @@ func TestMessageHistory(t *testing.T) { initialText := "initial text" customField := "custom_field" initialCustomFieldValue := "custom value" - // send a message with initial text + // send a message with initial text (user1) response, err := ch.SendMessage(ctx, &Message{Text: initialText, ExtraData: map[string]interface{}{customField: initialCustomFieldValue}}, user1.ID) require.NoError(t, err) message := response.Message @@ -56,7 +56,7 @@ func TestMessageHistory(t *testing.T) { secondUpdate := history[0] assert.Equal(t, updatedText1, secondUpdate.Text) - assert.Equal(t, user2.ID, secondUpdate.MessageUpdatedByID) + assert.Equal(t, user1.ID, secondUpdate.MessageUpdatedByID) assert.Equal(t, updatedCustomFieldValue, secondUpdate.ExtraData[customField].(string)) }) @@ -85,6 +85,6 @@ func TestMessageHistory(t *testing.T) { secondUpdate := sortedHistory[1] assert.Equal(t, updatedText1, secondUpdate.Text) - assert.Equal(t, user2.ID, secondUpdate.MessageUpdatedByID) + assert.Equal(t, user1.ID, secondUpdate.MessageUpdatedByID) }) }