diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-11-27 19:23:17 +0300 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-12-13 18:04:51 +0300 |
commit | 6258d21c7a01df48d5e29453090d3fa544cac8a1 (patch) | |
tree | aa59fd4e7d8e80719d969ae1dd60b51706af76b0 /lib/Flow | |
parent | c49f7969bf2894f681f7cf87488e0117e256563a (diff) |
show a nice message, if the entity offers one
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/Flow')
-rw-r--r-- | lib/Flow/Operation.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Flow/Operation.php b/lib/Flow/Operation.php index 013f315ef..c43edb462 100644 --- a/lib/Flow/Operation.php +++ b/lib/Flow/Operation.php @@ -36,6 +36,7 @@ use OCP\IL10N; use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserSession; +use OCP\WorkflowEngine\EntityContext\IDisplayText; use OCP\WorkflowEngine\IManager as FlowManager; use OCP\WorkflowEngine\IOperation; use OCP\WorkflowEngine\IRuleMatcher; @@ -121,6 +122,15 @@ class Operation implements IOperation { $uid = $flow['scope_actor_id']; $this->validateOperationConfig($mode, $token, $uid); + $entity = $ruleMatcher->getEntity(); + + $message = $eventName; + if($entity instanceof IDisplayText) { + $message = $entity->getDisplayText(3); + if($message === '') { + continue; + } + } $room = $this->getRoom($token, $uid); $participant = $this->getParticipant($uid, $room); @@ -129,7 +139,7 @@ class Operation implements IOperation { $participant, 'bots', $participant->getUser(), - $this->prepareMention($mode, $participant) . 'MESSAGE TODO', + $this->prepareMention($mode, $participant) . $message, new \DateTime(), null ); |