Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show email in NS INFO when user has permission. #1677

Merged
merged 1 commit into from Jun 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions irc/accounts.go
Expand Up @@ -1259,6 +1259,9 @@ func (am *AccountManager) deserializeRawAccount(raw rawClientAccount, cfName str
return
}
result.AdditionalNicks = unmarshalReservedNicks(raw.AdditionalNicks)
if strings.HasPrefix(raw.Callback, "mailto:") {
result.Email = strings.TrimPrefix(raw.Callback, "mailto:")
}
result.Verified = raw.Verified
if raw.VHost != "" {
e := json.Unmarshal([]byte(raw.VHost), &result.VHost)
Expand Down Expand Up @@ -2032,6 +2035,7 @@ type ClientAccount struct {
Name string
NameCasefolded string
RegisteredAt time.Time
Email string
Credentials AccountCredentials
Verified bool
Suspended *AccountSuspension
Expand Down
7 changes: 7 additions & 0 deletions irc/nickserv.go
Expand Up @@ -813,6 +813,13 @@ func nsInfoHandler(service *ircService, server *Server, client *Client, command
service.Notice(rb, fmt.Sprintf(client.t("Account: %s"), account.Name))
registeredAt := account.RegisteredAt.Format(time.RFC1123)
service.Notice(rb, fmt.Sprintf(client.t("Registered at: %s"), registeredAt))

if account.Name == client.AccountName() || client.HasRoleCapabs("accreg") {
if account.Email != "" {
service.Notice(rb, fmt.Sprintf(client.t("Email address: %s"), account.Email))
}
}

// TODO nicer formatting for this
for _, nick := range account.AdditionalNicks {
service.Notice(rb, fmt.Sprintf(client.t("Additional grouped nick: %s"), nick))
Expand Down