Skip to content

Commit ff902db

Browse files
authored
Merge pull request #4 from insave-hosting/master
Add capability with php 8.1
2 parents 1257f8a + 69fefa1 commit ff902db

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

chatwoot/hooks.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ function hook_chatwoot_output($vars)
6969
}
7070

7171
# user basic info
72-
$client = CurrentUser::client(); //Menu::context('client');
73-
$user = CurrentUser::user();
72+
$currentUser = new CurrentUser;
73+
$client = $currentUser->client();
74+
$user = $currentUser->user();
7475
$ipaddress = $_SERVER['REMOTE_ADDR'];
7576
$ip = gethostbyaddr($ipaddress);
7677
$currentpage = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
@@ -85,7 +86,7 @@ function hook_chatwoot_output($vars)
8586
}
8687

8788
# Get client ID and set contact ID
88-
if ($user && $client && $user->isOwner(CurrentUser::client())) {
89+
if ($user && $client && $user->isOwner( $client)) {
8990
$ClientID = $client->id; //$vars['clientsdetails']['id'];
9091
} elseif ($user) {
9192
$ownedClients = $user->ownedClients()->all();

0 commit comments

Comments
 (0)