File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -80,25 +80,25 @@ function hook_chatwoot_output($vars)
80
80
$ user_browser = getBrowser ();
81
81
82
82
# Fetch labels
83
- if (!is_null ($ client )) {
83
+ if (!is_null ($ user )) {
84
84
$ chatwoot_label = $ chatwoot_setlabelloggedin ;
85
85
}
86
86
87
- # Get client ID and set chat ID
88
- if ($ user && $ user ->isOwner (CurrentUser::client ())) {
87
+ # Get client ID and set contact ID
88
+ if ($ user && $ client && $ user ->isOwner (CurrentUser::client ())) {
89
89
$ ClientID = $ client ->id ; //$vars['clientsdetails']['id'];
90
90
} elseif ($ user ) {
91
91
$ ownedClients = $ user ->ownedClients ()->all ();
92
92
$ ClientID = $ ownedClients [0 ]['id ' ];
93
93
}
94
94
95
- if (!is_null ($ client )) {
95
+ if (!is_null ($ user )) {
96
96
$ ClientChatID = hash_hmac ("sha256 " , $ ClientID , $ signing_hash );
97
97
$ identifier_hash = hash_hmac ("sha256 " , $ ClientChatID , $ verification_hash );
98
98
}
99
99
100
- # getting Client Info
101
- if (!is_null ($ client )) {
100
+ # build contact info
101
+ if (!is_null ($ user )) {
102
102
103
103
$ apiPostData = array ('clientid ' => $ ClientID , 'stats ' => true );
104
104
$ apiResults = localAPI ('GetClientsDetails ' , $ apiPostData );
@@ -142,7 +142,7 @@ function hook_chatwoot_output($vars)
142
142
143
143
# Now let's prepare our code for final output
144
144
145
- if (!is_null ($ client )) {
145
+ if (!is_null ($ user )) {
146
146
147
147
$ chatwoot_output =
148
148
"$ chatwoot_jscode
You can’t perform that action at this time.
0 commit comments