public static InReplyTo addInReplyTo(Entry entry, Entry ref) {
if (ref.equals(entry)) return null;
InReplyTo irt = addInReplyTo(entry);
try {
irt.setRef(ref.getId());
Link altlink = ref.getAlternateLink();
if (altlink != null) {
irt.setHref(altlink.getResolvedHref());
if (altlink.getMimeType() != null)
irt.setMimeType(altlink.getMimeType());
}
Source src = ref.getSource();
if (src != null) {
Link selflink = src.getSelfLink();
if (selflink != null)
irt.setSource(selflink.getResolvedHref());
}
} catch (Exception e) {}
return irt;
}