@@ -684,7 +684,6 @@ func (bb *blueBubbles) GetChatsWithMessagesAfter(minDate time.Time) (resp []imes
684
684
}
685
685
686
686
func (bb * blueBubbles ) matchHandleToContact (address string ) * Contact {
687
-
688
687
var matchedContact * Contact
689
688
690
689
numericAddress := numericOnly (address )
@@ -703,18 +702,19 @@ func (bb *blueBubbles) matchHandleToContact(address string) *Contact {
703
702
var phoneStrings = convertPhones (c .PhoneNumbers )
704
703
705
704
// check for exact matches for either an email or phone
706
- if strings .Contains (address , "@" ) {
707
- if containsString (emailStrings , address ) {
708
- contact = & c
709
- }
705
+ if strings .Contains (address , "@" ) && containsString (emailStrings , address ) {
706
+ contact = & Contact {} // Create a new instance
707
+ * contact = c
710
708
} else if containsString (phoneStrings , numericAddress ) {
711
- contact = & c
709
+ contact = & Contact {} // Create a new instance
710
+ * contact = c
712
711
}
713
712
714
713
for _ , p := range numericPhones {
715
714
matchLengths := []int {15 , 14 , 13 , 12 , 11 , 10 , 9 , 8 , 7 }
716
715
if containsInt (matchLengths , len (p )) && strings .HasSuffix (numericAddress , p ) {
717
- contact = & c
716
+ contact = & Contact {} // Create a new instance
717
+ * contact = c
718
718
}
719
719
}
720
720
@@ -725,7 +725,8 @@ func (bb *blueBubbles) matchHandleToContact(address string) *Contact {
725
725
726
726
// Contacts with a source type of "api" are stored on the mac and can be used as fallback in case an imported one isn't found
727
727
if contact != nil && matchedContact == nil {
728
- matchedContact = contact
728
+ matchedContact = & Contact {} // Create a new instance
729
+ * matchedContact = * contact
729
730
}
730
731
}
731
732
0 commit comments