summaryrefslogtreecommitdiff
path: root/src/conn-contact-info.c
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-06-22 12:34:42 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2011-06-28 11:01:04 +0100
commit7bea4d961ec7361455258ed01750df28a7207c26 (patch)
treeadec3f2ad69496875e4c5602dab7a29222c0a988 /src/conn-contact-info.c
parentf54614c40756f382d1a608054f1b711ff6390d5c (diff)
ContactInfo: don't claim PHOTO is unknown
Previously this code would log “unknown vCard node in XML: PHOTO” for every vCard that flew past. This is misleading: PHOTO is perfectly well-known, it's just handled by a different bit of code. So this patch adds the notion of an ignored field, which the ContactInfo code knows about but does nothing with. I didn't add any of the other fields mentioned in the comment at the end of the field table: they're not handled anywhere, so it may arguably be worth logging something about these.
Diffstat (limited to 'src/conn-contact-info.c')
-rw-r--r--src/conn-contact-info.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/conn-contact-info.c b/src/conn-contact-info.c
index 050aa228f..bdf02ba48 100644
--- a/src/conn-contact-info.c
+++ b/src/conn-contact-info.c
@@ -57,7 +57,10 @@ typedef enum {
/* in Telepathy, one multi-line value; in XMPP, a sequence of <LINE>s */
FIELD_LABEL,
/* same as FIELD_STRUCTURED except the last element may repeat n times */
- FIELD_ORG
+ FIELD_ORG,
+
+ /* a field we intentionally ignore */
+ FIELD_IGNORED
} FieldBehaviour;
typedef struct {
@@ -128,7 +131,8 @@ static VCardField known_fields[] = {
/* Things we don't handle: */
- /* PHOTO: we treat it as the avatar instead */
+ /* PHOTO is handled by the Avatar code */
+ { "PHOTO", NULL, FIELD_IGNORED },
/* KEY: is Base64 (perhaps? hard to tell from the XEP) */
/* LOGO: can be base64 or a URL */
@@ -371,6 +375,9 @@ _parse_vcard (WockyNode *vcard_node,
}
break;
+ case FIELD_IGNORED:
+ break;
+
default:
g_assert_not_reached ();
}
@@ -971,6 +978,9 @@ conn_contact_info_build_supported_fields (GabbleConnection *conn,
guint i;
TpContactInfoFieldFlags tp_flags = field->tp_flags;
+ if (field->behaviour == FIELD_IGNORED)
+ continue;
+
/* Shorthand to avoid having to put it in the struct initialization:
* on XMPP, there is no field that supports arbitrary type-parameters.
* Setting Parameters_Mandatory eliminates the special case that an