Skip to content

Commit 6a27646

Browse files
Updated composer json
1 parent fcd94db commit 6a27646

File tree

5 files changed

+7
-33
lines changed

5 files changed

+7
-33
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"license": "MIT",
99
"require": {
1010
"flarum/core": "^1.2.0",
11-
"blomstra/database-queue": "^1.0.0",
1211
"google-gemini-php/client": "^1.0"
1312
},
1413
"authors": [

src/Agent.php

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ class Agent
1717

1818
public function __construct(
1919
public readonly User $user,
20-
protected ?Client $client = null,
21-
)
22-
{
20+
protected ?Client $client = null,
21+
) {
2322
}
2423

2524
// public function operational(): bool
@@ -41,31 +40,18 @@ public function repliesTo(Discussion $discussion): void
4140

4241
$respond = $response->text();
4342

44-
if (empty($respond)) return;
43+
if (empty($respond)) {
44+
return;
45+
}
4546

4647
$userPrompt = $this->user->id;
4748

48-
// if (Str::startsWith($respond, 'FLAG: ')) {
49-
// $flag = new Flag(
50-
// Str::after($respond, 'FLAG: '),
51-
// $discussion
52-
// );
53-
//
54-
// $flag();
55-
// } else {
56-
// $reply = new Reply(
57-
// reply: $respond,
58-
// shouldMention: $this->canMention,
59-
// inReplyTo: $discussion
60-
// );
61-
6249
CommentPost::reply(
6350
discussionId: $discussion->id,
6451
content: $respond,
6552
userId: $userPrompt,
6653
ipAddress: '127.0.0.1'
6754
)->save();
68-
// }
6955
}
7056

7157
}

src/BindingsProvider.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,5 @@ public function boot(Container $container)
1818
{
1919
Action::setEventDispatcher($this->container->make(Dispatcher::class));
2020
Action::setAgent($this->container->make(Agent::class));
21-
22-
// Factory::setAgent($this->container->make(Agent::class));
2321
}
2422
}

src/ClientProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ protected function getAgent(SettingsRepositoryInterface $settings, ExtensionMana
5252
client: $client,
5353
);
5454

55-
// $agent->toggleMentioning($extensions->isEnabled('flarum-mentions'));
5655

5756
return $agent;
5857
}

src/Listener/ReplyToPost.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ class ReplyToPost
1212
public function __construct(
1313
protected Agent $agent,
1414
protected Queue $queue
15-
)
16-
{
15+
) {
1716
}
1817

1918
/**
@@ -22,14 +21,7 @@ public function __construct(
2221
*/
2322
public function handle(Started $event): void
2423
{
25-
// if (!$this->agent->operational()
26-
// || $this->agent->is($event->discussion->user)
27-
// ) {
28-
// $this
29-
// return;
30-
// }
31-
// Add logic to handle the event here.
3224
// See https://docs.flarum.org/extend/backend-events.html for more information.
33-
$this->queue->push(new ReplyJob($event->discussion));
25+
$this->queue->push(new ReplyJob($event->discussion), null, 'flarum');
3426
}
3527
}

0 commit comments

Comments
 (0)