From a3c0fbf447e94d99ada9ab1d23bcfbb39d17184e Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 12 Jun 2019 17:21:32 -0400 Subject: [PATCH] Add support for git push messages --- chatIn.go | 23 +++++++++++++++++++++++ chatOut.go | 10 +++++----- keybase.go | 2 +- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/chatIn.go b/chatIn.go index 3b6a1d0..dc6dd63 100644 --- a/chatIn.go +++ b/chatIn.go @@ -30,10 +30,33 @@ type chatInAddedtoteam struct { type chatInBulkaddtoconv struct { Usernames []string `json:"usernames"` } +type chatInCommits struct { + CommitHash string `json:"commitHash"` + Message string `json:"message"` + AuthorName string `json:"authorName"` + AuthorEmail string `json:"authorEmail"` + Ctime int `json:"ctime"` +} +type chatInRefs struct { + RefName string `json:"refName"` + Commits []chatInCommits `json:"commits"` + MoreCommitsAvailable bool `json:"moreCommitsAvailable"` + IsDelete bool `json:"isDelete"` +} +type chatInGitpush struct { + Team string `json:"team"` + Pusher string `json:"pusher"` + RepoName string `json:"repoName"` + RepoID string `json:"repoID"` + Refs []chatInRefs `json:"refs"` + PushType int `json:"pushType"` + PreviousRepoName string `json:"previousRepoName"` +} type chatInSystem struct { SystemType int `json:"systemType"` Addedtoteam chatInAddedtoteam `json:"addedtoteam"` Bulkaddtoconv chatInBulkaddtoconv `json:"bulkaddtoconv"` + Gitpush chatInGitpush `json:"gitpush"` } type chatInResult struct { ResultTyp int `json:"resultTyp"` diff --git a/chatOut.go b/chatOut.go index c76bf4a..0f14947 100644 --- a/chatOut.go +++ b/chatOut.go @@ -43,12 +43,12 @@ type chatOutResultRatelimits struct { Gas int `json:"gas,omitempty"` } type conversation struct { - ID string `json:"id"` + ID string `json:"id"` Channel Channel `json:"channel"` - Unread bool `json:"unread"` - ActiveAt int `json:"active_at"` - ActiveAtMs int64 `json:"active_at_ms"` - MemberStatus string `json:"member_status"` + Unread bool `json:"unread"` + ActiveAt int `json:"active_at"` + ActiveAtMs int64 `json:"active_at_ms"` + MemberStatus string `json:"member_status"` } type ChatOut struct { Message string `json:"message,omitempty"` diff --git a/keybase.go b/keybase.go index f358608..52afd62 100644 --- a/keybase.go +++ b/keybase.go @@ -27,7 +27,7 @@ type Keybase struct { // Chat holds basic information about a specific conversation type Chat struct { - keybase Keybase + keybase Keybase Channel Channel }