X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=api%2Fv3%2FIm.php;h=711db2e57e76a645e0ff502f9cb3763df377f260;hb=3fe06aa5f4d98f720c452c6e5de07b955b19221b;hp=d0b79b47155b38bb132bd9d11cfb6fa5381fabe4;hpb=0d5f2c6138df8949fac02b98d9487fd464a2ee3c;p=civicrm-core.git diff --git a/api/v3/Im.php b/api/v3/Im.php index d0b79b4715..711db2e57e 100644 --- a/api/v3/Im.php +++ b/api/v3/Im.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2017 | + | Copyright CiviCRM LLC (c) 2004-2019 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -52,6 +52,10 @@ function civicrm_api3_im_create($params) { */ function _civicrm_api3_im_create_spec(&$params) { $params['contact_id']['api.required'] = 1; + $defaultLocation = CRM_Core_BAO_LocationType::getDefault(); + if ($defaultLocation) { + $params['location_type_id']['api.default'] = $defaultLocation->id; + } } /**