HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/intranet.kauko.lt/wp-content/plugins/wise-chat/src/integrations/WiseChatHelper.php
<?php

/**
 * WiseChat integrations helper class.
 *
 * @author Kainex <contact@kainex.pl>
 */
class WiseChatHelper {

	/**
	 * @param integer $wordPressUserId
	 * @return string
	 */
	public static function getDirectChannelId($wordPressUserId) {
		/** @var WiseChatUsersDAO $usersDAO */
		$usersDAO = WiseChatContainer::getLazy('dao/user/WiseChatUsersDAO');

		/** @var WiseChatClientSide $clientSide */
		$clientSide = WiseChatContainer::getLazy('services/client-side/WiseChatClientSide');


		$id = $usersDAO->getLatestByWordPressId($wordPressUserId);

		return $clientSide->encryptDirectChannelId($id ? $id->getId() : 'v'.$wordPressUserId);
	}

}