Add profile name to group show

This commit is contained in:
Finn 2021-03-28 22:06:36 -07:00
parent b6be793f8c
commit 3403eb19a5

View file

@ -83,18 +83,30 @@ var (
}
fmt.Println("Members")
membere164s := make(map[string]string)
for _, member := range group.Members {
if member.Number == "" {
continue
}
membere164s[member.UUID] = member.Number
}
// membere164s := make(map[string]string)
// for _, member := range group.Members {
// if member.Number == "" {
// continue
// }
// membere164s[member.UUID] = member.Number
// }
t := table.NewWriter()
t.AppendHeader(table.Row{"Number", "UUID", "Role"})
t.AppendHeader(table.Row{"Number", "UUID", "Name", "Role"})
for _, member := range group.MemberDetail {
t.AppendRow(table.Row{membere164s[member.UUID], member.UUID, member.Role})
req := v1.GetProfileRequest{
Account: account,
Address: &v1.JsonAddress{UUID: member.UUID},
Async: true,
}
e164 := ""
profile, err := req.Submit(common.Signald)
if err != nil {
log.Println("error getting profile: ", err)
} else {
e164 = profile.Address.Number
}
t.AppendRow(table.Row{e164, member.UUID, profile.ProfileName, member.Role})
}
t.SetOutputMirror(os.Stdout)
common.StylizeTable(t)