From 2497595deead4ddc2e4f18a7cd56f2d5d28bbfbc Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 7 Mar 2009 20:52:27 +0000 Subject: [PATCH] * When translating the input from a REGI command into a vCard, set the telephone number using 'tel' rather than 'tel;home' --- citadel/modules/vcard/serv_vcard.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/citadel/modules/vcard/serv_vcard.c b/citadel/modules/vcard/serv_vcard.c index 899199b68..3539c43d4 100644 --- a/citadel/modules/vcard/serv_vcard.c +++ b/citadel/modules/vcard/serv_vcard.c @@ -247,13 +247,16 @@ void ctdl_vcard_to_directory(struct CtdlMessage *msg, int op) { } } - if (!strcasecmp(v->prop[i].name, "tel;home")) + if ( (!strcasecmp(v->prop[i].name, "tel;home")) + || (!strcasecmp(v->prop[i].name, "tel;type=home")) ) (void) CtdlDoDirectoryServiceFunc("homePhone", v->prop[i].value, &objectlist, "ldap", DIRECTORY_ATTRIB_ADD); else - if (!strcasecmp(v->prop[i].name, "tel;fax")) + if ( (!strcasecmp(v->prop[i].name, "tel;fax")) + || (!strcasecmp(v->prop[i].name, "tel;type=fax")) ) (void) CtdlDoDirectoryServiceFunc("facsimileTelephoneNumber", v->prop[i].value, &objectlist, "ldap", DIRECTORY_ATTRIB_ADD); else - if (!strcasecmp(v->prop[i].name, "tel;cell")) + if ( (!strcasecmp(v->prop[i].name, "tel;cell")) + || (!strcasecmp(v->prop[i].name, "tel;type=cell")) ) (void) CtdlDoDirectoryServiceFunc("mobile", v->prop[i].value, &objectlist, "ldap", DIRECTORY_ATTRIB_ADD); else if ( (!strcasecmp(v->prop[i].name, "tel")) @@ -879,7 +882,7 @@ void cmd_regi(char *argbuf) { } } } - if (a==5) vcard_set_prop(my_vcard, "tel;home", buf, 0); + if (a==5) vcard_set_prop(my_vcard, "tel", buf, 0); if (a==6) vcard_set_prop(my_vcard, "email;internet", buf, 0); if (a==7) strcpy(tmpcountry, buf); ++a; @@ -945,7 +948,7 @@ void cmd_greg(char *argbuf) extract_token(buf, adr, 5, ';', sizeof buf); cprintf("%s\n", buf); /* zip */ - s = vcard_get_prop(v, "tel;home", 0, 0, 0); + s = vcard_get_prop(v, "tel", 0, 0, 0); if (s == NULL) s = vcard_get_prop(v, "tel", 1, 0, 0); if (s != NULL) { cprintf("%s\n", s); -- 2.30.2