git://git.nikiroo.be
/
jvcard.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
VCard format: correctly co/decode escaped values
[jvcard.git]
/
src
/
be
/
nikiroo
/
jvcard
/
Contact.java
diff --git
a/src/be/nikiroo/jvcard/Contact.java
b/src/be/nikiroo/jvcard/Contact.java
index 87c1286a77093d436148a1563015f789e1b9beb6..1b888961466737bace2f6f647ee5d9d21b2b739b 100644
(file)
--- a/
src/be/nikiroo/jvcard/Contact.java
+++ b/
src/be/nikiroo/jvcard/Contact.java
@@
-11,7
+11,7
@@
import java.util.UUID;
import be.nikiroo.jvcard.parsers.Format;
import be.nikiroo.jvcard.parsers.Parser;
import be.nikiroo.jvcard.parsers.Format;
import be.nikiroo.jvcard.parsers.Parser;
-import be.nikiroo.jvcard.
tui
.StringUtils;
+import be.nikiroo.jvcard.
resources
.StringUtils;
/**
* A contact is the information that represent a contact person or organisation.
/**
* A contact is the information that represent a contact person or organisation.
@@
-47,13
+47,9
@@
public class Contact extends BaseClass<Data> {
for (Data data : getData(name)) {
if (first == null)
first = data;
for (Data data : getData(name)) {
if (first == null)
first = data;
- for (int index = 0; index < data.size(); index++) {
- TypeInfo type = data.get(index);
- if (type.getName().equals("TYPE")
- && type.getValue().equals("pref")) {
- return data;
- }
- }
+
+ if (data.isPreferred())
+ return data;
}
return first;
}
return first;
@@
-418,7
+414,7
@@
public class Contact extends BaseClass<Data> {
@Override
public String getState() {
@Override
public String getState() {
- return
"" + getPreferredDataValue("UID"
);
+ return
getId(
);
}
/**
}
/**