Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2019-11-26 16:55:26 +0300
committerArthur Schiwon <blizzz@arthur-schiwon.de>2019-12-13 18:04:50 +0300
commit8e042b537e5d1fdefe7ffa4985f8c49fab4f0bf5 (patch)
treea79c67e5c22f3e654b12072eb057d2e729aa45b5 /lib
parent34537dfcc448779a9ce0dd3fba027019eee67551 (diff)
catch Talk exceptions
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/Flow/Operation.php40
1 files changed, 16 insertions, 24 deletions
diff --git a/lib/Flow/Operation.php b/lib/Flow/Operation.php
index 582b8f968..c20825ab3 100644
--- a/lib/Flow/Operation.php
+++ b/lib/Flow/Operation.php
@@ -113,39 +113,31 @@ class Operation implements IOperation {
$this->validateOperationConfig($mode, $token);
}
- /**
- * Is being called by the workflow engine when an event was triggered that
- * is configured for this operation. An evaluation whether the event
- * qualifies for this operation to run has still to be done by the
- * implementor by calling the RuleMatchers getMatchingOperations method
- * and evaluating the results.
- *
- * If the implementor is an IComplexOperation, this method will not be
- * called automatically. It can be used or left as no-op by the implementor.
- *
- * @since 18.0.0
- */
public function onEvent(string $eventName, Event $event, IRuleMatcher $ruleMatcher): void {
$flows = $ruleMatcher->getMatchingOperations(self::class, false);
foreach ($flows as $flow) {
try {
list($mode, $token) = $this->parseOperationConfig($flow['operation']);
$this->validateOperationConfig($mode, $token);
+
+ $room = $this->getRoom($token);
+ $participant = $this->getParticipant($room);
+ $this->chatManager->sendMessage(
+ $room,
+ $participant,
+ 'bots',
+ $participant->getUser(),
+ $this->prepareMention($mode, $participant) . 'MESSAGE TODO',
+ new \DateTime(),
+ null
+ );
} catch(UnexpectedValueException $e) {
continue;
+ } catch (ParticipantNotFoundException $e) {
+ continue;
+ } catch (RoomNotFoundException $e) {
+ continue;
}
-
- $room = $this->getRoom($token);
- $participant = $this->getParticipant($room);
- $this->chatManager->sendMessage(
- $room,
- $participant,
- 'bots',
- $participant->getUser(),
- $this->prepareMention($mode, $participant) . 'MESSAGE TODO',
- new \DateTime(),
- null
- );
}
}