summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2019-11-27 17:23:17 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2019-12-13 16:04:51 +0100
commit6258d21c7a01df48d5e29453090d3fa544cac8a1 (patch)
treeaa59fd4e7d8e80719d969ae1dd60b51706af76b0 /lib
parentc49f7969bf2894f681f7cf87488e0117e256563a (diff)
show a nice message, if the entity offers one
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/Flow/Operation.php12
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
);