forget e164s that don't start with a +
This commit is contained in:
parent
fa1f0765d5
commit
8bb40967e5
1 changed files with 8 additions and 0 deletions
|
@ -7,6 +7,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/lib/pq"
|
"github.com/lib/pq"
|
||||||
|
@ -225,6 +226,13 @@ func moveRecipients(source *sql.DB, dest *sql.DB) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if e164.Valid && !strings.HasPrefix(e164.String, "+") {
|
||||||
|
log.Println("corrupt e164 found, setting to null")
|
||||||
|
e164.Valid = false
|
||||||
|
e164.String = ""
|
||||||
|
}
|
||||||
|
|
||||||
_, err = dest.Exec("INSERT INTO signald_recipients (rowid, account_uuid, uuid, e164) VALUES ($1, $2, $3, $4)", rowID, accountUUID, recipientUUID, e164)
|
_, err = dest.Exec("INSERT INTO signald_recipients (rowid, account_uuid, uuid, e164) VALUES ($1, $2, $3, $4)", rowID, accountUUID, recipientUUID, e164)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue