Skip to content

Commit

Permalink
chore: mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 committed Sep 27, 2024
1 parent 25efcd5 commit ac29f65
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion extensions/messages/js/src/forum/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ app.initializers.add('flarum-messages', () => {

extend(HeaderSecondary.prototype, 'items', function (items) {
if (app.session.user?.attribute<boolean>('canSendAnyMessage')) {
items.add('flags', <DialogsDropdown state={app.dropdownDialogs} />, 15);
items.add('messages', <DialogsDropdown state={app.dropdownDialogs} />, 15);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@
use Flarum\Group\Group;

return Migration::addPermissions([
'startDialog' => Group::MEMBER_ID,
'dialog.sendMessage' => Group::MEMBER_ID,
]);
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function endpoints(): array

return $actor->can('sendMessage', $dialog);
} else {
return $actor->can('startDialog');
return $actor->can('sendAnyMessage');
}
}),
Endpoint\Index::make()
Expand Down Expand Up @@ -150,7 +150,7 @@ public function creating(object $model, OriginalContext $context): ?object
);

if (! $model->dialog_id) {
$context->getActor()->assertCan('startDialog');
$context->getActor()->assertCan('sendAnyMessage');

$users = array_filter(Arr::pluck($data['attributes']['users'] ?? [], 'id'), fn (mixed $id) => $id && $id != $model->user_id);

Expand Down

0 comments on commit ac29f65

Please sign in to comment.