Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable killmail processing #67

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tehraven
Copy link
Contributor

@tehraven tehraven commented Nov 27, 2021

Configurable Killmail Processing

New Configs

  • 'corporation_id' A Corp that is "us" in logic
  • 'alliance_id' An Alliance that is "us" in logic
  • 'process_kills' Whether or not to process "our" kills
  • 'process_losses' Whether or not to process "our" losses

New Behavior

  • If you specify a Corp and Alliance, the victim or one of the attackers must match the pair explicitly
  • If you specify only an Alliance, the victim or one of the attackers must be in that Alliance
  • If you specify only a Corp, the victim or one of the attackers must be in that Corp
  • Else, returns true (use current behavior downstream) - No breaking changes out of the box for people

@tehraven
Copy link
Contributor Author

tehraven commented Dec 4, 2021

Would love some 👀 on this one!

There are more tweaks I would love to have but this is a start.

Copy link
Member

@warlof warlof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filtering action have to be moved to routing rather than parsers.
except this, I wonder if it would not be better to move the new config part in settings instead.

it offer the benefits to be easier to update - and could be used for other features (some people would be able to grant sign-in to only a limited scope of character - ie: being part of the alliance)

*
* @package Seat\Notifications\Notifications
*/
class AbstractKillmailNotification extends AbstractNotification
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing abstract keyword if class is Abstract*

*/
protected function shouldProcessKillmail($notifiable) {

$killmailConfig = config('notifications.killmails');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep config for either static content or server configuration (ie: mysql, redis, menu etc...)

What about using settings instead ? We would create a new pane in SeAT Settings area where instance owner would be able to define corporations and alliances to which the instance is related.
Other features like limited sign-in could also benefits of such settings.

* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{

if (! parent::shouldProcessKillmail($notifiable)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be done in routing section (via) - not the parser (toX) - since a notification is already ready to be sent at this stage

* @return SlackMessage
*/
public function toSlack($notifiable)
{

if (! parent::shouldProcessKillmail($notifiable)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be done in routing section (via) - not the parser (toX) - since a notification is already ready to be sent at this stage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants