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
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-04-19 21:32:48 +0300
committerGitHub <noreply@github.com>2022-04-19 21:32:48 +0300
commit8a757e140062a781e2e64ade2d75980261328782 (patch)
tree9e710320ea783d1060fc22254c37896dd075eec1
parentc330e4e9096f4bed79b3eba48e5dce0aa4049535 (diff)
parentf39321542f1ee91d314aea1ef4850f66c0fe1c0c (diff)
Merge pull request #7168 from nextcloud/backport/7130/stable24
[stable24] Remove event to delete shares when user leave of room
-rw-r--r--.drone.jsonnet2
-rw-r--r--.drone.yml54
-rw-r--r--lib/Share/RoomShareProvider.php22
-rw-r--r--tests/integration/features/sharing-2/hooks.feature40
4 files changed, 48 insertions, 70 deletions
diff --git a/.drone.jsonnet b/.drone.jsonnet
index 9b0730a83..ce5bef9fc 100644
--- a/.drone.jsonnet
+++ b/.drone.jsonnet
@@ -15,7 +15,7 @@ local Pipeline(test_set, database, services) = {
environment: {
APP_NAME: "spreed",
CORE_BRANCH: "stable24",
- GUESTS_BRANCH: "stable24",
+ GUESTS_BRANCH: "master",
NOTIFICATIONS_BRANCH: "stable24",
DATABASEHOST: database
},
diff --git a/.drone.yml b/.drone.yml
index 39c1e0bb3..2e0e8fee5 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -21,7 +21,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: sqlite
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-callapi
@@ -54,7 +54,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: sqlite
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-chat
@@ -87,7 +87,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: sqlite
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-command
@@ -121,7 +121,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: sqlite
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-conversation
@@ -155,7 +155,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: sqlite
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-conversation-2
@@ -188,7 +188,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: sqlite
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-federation
@@ -221,7 +221,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: sqlite
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-reaction
@@ -254,7 +254,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: sqlite
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-sharing
@@ -287,7 +287,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: sqlite
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-sharing-2
@@ -334,7 +334,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: mysql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-callapi
@@ -382,7 +382,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: mysql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-chat
@@ -430,7 +430,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: mysql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-command
@@ -479,7 +479,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: mysql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-conversation
@@ -528,7 +528,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: mysql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-conversation-2
@@ -576,7 +576,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: mysql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-federation
@@ -624,7 +624,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: mysql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-reaction
@@ -672,7 +672,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: mysql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-sharing
@@ -720,7 +720,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: mysql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-sharing-2
@@ -763,7 +763,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: pgsql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-callapi
@@ -805,7 +805,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: pgsql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-chat
@@ -847,7 +847,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: pgsql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-command
@@ -890,7 +890,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: pgsql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-conversation
@@ -933,7 +933,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: pgsql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-conversation-2
@@ -975,7 +975,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: pgsql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-federation
@@ -1017,7 +1017,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: pgsql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-reaction
@@ -1059,7 +1059,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: pgsql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-sharing
@@ -1101,7 +1101,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable24
DATABASEHOST: pgsql
- GUESTS_BRANCH: stable24
+ GUESTS_BRANCH: master
NOTIFICATIONS_BRANCH: stable24
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-sharing-2
diff --git a/lib/Share/RoomShareProvider.php b/lib/Share/RoomShareProvider.php
index 287477884..28dbfef15 100644
--- a/lib/Share/RoomShareProvider.php
+++ b/lib/Share/RoomShareProvider.php
@@ -29,8 +29,6 @@ declare(strict_types=1);
namespace OCA\Talk\Share;
use OC\Files\Cache\Cache;
-use OCA\Talk\Events\ParticipantEvent;
-use OCA\Talk\Events\RemoveUserEvent;
use OCA\Talk\Events\RoomEvent;
use OCA\Talk\Exceptions\ParticipantNotFoundException;
use OCA\Talk\Exceptions\RoomNotFoundException;
@@ -106,26 +104,6 @@ class RoomShareProvider implements IShareProvider {
}
public static function register(IEventDispatcher $dispatcher): void {
- $listener = static function (ParticipantEvent $event): void {
- $room = $event->getRoom();
-
- if ($event->getParticipant()->getAttendee()->getParticipantType() === Participant::USER_SELF_JOINED) {
- /** @var self $roomShareProvider */
- $roomShareProvider = \OC::$server->get(self::class);
- $roomShareProvider->deleteInRoom($room->getToken(), $event->getParticipant()->getAttendee()->getActorId());
- }
- };
- $dispatcher->addListener(Room::EVENT_AFTER_ROOM_DISCONNECT, $listener);
-
- $listener = static function (RemoveUserEvent $event): void {
- $room = $event->getRoom();
-
- /** @var self $roomShareProvider */
- $roomShareProvider = \OC::$server->get(self::class);
- $roomShareProvider->deleteInRoom($room->getToken(), $event->getUser()->getUID());
- };
- $dispatcher->addListener(Room::EVENT_AFTER_USER_REMOVE, $listener);
-
$listener = static function (RoomEvent $event): void {
$room = $event->getRoom();
diff --git a/tests/integration/features/sharing-2/hooks.feature b/tests/integration/features/sharing-2/hooks.feature
index 9bd9cbe15..08e490a5f 100644
--- a/tests/integration/features/sharing-2/hooks.feature
+++ b/tests/integration/features/sharing-2/hooks.feature
@@ -57,9 +57,9 @@ Feature: hooks
And user "participant2" shares "welcome.txt" with room "group room" with OCS 100
When user "participant1" removes "participant2" from room "group room" with 200 (v4)
Then user "participant1" gets last share
- And the OCS status code should be "404"
+ And the OCS status code should be "100"
And user "participant2" gets last share
- And the OCS status code should be "404"
+ And the OCS status code should be "100"
Scenario: remove herself from group room after sharing a file
Given user "participant1" creates room "group room" (v4)
@@ -69,9 +69,9 @@ Feature: hooks
And user "participant2" shares "welcome.txt" with room "group room" with OCS 100
When user "participant2" removes themselves from room "group room" with 200 (v4)
Then user "participant1" gets last share
- And the OCS status code should be "404"
+ And the OCS status code should be "100"
And user "participant2" gets last share
- And the OCS status code should be "404"
+ And the OCS status code should be "100"
Scenario: leave group room after sharing a file
Given user "participant1" creates room "group room" (v4)
@@ -145,9 +145,9 @@ Feature: hooks
And user "participant2" shares "welcome.txt" with room "public room" with OCS 100
When user "participant2" leaves room "public room" with 200 (v4)
Then user "participant1" gets last share
- And the OCS status code should be "404"
+ And the OCS status code should be "100"
And user "participant2" gets last share
- And the OCS status code should be "404"
+ And the OCS status code should be "100"
Scenario: remove sharer from group room with other shares after sharing a file
Given user "participant1" creates room "group room" (v4)
@@ -160,9 +160,9 @@ Feature: hooks
And user "participant2" shares "welcome.txt" with room "group room" with OCS 100
When user "participant1" removes "participant2" from room "group room" with 200 (v4)
Then user "participant1" gets last share
- And the OCS status code should be "404"
+ And the OCS status code should be "100"
And user "participant2" gets last share
- And the OCS status code should be "404"
+ And the OCS status code should be "100"
And user "participant1" gets all shares
And the list of returned shares has 1 shares
And share 0 is returned with
@@ -191,9 +191,9 @@ Feature: hooks
And user "participant3" accepts last share
When user "participant1" removes "participant2" from room "group room" with 200 (v4)
Then user "participant1" gets last share
- And the OCS status code should be "404"
+ And the OCS status code should be "100"
And user "participant1" gets all shares
- And the list of returned shares has 0 shares
+ And the list of returned shares has 1 shares
And user "participant2" gets last share
And share is returned with
| uid_owner | participant1 |
@@ -209,7 +209,7 @@ Feature: hooks
| share_with_displayname | participant3-displayname |
| share_type | 0 |
And user "participant2" gets all shares
- And the list of returned shares has 0 shares
+ And the list of returned shares has 1 shares
And user "participant3" gets last share
And share is returned with
| uid_owner | participant1 |
@@ -455,9 +455,9 @@ Feature: hooks
And user "participant2" removes "participant1" from room "group room" with 200 (v4)
When user "participant2" adds user "participant1" to room "group room" with 200 (v4)
Then user "participant1" gets all shares
- And the list of returned shares has 0 shares
+ And the list of returned shares has 1 shares
And user "participant2" gets all received shares
- And the list of returned shares has 0 shares
+ And the list of returned shares has 1 shares
Scenario: add sharer again to group room after sharing a file and the sharer removed herself from the room
Given user "participant2" creates room "group room" (v4)
@@ -468,9 +468,9 @@ Feature: hooks
And user "participant1" removes themselves from room "group room" with 200 (v4)
When user "participant2" adds user "participant1" to room "group room" with 200 (v4)
Then user "participant1" gets all shares
- And the list of returned shares has 0 shares
+ And the list of returned shares has 1 shares
And user "participant2" gets all received shares
- And the list of returned shares has 0 shares
+ And the list of returned shares has 1 shares
Scenario: join public room again after sharing a file and the sharer left the room
Given user "participant2" creates room "public room" (v4)
@@ -481,9 +481,9 @@ Feature: hooks
And user "participant1" leaves room "public room" with 200 (v4)
When user "participant1" joins room "public room" with 200 (v4)
Then user "participant1" gets all shares
- And the list of returned shares has 0 shares
+ And the list of returned shares has 1 shares
And user "participant2" gets all received shares
- And the list of returned shares has 0 shares
+ And the list of returned shares has 1 shares
@@ -498,9 +498,9 @@ Feature: hooks
And user "participant1" removes "participant2" from room "group room" with 200 (v4)
When user "participant1" adds user "participant2" to room "group room" with 200 (v4)
Then user "participant1" gets last share
- And the OCS status code should be "404"
+ And the OCS status code should be "100"
And user "participant1" gets all shares
- And the list of returned shares has 0 shares
+ And the list of returned shares has 1 shares
And user "participant2" gets last share
And share is returned with
| uid_owner | participant1 |
@@ -516,7 +516,7 @@ Feature: hooks
| share_with_displayname | participant3-displayname |
| share_type | 0 |
And user "participant2" gets all shares
- And the list of returned shares has 0 shares
+ And the list of returned shares has 1 shares
And user "participant3" gets last share
And share is returned with
| uid_owner | participant1 |