Skip to content

Commit

Permalink
Merge branch 'master' of github.com:freescout-helpdesk/freescout
Browse files Browse the repository at this point in the history
  • Loading branch information
fulldecent committed Jul 6, 2021
2 parents a82e5d6 + 9c1ac14 commit c6be96a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

patreon: FreeScout
13 changes: 12 additions & 1 deletion app/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class Customer extends Model
*/
const SOCIAL_TYPE_TWITTER = 1;
const SOCIAL_TYPE_FACEBOOK = 2;
const SOCIAL_TYPE_TELEGRAM = 14;
const SOCIAL_TYPE_LINKEDIN = 3;
const SOCIAL_TYPE_ABOUTME = 4;
const SOCIAL_TYPE_GOOGLE = 5;
Expand All @@ -145,6 +146,7 @@ class Customer extends Model
public static $social_types = [
self::SOCIAL_TYPE_TWITTER => 'twitter',
self::SOCIAL_TYPE_FACEBOOK => 'facebook',
self::SOCIAL_TYPE_TELEGRAM => 'telegram',
self::SOCIAL_TYPE_LINKEDIN => 'linkedin',
self::SOCIAL_TYPE_ABOUTME => 'aboutme',
self::SOCIAL_TYPE_GOOGLE => 'google',
Expand All @@ -161,6 +163,7 @@ class Customer extends Model
public static $social_type_names = [
self::SOCIAL_TYPE_TWITTER => 'Twitter',
self::SOCIAL_TYPE_FACEBOOK => 'Facebook',
self::SOCIAL_TYPE_TELEGRAM => 'Telegram',
self::SOCIAL_TYPE_LINKEDIN => 'Linkedin',
self::SOCIAL_TYPE_ABOUTME => 'About.me',
self::SOCIAL_TYPE_GOOGLE => 'Google',
Expand Down Expand Up @@ -1269,7 +1272,15 @@ public static function formatSocialProfile($sp)
$sp['value_url'] = $sp['value'];

if (!preg_match("/^https?:\/\//i", $sp['value_url'])) {
$sp['value_url'] = 'http://'.$sp['value_url'];
switch ($sp['type']) {
case self::SOCIAL_TYPE_TELEGRAM:
$sp['value_url'] = 'https://t.me/'.$sp['value'];
break;

default:
$sp['value_url'] = 'http://'.$sp['value_url'];
break;
}
}
if (empty($sp['value_url'])) {
$sp['value_url'] = '';
Expand Down
9 changes: 7 additions & 2 deletions app/Http/Controllers/ConversationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,8 @@ public function ajax(Request $request)
}
break;

// Load attachments from all threads in conversation (when forwarding).
// Load attachments from all threads in conversation
// when forwarding or creating a new conversation.
case 'load_attachments':
$conversation = Conversation::find($request->conversation_id);
if (!$conversation) {
Expand All @@ -1356,7 +1357,11 @@ public function ajax(Request $request)
foreach ($conversation->threads as $thread) {
if ($thread->has_attachments) {
foreach ($thread->attachments as $attachment) {
$attachment_copy = $attachment->duplicate($thread->id);
if ($request->is_forwarding == 'true') {
$attachment_copy = $attachment->duplicate($thread->id);
} else {
$attachment_copy = $attachment;
}

$attachments[] = [
'id' => $attachment_copy->id,
Expand Down
14 changes: 10 additions & 4 deletions public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3697,7 +3697,7 @@ function forwardConversation(e)
showForwardForm({}, reply_block);

// Load attachments
loadAttachments();
loadAttachments(true);
}

// Follow / unfollow conversation
Expand Down Expand Up @@ -3730,15 +3730,21 @@ function followConversation(action)
);
}

// Load attachments for the draft of a new conversation of draft of the forward
function loadAttachments()
// Load attachments for the draft of a new conversation or draft of the forward
function loadAttachments(is_forwarding)
{
var attachments_container = $(".attachments-upload:first");
var conversation_id = getGlobalAttr('conversation_id');

if (typeof(is_forwarding) == "undefined") {
is_forwarding = false;
}

if (!attachments_container.hasClass('forward-attachments-loaded') && conversation_id) {
fsAjax({
action: 'load_attachments',
conversation_id: conversation_id
conversation_id: conversation_id,
is_forwarding: is_forwarding
},
laroute.route('conversations.ajax'),
function(response) {
Expand Down
4 changes: 2 additions & 2 deletions resources/views/mailboxes/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
@section('body_attrs')@parent data-folder_id="{{ $folder->id }}"@endsection

@if ($folder->active_count)
@section('title', '('.(int)$folder->getCount().') '.$folder->getTypeName())
@section('title', '('.(int)$folder->getCount().') '.$folder->getTypeName().' - '.$mailbox->name)
@else
@section('title', $folder->getTypeName())
@section('title', $folder->getTypeName().' - '.$mailbox->name)
@endif

@section('sidebar')
Expand Down

0 comments on commit c6be96a

Please sign in to comment.