From 017341ea1af404b098790b869badc10504bcc42e Mon Sep 17 00:00:00 2001 From: DmitryZagorulko Date: Tue, 29 Jan 2019 13:36:00 +0300 Subject: [PATCH 1/4] add comment attribute to file channel settings --- v1/types.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/v1/types.go b/v1/types.go index 99c9f95..219fb52 100644 --- a/v1/types.go +++ b/v1/types.go @@ -105,11 +105,13 @@ type ChannelSettingsText struct { // ChannelSettingsFilesBase struct type ChannelSettingsFilesBase struct { - Creating string `json:"creating,omitempty"` - Editing string `json:"editing,omitempty"` - Quoting string `json:"quoting,omitempty"` - Deleting string `json:"deleting,omitempty"` - Max uint64 `json:"max_items_count,omitempty"` + Creating string `json:"creating,omitempty"` + Editing string `json:"editing,omitempty"` + Quoting string `json:"quoting,omitempty"` + Deleting string `json:"deleting,omitempty"` + Max uint64 `json:"max_items_count,omitempty"` + CommentAttribute string `json:"comment_attribute,omitempty"` + CommentMaxCharsCount int `json:"comment_max_chars_count,omitempty"` } // FullFileResponse uploaded file data From 9634ccb674c90ce067b24cb2dd7742e127a29205 Mon Sep 17 00:00:00 2001 From: DmitryZagorulko Date: Wed, 30 Jan 2019 16:54:56 +0300 Subject: [PATCH 2/4] add originator in SendData struct --- v1/types.go | 1 + 1 file changed, 1 insertion(+) diff --git a/v1/types.go b/v1/types.go index 219fb52..fe812f8 100644 --- a/v1/types.go +++ b/v1/types.go @@ -232,6 +232,7 @@ type EditMessageRequestMessage struct { // SendData struct type SendData struct { Message Message `json:"message"` + Originator string `json:"originator"` User User `json:"user"` Channel uint64 `json:"channel"` ExternalChatID string `json:"external_chat_id"` From ef8efa7354337fd35691f62c13b6d8bbb91802f4 Mon Sep 17 00:00:00 2001 From: DmitryZagorulko Date: Thu, 31 Jan 2019 17:10:51 +0300 Subject: [PATCH 3/4] add avatar url in channel settings --- v1/types.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/v1/types.go b/v1/types.go index fe812f8..2ca2309 100644 --- a/v1/types.go +++ b/v1/types.go @@ -57,10 +57,11 @@ type MgClient struct { // Channel type type Channel struct { - ID uint64 `json:"id,omitempty"` - Type string `json:"type,omitempty"` - Name string `json:"name,omitempty"` - Settings ChannelSettings `json:"settings,omitempty,brackets"` + ID uint64 `json:"id,omitempty"` + Type string `json:"type,omitempty"` + Name string `json:"name,omitempty"` + AvatarUrl string `json:"avatar_url,omitempty"` + Settings ChannelSettings `json:"settings,omitempty,brackets"` } // ChannelSettings struct From 017cea7180a15b5918c1a7057c38a4e0dfa1b727 Mon Sep 17 00:00:00 2001 From: DmitryZagorulko Date: Thu, 31 Jan 2019 17:14:03 +0300 Subject: [PATCH 4/4] improve test --- v1/client_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v1/client_test.go b/v1/client_test.go index adb7248..7f102d1 100644 --- a/v1/client_test.go +++ b/v1/client_test.go @@ -187,6 +187,7 @@ func TestMgClient_TextMessages(t *testing.T) { Type: MsgTypeText, Text: "hello!", }, + Originator: "user", User: User{ ExternalID: "6", Nickname: "octopus", @@ -227,6 +228,7 @@ func TestMgClient_ImageMessages(t *testing.T) { Type: MsgTypeImage, Items: []Item{{ID: uploadFileResponse.ID}}, }, + Originator: "user", User: User{ ExternalID: "6", Nickname: "octopus",