Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
trim contact unicode (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
derricw authored May 4, 2021
1 parent 1c9840a commit fd2dbe8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"path/filepath"
"regexp"
"sort"
"strings"
"time"

"github.com/derricw/siggo/signal"
Expand Down Expand Up @@ -842,15 +843,18 @@ func (s *Siggo) getContacts() ContactList {
}
for _, c := range contacts {
if c.InboxPosition != nil {
// strip the weird-ass unicode that we seem to be reading
// for some unknown reason
name := strings.Trim(c.Name, "\u2068\u2069")
alias := ""
if s.config.ContactAliases != nil {
alias = s.config.ContactAliases[c.Name]
alias = s.config.ContactAliases[name]
}
// check if we have a color for this contact
color := s.config.ContactColors[c.Name]
color := s.config.ContactColors[name]
contact := &Contact{
Number: c.Number,
Name: c.Name,
Name: name,
Index: *c.InboxPosition,
alias: alias,
color: color,
Expand Down

0 comments on commit fd2dbe8

Please sign in to comment.