| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * @package VikBooking |
| 4 | 4 | * @subpackage core |
| 5 | 5 | * @author E4J s.r.l. |
| 6 | - * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved. | |
| 6 | + * @copyright Copyright (C) 2026 E4J s.r.l. All Rights Reserved. | |
| 7 | 7 | * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL |
| 8 | 8 | * @link https://vikwp.com |
| 9 | 9 | */ |
| 10 | 10 | |
| @@ -41,35 +41,60 @@ | ||
| 41 | 41 | */ |
| 42 | 42 | public function getRecipients(); |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * Forces the pre-loading of the resources to make the context scripts work. | |
| 45 | + * Returns a short description to identify the context. | |
| 46 | 46 | * |
| 47 | - * @return void | |
| 47 | + * @return string | |
| 48 | 48 | */ |
| 49 | - public function useAssets(); | |
| 49 | + public function getSubject(); | |
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | - * Returns a short description to identify the context. | |
| 52 | + * Returns the URL that can be used to access the chat interface. | |
| 53 | 53 | * |
| 54 | 54 | * @return string |
| 55 | 55 | */ |
| 56 | - public function getSubject(); | |
| 56 | + public function getURL(); | |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | - * Returns an array of supported actions, which will be added to the | |
| 60 | - * contextual menu displayed within the chat interface. | |
| 59 | + * Returns an associative array of metadata related to this context. | |
| 61 | 60 | * |
| 61 | + * @param bool $public When true, skip sensistive metadata. | |
| 62 | + * | |
| 62 | 63 | * @return array |
| 63 | 64 | */ |
| 64 | - public function getActions(); | |
| 65 | + public function getMetadata(bool $public = false); | |
| 65 | 66 | |
| 66 | 67 | /** |
| 67 | - * Returns the URL that can be used to access the chat interface. | |
| 68 | + * Sets or updates the specified metadata into the context. | |
| 68 | 69 | * |
| 69 | - * @return string | |
| 70 | + * @param string $key The metadata key. | |
| 71 | + * @param mixed $value The metadata value. | |
| 72 | + * | |
| 73 | + * @return void | |
| 70 | 74 | */ |
| 71 | - public function getURL(); | |
| 75 | + public function setMetadata(string $key, $value); | |
| 76 | + | |
| 77 | + /** | |
| 78 | + * Forces the pre-loading of the resources to make the context scripts work. | |
| 79 | + * | |
| 80 | + * @param VBOChatUser $user Useful to differentiate the scripts to use | |
| 81 | + * depending on the authenticated user. | |
| 82 | + * | |
| 83 | + * @return void | |
| 84 | + */ | |
| 85 | + public function useAssets(VBOChatUser $user); | |
| 86 | + | |
| 87 | + /** | |
| 88 | + * Returns an array of supported actions, which will be added to the | |
| 89 | + * contextual menu displayed within the chat interface. | |
| 90 | + * | |
| 91 | + * @param VBOChatUser $user Useful to differentiate the actions to use | |
| 92 | + * depending on the authenticated user. | |
| 93 | + * | |
| 94 | + * @return array | |
| 95 | + */ | |
| 96 | + public function getActions(VBOChatUser $user); | |
| 72 | 97 | |
| 73 | 98 | /** |
| 74 | 99 | * Checks whether the provided user is allowed to perform the given action |
| 75 | 100 | * under the current context. |