Skip to content

Commit

Permalink
Add updated matrix bot code
Browse files Browse the repository at this point in the history
  • Loading branch information
austinkregel committed May 8, 2024
1 parent 3f3de17 commit f676201
Show file tree
Hide file tree
Showing 14 changed files with 485 additions and 302 deletions.
3 changes: 2 additions & 1 deletion app/Http/Controllers/Spork/BankingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public function __invoke()
->accounts()
->with('credential')->get();

return Inertia::render('Finance/Index', [

return Inertia::render('Banking/Index', [
'title' => 'Banking ',
'accounts' => $accounts,
'transactions' => Transaction::whereIn('account_id', $accounts->pluck('account_id'))
Expand Down
1 change: 1 addition & 0 deletions app/Http/Middleware/HandleInertiaRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function share(Request $request): array
'navigation' => $navigation = (new ConditionService)->navigation(),
'current_navigation' => $navigation->where('current', true)->first(),
'conversations' => Thread::query()
->with('messages')
->orderByDesc('origin_server_ts')
->paginate(
request('conversation_limit'),
Expand Down
5 changes: 4 additions & 1 deletion app/Jobs/FetchResourcesFromCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public function __construct(
*/
public function handle(QueueingDispatcher $dispatcher)
{
$credentials = Credential::all();
$credentials = Credential::query()
// Matrix credentials are handled in their own way.
->where('service', '!=', 'matrix')
->get();

$jobs = $credentials->groupBy('user_id')
->map(fn (Collection $group) => $group->map(fn ($credential) => new FetchResourcesFromCredential($credential))->toArray())
Expand Down
20 changes: 10 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,16 @@ services:
condition: service_healthy
meilisearch:
condition: service_healthy
# matrix-bot:
# build:
# context: ./docker/matrix-bot
# dockerfile: Dockerfile
# volumes:
# - '.:/var/www/html'
# networks:
# - sail
# depends_on:
# - mariadb
matrix-bot:
build:
context: ./docker/matrix-bot
dockerfile: Dockerfile
volumes:
- '.:/var/www/html'
networks:
- sail
depends_on:
- mariadb
laravel.websocket:
image: austinkregel/reforged-websocket:latest
build:
Expand Down
2 changes: 1 addition & 1 deletion docker/matrix-bot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ RUN apt update && apt upgrade -y

RUN apt install -y git libolm-dev libjs-olm

CMD cd /var/www/html && npm i && npm upgrade @matrix-org/olm && node /var/www/html/docker/matrix-bot/index.cjs
CMD cd /var/www/html && npm i && npm upgrade @matrix-org/olm && node /var/www/html/docker/matrix-bot/index.js
Loading

0 comments on commit f676201

Please sign in to comment.