@@ -40,9 +40,9 @@ class MessagesPage extends Component {
4040    } 
4141    return  recipients . map ( ( recipient )  =>  { 
4242      const  phoneNumber  =  recipient . phoneNumber  ||  recipient . extensionNumber ; 
43-       if  ( phoneNumber   &&   this . props . matcherContactName )  { 
44-         const  matcherName  =  this . props . matcherContactName ( phoneNumber ) ; 
45-         if  ( matcherName )  { 
43+       if  ( recipient . matchedNames )  { 
44+         const  matcherName  =  recipient . matchedNames . map ( matcher   =>   matcher . name ) . join ( '&' ) ; 
45+         if  ( matcherName . length   >   0 )  { 
4646          return  matcherName ; 
4747        } 
4848        return  this . props . formatPhone ( phoneNumber ) ; 
@@ -63,9 +63,9 @@ class MessagesPage extends Component {
6363        if  ( searchNumber  &&  searchNumber . length  >  0  &&  phoneNumber . indexOf ( searchNumber )  >=  0 )  { 
6464          return  true ; 
6565        } 
66-         if  ( this . props . matcherContactName )  { 
67-           const  matcherName  =  this . props . matcherContactName ( phoneNumber ) ; 
68-           if  ( matcherName )  { 
66+         if  ( recipient . matchedNames )  { 
67+           const  matcherName  =  recipient . matchedNames . map ( matcher   =>   matcher . name ) . join ( '&' ) ; 
68+           if  ( matcherName . length   >   0 )  { 
6969            recipientName  =  matcherName ; 
7070          }  else  { 
7171            recipientName  =  phoneNumber ; 
@@ -175,17 +175,12 @@ MessagesPage.propTypes = {
175175  getRecipientsList : PropTypes . func . isRequired , 
176176  searchMessagesText : PropTypes . func . isRequired , 
177177  updateSearchResults : PropTypes . func . isRequired , 
178-   matcherContactName : PropTypes . func , 
179- } ; 
180- 
181- MessagesPage . defaultProps  =  { 
182-   matcherContactName : null , 
183178} ; 
184179
185180function  mapStateToProps ( state ,  props )  { 
186181  return  ( { 
187182    currentLocale : props . locale . currentLocale , 
188-     messages : props . messages . messages , 
183+     messages : props . messages . normalizedMessages , 
189184    allMessages : props . messageStore . conversations , 
190185    showSpinner : ( 
191186      ! props . messages . ready  || 
@@ -200,16 +195,6 @@ function mapStateToProps(state, props) {
200195} 
201196
202197function  mapDispatchToProps ( dispatch ,  props )  { 
203-   let  matcherContactName  =  null ; 
204-   if  ( props . contactMatcher  &&  props . contactMatcher . ready )  { 
205-     matcherContactName  =  ( phoneNumber )  =>  { 
206-       const  matcherNames  =  props . contactMatcher . dataMapping [ phoneNumber ] ; 
207-       if  ( matcherNames  &&  matcherNames [ 0 ]  &&  matcherNames [ 0 ] . name )  { 
208-         return  matcherNames [ 0 ] . name ; 
209-       } 
210-       return  null ; 
211-     } ; 
212-   } 
213198  return  { 
214199    loadNextPageMessages : props . messages . loadNextPageMessages , 
215200    updateSearchingString : props . messages . updateSearchingString , 
@@ -228,7 +213,6 @@ function mapDispatchToProps(dispatch, props) {
228213    } ) , 
229214    searchMessagesText : searchText  => 
230215      props . messageStore . searchMessagesText ( searchText ) , 
231-     matcherContactName, 
232216  } ; 
233217} 
234218
0 commit comments