/android/import-contacts

To get this branch, use:
bzr branch http://bzr.ed.am/android/import-contacts

« back to all changes in this revision

Viewing changes to src/am/ed/importcontacts/VcardImporter.java

  • Committer: edam
  • Date: 2012-12-20 16:49:39 UTC
  • Revision ID: tim@ed.am-20121220164939-j9mg98v0uofws7kw
added support for notes; rewrote backends so that all normalising of data is now done within the contacts cache; made the vCard unescape routine slightly more acceptant of non-standard escaped characters

Show diffs side-by-side

added added

removed removed

Lines of Context:
681
681
                                        parseADR( name_param_parts, complete_value );
682
682
                                else if( name_param_parts[ 0 ].equals( "LABEL" ) )
683
683
                                        parseLABEL( name_param_parts, complete_value );
 
684
                                else if( name_param_parts[ 0 ].equals( "NOTE" ) )
 
685
                                        parseNOTE( name_param_parts, complete_value );
684
686
                        }
685
687
                }
686
688
 
758
760
                                in_escape = false;
759
761
                                switch( c )
760
762
                                {
 
763
                                case 'T':
 
764
                                case 't':
 
765
                                        // add tab (invalid/non-standard, but accepted)
 
766
                                        ret.append( '\t' );
 
767
                                        break;
761
768
                                case 'N':
762
769
                                case 'n':
763
770
                                        // add newline
771
778
                                        break;
772
779
                                default:
773
780
                                        // unknown escape sequence, so add it unescaped
 
781
                                        // (invalid/non-standard, but accepted)
774
782
                                        ret.append( "\\" );
775
783
                                        ret.append( Character.toChars( c ) );
776
784
                                        break;
965
973
                        addAddress( unescapeValue( value ), type );
966
974
                }
967
975
 
 
976
                private void parseNOTE( String[] params, String value )
 
977
                {
 
978
                        addNote( unescapeValue( value ) );
 
979
                }
 
980
 
968
981
                public void finaliseVcard()
969
982
                        throws ParseException, ContactNotIdentifiableException
970
983
                {