Override other classes with my app

This is my scenario: I have a webcam that uploads a photo every few minutes to my Nextcloud. All of these appear in my activity stream and make other stuff hard to find. So I wanted to filter the activities by the app which creates them. (More in this issue: https://github.com/nextcloud/activity/issues/44) Sadly this is not possible, but in the linked issue it was suggested to just exclude the webcam by ignoring the events linked to the folder where the pictures are uploaded to.

I actually already did that and added some code to \OCA\Activity\FilesHooks::fileCreate(). But instead of editing the original class I would prefer to have my own app that just “overrides” the original class and adds the additional code. I am already familiar with the TYPO3 XCLASS System (https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Xclasses/Index.html) which does this.

But I am pretty new to developing apps for Nextcloud and I didn’t find something similar in the official documentation. So my question is if there is any way how i can intervene in the fileCreate() method without editing code of the activity app?

TL;DR: you can’t override classes and that’s good

1 Like

Okay, i can understand that decision. Do you have any other suggestion how i could archive the same result? I don’t want to change the source code of the activity app, but i want to filter the activities shown in the stream.

Ask on the activity issue tracker about your usecase https://github.com/nextcloud/activity/issues