You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/Command/Generate.php
+22-8Lines changed: 22 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,12 @@ protected function configure(): void {
78
78
'Long mesage to be sent to the user (max. 4000 characters)',
79
79
''
80
80
)
81
+
->addOption(
82
+
'dummy',
83
+
'd',
84
+
InputOption::VALUE_NONE,
85
+
'Create a full-flexed dummy notification for client debugging with actions and parameters (short-message will be casted to integer and is the number of actions (max 3))'
86
+
)
81
87
;
82
88
}
83
89
@@ -90,21 +96,29 @@ protected function execute(InputInterface $input, OutputInterface $output): int
90
96
$userId = $input->getArgument('user-id');
91
97
$subject = $input->getArgument('short-message');
92
98
$message = $input->getOption('long-message');
99
+
$dummy = $input->getOption('dummy');
93
100
94
101
$user = $this->userManager->get($userId);
95
102
if (!$userinstanceof IUser) {
96
103
$output->writeln('Unknown user');
97
104
return1;
98
105
}
99
106
100
-
if ($subject === '' || strlen($subject) > 255) {
101
-
$output->writeln('Too long or empty short-message');
102
-
return1;
103
-
}
107
+
if (!$dummy) {
108
+
if ($subject === '' || strlen($subject) > 255) {
109
+
$output->writeln('Too long or empty short-message');
if (strpos($path1, '/' . $notification->getUser() . '/files/') === 0) {
122
+
// Remove /user/files/...
123
+
[,,, $path1] = explode('/', $path1, 4);
124
+
}
125
+
$path2 = rtrim($file2->getPath(), '/');
126
+
if (strpos($path2, '/' . $notification->getUser() . '/files/') === 0) {
127
+
// Remove /user/files/...
128
+
[,,, $path2] = explode('/', $path2, 4);
129
+
}
130
+
131
+
$loremIpsum = 'User {actor} owns a file {item}';
132
+
$loremIpsumLong = 'Lorem {user-2} dolor sit {file-3}, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.' . "\n" . 'Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.';
0 commit comments