Skip to content

Commit

Permalink
Merge pull request #97 from thrivedesk/fix/note-issue
Browse files Browse the repository at this point in the history
fix: note visibility issue
  • Loading branch information
pronob1010 authored Aug 29, 2024
2 parents 6c7dc13 + 17fae76 commit 7dc1176
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion includes/views/shortcode/conversation-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<!-- conversations -->
<div class="space-y-4">
<?php foreach ($conversation['events'] as $event): ?>
<?php if ($event['event']): ?>
<?php if ($event['event'] && $event['action'] !== 'note'): ?>
<?php $actor_name = $event['actor']['name'] ?? ''; ?>
<div class="td-conversation <?php echo $event['actor_type'] == ACTOR_TYPE ? 'actor-contact' : 'actor-agent';?>">
<div class="td-conversation-header">
Expand Down
47 changes: 26 additions & 21 deletions src/Conversations/Conversation.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,32 +239,37 @@ public function load_scripts(): void
* if conversation id then redirect to the conversation details page
*
*/
public function conversation_page($atts, $content = null)
{
$this->load_scripts();

$url_parts = add_query_arg( NULL, NULL );
$parts = (parse_url($url_parts, PHP_URL_QUERY));
parse_str($parts, $query_params);

if (is_user_logged_in()) {
ob_start();
if (isset($query_params['td_conversation_id'])) {
thrivedesk_view('shortcode/conversation-details');
} else {
thrivedesk_view('shortcode/conversations');
}

public function conversation_page($atts, $content = null)
{
$this->load_scripts();

$url_parts = add_query_arg(NULL, NULL);
$parts = parse_url($url_parts, PHP_URL_QUERY);

// Initialize query_params as an empty array
$query_params = [];

if ($parts !== null) {
parse_str($parts, $query_params);
}

if (is_user_logged_in()) {
ob_start();
if (isset($query_params['td_conversation_id'])) {
thrivedesk_view('shortcode/conversation-details');
} else {
thrivedesk_view('shortcode/conversations');
}

return ob_get_clean();
}
global $wp;
$redirect = home_url($wp->request);

return '<p>' . __('You must be logged in to view the ticket or conversation',
'thrivedesk') . '. Click <a class="text-blue-600" href="' . esc_url(wp_login_url
($redirect)) . '"> here</a> to login.
</p>';

return '<p>' . __('You must be logged in to view the ticket or conversation', 'thrivedesk') .
'. Click <a class="text-blue-600" href="' . esc_url(wp_login_url($redirect)) . '">here</a> to login.</p>';
}



/**
Expand Down

0 comments on commit 7dc1176

Please sign in to comment.