Skip to content

Commit

Permalink
Skip adding the language if is a byobu discussion (#1)
Browse files Browse the repository at this point in the history
* Skip adding the language if is a byobu discussion
  • Loading branch information
Ian Morland authored May 28, 2020
1 parent 1e57280 commit 703b3d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Listeners/AddDiscussionLanguage.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public function __construct(DiscussionValidator $validator)

public function handle(Saving $event)
{
// Check to see if we should skip adding the language if this is a private discussion created by fof/byobu
if (Arr::get($event->data, 'relationships.recipientUsers') || Arr::get($event->data, 'relationships.recipientGroups')) {
return;
}

$languageId = Arr::get($event->data, 'relationships.language.data.id');

if (!$event->discussion->exists || $languageId) {
Expand Down

0 comments on commit 703b3d5

Please sign in to comment.