aboutsummaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax/contact/addproperty.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/contacts/ajax/contact/addproperty.php')
-rw-r--r--apps/contacts/ajax/contact/addproperty.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/contacts/ajax/contact/addproperty.php b/apps/contacts/ajax/contact/addproperty.php
index 1412cad1cbc..0447950fbdd 100644
--- a/apps/contacts/ajax/contact/addproperty.php
+++ b/apps/contacts/ajax/contact/addproperty.php
@@ -108,7 +108,17 @@ switch($name) {
$value = strtolower($value);
break;
case 'TEL':
- case 'ADR': // should I delete the property if empty or throw an error?
+ case 'ADR':
+ break;
+ case 'IMPP':
+ if(is_null($parameters) || !isset($parameters['X-SERVICE-TYPE'])) {
+ bailOut(OC_Contacts_App::$l10n->t('Missing IM parameter.'));
+ }
+ $impp = OC_Contacts_App::getIMOptions($parameters['X-SERVICE-TYPE']);
+ if(is_null($impp)) {
+ bailOut(OC_Contacts_App::$l10n->t('Unknown IM: '.$parameters['X-SERVICE-TYPE']));
+ }
+ $value = $impp['protocol'] . ':' . $value;
break;
}
@@ -126,7 +136,7 @@ $line = count($vcard->children) - 1;
// Apparently Sabre_VObject_Parameter doesn't do well with
// multiple values or I don't know how to do it. Tanghus.
foreach ($parameters as $key=>$element) {
- if(is_array($element) && strtoupper($key) == 'TYPE') {
+ if(is_array($element) /*&& strtoupper($key) == 'TYPE'*/) {
// NOTE: Maybe this doesn't only apply for TYPE?
// And it probably shouldn't be done here anyways :-/
foreach($element as $e) {