Add an icon for bot messages. Closes #1172 (#1729)

This commit is contained in:
Gabe Kangas
2022-03-06 20:09:55 -08:00
committed by GitHub
parent 6e0e33dedb
commit 78c27ddbdd
8 changed files with 154 additions and 131 deletions

View File

@@ -22,6 +22,7 @@ type ExternalAPIUser struct {
Scopes []string `json:"scopes"`
Type string `json:"type,omitempty"` // Should be API
LastUsedAt *time.Time `json:"lastUsedAt,omitempty"`
IsBot bool `json:"isBot"`
}
const (
@@ -240,6 +241,7 @@ func makeExternalAPIUsersFromRows(rows *sql.Rows) ([]ExternalAPIUser, error) {
CreatedAt: createdAt,
Scopes: strings.Split(scopes, ","),
LastUsedAt: lastUsedAt,
IsBot: true,
}
integrations = append(integrations, integration)
}

View File

@@ -16,8 +16,10 @@ import (
var _datastore *data.Datastore
const moderatorScopeKey = "MODERATOR"
const minSuggestedUsernamePoolLength = 10
const (
moderatorScopeKey = "MODERATOR"
minSuggestedUsernamePoolLength = 10
)
// User represents a single chat user.
type User struct {
@@ -29,7 +31,8 @@ type User struct {
DisabledAt *time.Time `json:"disabledAt,omitempty"`
PreviousNames []string `json:"previousNames"`
NameChangedAt *time.Time `json:"nameChangedAt,omitempty"`
Scopes []string `json:"scopes"`
Scopes []string `json:"scopes,omitempty"`
IsBot bool `json:"isBot"`
}
// IsEnabled will return if this single user is enabled.