99
1010namespace OCA \Talk \OCP ;
1111
12+ use OCA \Talk \Config ;
1213use OCA \Talk \Manager ;
1314use OCA \Talk \Model \Attendee ;
1415use OCA \Talk \Participant ;
1516use OCA \Talk \Room ;
1617use OCA \Talk \Service \ParticipantService ;
1718use OCA \Talk \Service \RoomService ;
1819use OCP \IURLGenerator ;
20+ use OCP \IUserSession ;
1921use OCP \Talk \IConversation ;
2022use OCP \Talk \IConversationOptions ;
2123use OCP \Talk \ITalkBackend ;
@@ -27,6 +29,8 @@ public function __construct(
2729 protected ParticipantService $ participantService ,
2830 protected RoomService $ roomService ,
2931 protected IURLGenerator $ url ,
32+ protected IUserSession $ userSession ,
33+ protected Config $ config ,
3034 ) {
3135 }
3236
@@ -68,4 +72,23 @@ public function deleteConversation(string $id): void {
6872 $ room = $ this ->manager ->getRoomByToken ($ id );
6973 $ this ->roomService ->deleteRoom ($ room );
7074 }
75+
76+ #[\Override]
77+ public function isDisabledForUser (): bool {
78+ $ user = $ this ->userSession ->getUser ();
79+ if ($ user === null ) {
80+ return true ;
81+ }
82+ return $ this ->config ->isDisabledForUser ($ user );
83+ }
84+
85+ #[\Override]
86+ public function isNotAllowedToCreateConversations (): bool {
87+ $ user = $ this ->userSession ->getUser ();
88+ if ($ user === null ) {
89+ return true ;
90+ }
91+ return $ this ->config ->isNotAllowedToCreateConversations ($ user );
92+
93+ }
7194}
0 commit comments