private static function GetSystemJId($domain = "") { static $arSoNetUIdCache = array(); static $arSoNetSenderTypeCache = array(); static $arSoNetJIdCache = array(); CXMPPUtility::ClearOptionsCache("xmpp"); if (!array_key_exists($domain, $arSoNetSenderTypeCache)) { $arSoNetSenderTypeCache[$domain] = COption::GetOptionString("xmpp", "sonet_sender_type", "jid"); } if ($arSoNetSenderTypeCache[$domain] == "uid") { if (!array_key_exists($domain, $arSoNetUIdCache)) { $arSoNetUIdCache[$domain] = COption::GetOptionString("xmpp", "sonet_uid", false); } $senderId = intval($arSoNetUIdCache[$domain]); if ($senderId <= 0) { CXMPPUtility::Show("Wrong system jid arSoNetUIdCache[" . $domain . "]=" . $arSoNetUIdCache[$domain], 1); return 0; } $senderJId = CXMPPUtility::GetJIdByUserId($senderId, $domain); if (!$senderJId) { CXMPPUtility::Show("Wrong system jid arSoNetUIdCache[" . $domain . "]=" . $arSoNetUIdCache[$domain], 1); return 0; } } else { if (!array_key_exists($domain, $arSoNetJIdCache)) { $arSoNetJIdCache[$domain] = COption::GetOptionString("xmpp", "sonet_jid", "admin@" . $_SERVER["SERVER_NAME"]); } $senderJId = $arSoNetJIdCache[$domain]; } return $senderJId; }
private static function GetPresenceIBlockId($clientDomain) { static $arPresenceIBlockIdCache = array(); if (!array_key_exists($clientDomain, $arPresenceIBlockIdCache)) { CXMPPUtility::ClearOptionsCache("xmpp"); $arPresenceIBlockIdCache[$clientDomain] = COption::GetOptionInt('xmpp', 'iblock_presence'); } return $arPresenceIBlockIdCache[$clientDomain]; }