This repository has been archived by the owner on Jul 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(controllers): Fix methods visibility * fix(structure): Move routes file into Routes directory * fix(controllers): Add missing mandatory getChannels method * refactor(core): Improve de structure and flexibility * refactor(core): Improve dynamic building content * refactor(core): Use a single modal to handle notification subscription * refactor(core): Split configuration controller from notifications one * refactor(core): Reintroduce the subscribe state in table rendering * refactor(core): Drop deprecated stuff * Private subscription partially working * Apply fixes from StyleCI * Better read documentation * working private subscription and unsubscription * Include warlofs review findings. * Apply fixes from StyleCI * Use AbstractNotification class as name. * Private subscription (#1) * Private subscription partially working * Apply fixes from StyleCI * Better read documentation * working private subscription and unsubscription * Include warlofs review findings. * Apply fixes from StyleCI * Use AbstractNotification class as name. * refactor(core): Adapt namespaces * refactor(core): Include registration route to driver contract * refactor(core): Enforce return to be typed * refactor(views): Reduce blade verbosity * prep for migrations * migration file * New DB Structure with working private subscription * Apply fixes from StyleCI * fix(modal): Include notification title into the channel modal * docs(core): Add missing documentation block on controllers * refactor(core): Remove various vanilla stuff * refactor(core): Provide dynamic filters to subscription modal * style(core): Apply styleCI complaints * refactor(core): Add missing recipients seeding from filters * fix(core): Fix public subscription flow * fix(core): Fix public unsubscription flow * fix(core): Fix filter reset on modal hide * chore(manifest): Add Warlof as author * fix(subscription): Remove un-needed group_id check * docs(readme): Add UML Diagram in order to highlight architecture * Implementing `getPublicDriverId()`- and simplifying `isSubscribed()` - method * refactor(jobs): Move the notification dispatcher to new architecture Working discord notification * Apply fixes from StyleCI * style(refreshtoken): Move the name building inside callback * Fix RefreshTokenDispatcher and public subscription. * Apply fixes from StyleCI * refactor(drivers): Drop vanilla code related to private registration flow * Remove POC as name (#52) * this package is much more then a proof of concept. * UpdateOrCreate public subscription. * Externalize affiliation json build. return null if no filter is set. * use proper unsubscribe id * remove group_id, as it is not needed * change unsubscribe method to post * Update Copyright * Apply fixes from StyleCI * Slack driver implementation * Slack driver implementation * use proper variable as channel description * cleanup * Move session related affiliations to `BuildAffiliationJSONAction` * Introduce ImplementPrivateFlowException * fix typo * Introduce AbstractNotificationDriver and move getPublicDriverId into it. * update copyright * Apply fixes from StyleCI * Kill Mail Notification * working discord notification * Update Job to get recent killmails * SlackKillMailNotification * Styling * Apply fixes from StyleCI * Add caching to resolve_id function * Changelog + version bump * remove todo * Add Permission check to blades. * fix naming of color * Fix killmail dispatcher dispatching not only relevant subscribed notifications * fix private unsubscribe action. Before it unsubscribed every subscription not only the one selected * improve private subscription buttons and assure that the selected notification gets subscribed previously form id were not unique * Fix affiliation type for is_loss() * remove unused method * Fix routes * Feature/select affiliated filter (#66) * preselect affiliated filters in select field. * Apply fixes from StyleCI * improve loading placeholder * Update Readme for 2.x (#68) * Update Readme for 2.x * reduce mandatory methods * Update changelog * Apply fixes from StyleCI (#71)
- Loading branch information
1 parent
7fbfb5d
commit cf93781
Showing
76 changed files
with
3,349 additions
and
2,046 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,19 +10,24 @@ | |
"require": { | ||
"php": ">=7.1", | ||
"laravel/framework": "5.5.*", | ||
"eveseat/web": "~3.0.14", | ||
"eveseat/web": "~3.0.15", | ||
This comment has been minimized.
Sorry, something went wrong. |
||
"erusev/parsedown": "^1.7", | ||
"textalk/websocket": "1.0.*", | ||
"restcord/restcord": "^0.3", | ||
"php-http/curl-client": "^1.7", | ||
"jolicode/slack-php-api": "^1.0" | ||
"jolicode/slack-php-api": "^1.0", | ||
"ext-json": "*" | ||
}, | ||
|
||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Felix Huber", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Warlof Tutsimo", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"extra": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?php | ||
/** | ||
* MIT License. | ||
* | ||
* Copyright (c) 2019. Felix Huber | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
namespace Herpaderpaldent\Seat\SeatNotifications\Drivers; | ||
|
||
use Exception; | ||
use Herpaderpaldent\Seat\SeatNotifications\Models\NotificationRecipient; | ||
|
||
abstract class AbstractNotificationDriver implements INotificationDriver | ||
{ | ||
/** | ||
* Determine if a channel is supporting private notifications. | ||
* | ||
* @return bool | ||
*/ | ||
public static function allowPersonalNotifications(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
/** | ||
* Determine if a channel is supporting public notifications. | ||
* | ||
* @return bool | ||
*/ | ||
public static function allowPublicNotifications(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
/** | ||
* Return channel_id of user. | ||
* | ||
* @return string | ||
*/ | ||
public static function getPrivateChannel(): ?string | ||
{ | ||
return null; | ||
} | ||
|
||
/** | ||
* Return the route key which have to be used in a private notification registration flow. | ||
* | ||
* @return string | ||
*/ | ||
public static function getPrivateRegistrationRoute(): ?string | ||
{ | ||
return null; | ||
} | ||
|
||
/** | ||
* Return driver_id of public subscription. | ||
* | ||
* @param string $notification | ||
* | ||
* @return string | ||
*/ | ||
public static function getPublicDriverId(string $notification) : ?string | ||
{ | ||
try { | ||
|
||
// get driver | ||
$driver = key(array_filter(config('services.seat-notification-channel'), function ($value) { | ||
return $value == get_called_class(); | ||
})); | ||
|
||
return NotificationRecipient::where('driver', $driver) | ||
->where('group_id', null) | ||
->get() | ||
->map(function ($recipient) use ($notification) { | ||
return $recipient | ||
->subscriptions | ||
->filter(function ($subscription) use ($notification) { | ||
return $subscription->notification === $notification; | ||
}); | ||
}) | ||
->flatten()->first()->recipient->driver_id; | ||
} catch (Exception $e) { | ||
|
||
return null; | ||
} | ||
} | ||
} |
Oops, something went wrong.
It must be
~3
otherwise you'll lock the platform on which the plugin is installed :/At least
^3.0
.