got: future proof for switch to authenticated_user
This commit is contained in:
parent
95fea0358e
commit
ffc827c2f6
7
got.go
7
got.go
@ -45,6 +45,7 @@ type Notification struct {
|
|||||||
Short bool `json:"short"`
|
Short bool `json:"short"`
|
||||||
Repo string `json:"repo"`
|
Repo string `json:"repo"`
|
||||||
AuthUser string `json:"auth_user"`
|
AuthUser string `json:"auth_user"`
|
||||||
|
AuthenticatedUser string `json:"authenticated_user"`
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Author Author `json:"author,omitempty"`
|
Author Author `json:"author,omitempty"`
|
||||||
Committer Committer `json:"committer"`
|
Committer Committer `json:"committer"`
|
||||||
@ -56,8 +57,12 @@ type Notification struct {
|
|||||||
|
|
||||||
func (n *Notification) String() string {
|
func (n *Notification) String() string {
|
||||||
// op committed got.git f9e653700..f9e653700^1 (main): fix gotd_parse_url() (https://git.gameoftrees.org/gitweb/?p=got.git;a=commitdiff;h=f9e653700)
|
// op committed got.git f9e653700..f9e653700^1 (main): fix gotd_parse_url() (https://git.gameoftrees.org/gitweb/?p=got.git;a=commitdiff;h=f9e653700)
|
||||||
|
user := n.AuthenticatedUser
|
||||||
|
if user == "" {
|
||||||
|
user = n.AuthUser
|
||||||
|
}
|
||||||
return fmt.Sprintf("%s committed %s %s: %s (%s)",
|
return fmt.Sprintf("%s committed %s %s: %s (%s)",
|
||||||
n.AuthUser,
|
user,
|
||||||
n.Repo,
|
n.Repo,
|
||||||
n.ID,
|
n.ID,
|
||||||
n.ShortMessage,
|
n.ShortMessage,
|
||||||
|
Loading…
Reference in New Issue
Block a user