-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make ContactsStore a public API #6637
Conversation
@LEDfan, thanks for your PR! By analyzing the history of the files in this pull request, we identified @LukasReschke, @icewind1991 and @rullzer to be potential reviewers. |
@@ -52,5 +52,7 @@ function(GenericEvent $event) use ($app) { | |||
$user = \OC::$server->getUserSession()->getUser(); | |||
if (!is_null($user)) { | |||
$app->setupContactsProvider($cm, $user->getUID()); | |||
} else { | |||
$app->setupSystemContactsProvider($cm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is needed when there is no users, e.g on the CLI using the occ command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, just some minor documentation/code style issues
|
||
use OCP\IUser; | ||
|
||
interface IContactsStore { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing @since
annotations on both the interface and its methods
*/ | ||
public function findOne(IUser $user, $shareType, $shareWith); | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line missing
Codecov Report
@@ Coverage Diff @@
## master #6637 +/- ##
============================================
- Coverage 51.09% 51.09% -0.01%
- Complexity 24865 24867 +2
============================================
Files 1596 1596
Lines 94608 94622 +14
Branches 1367 1367
============================================
+ Hits 48340 48344 +4
- Misses 46268 46278 +10
|
@ChristophWurst done |
This is still tagged for NC 13, does this mean it will be merged before 13? I forgot about the featue-freeze to bump this in time... |
We plan to do the beta2 soon (at least middle of next week, looking at the other open PRs). I would like to have feedback from @rullzer or @ChristophWurst on this one here. |
And please fix the conflicts ;) |
8dbc639
to
3b2e916
Compare
@MorrisJobke I fixed the conflicts. |
@LEDfan Because you added a new PHP class could you dump the autoloader again:
|
lib/private/Server.php
Outdated
@@ -1109,6 +1110,15 @@ public function __construct($webRoot, \OC\Config $config) { | |||
$c->getConfig() | |||
); | |||
}); | |||
|
|||
$this->registerService(\OCP\Contacts\ContactsMenu\IContactsStore::class, function(Server $c) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Register it as alias with $this->registerAlias(\OCP\Contacts\ContactsMenu\IContactsStore::class, \OC\Contacts\ContactsMenu\ContactsStore);
and the DI container will resolve the constructor args automatically. This also prevents the contacts store being instantiated twice.
@MorrisJobke @ChristophWurst thanks, I updated the PR 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good
more conflicts @LEDfan |
9bb7f5b
to
adf7d11
Compare
Fixed the conflicts in the server container. Nothing crucial. |
Ah ... and conflicts again in the same file ... let me rebase a last time 🙈 |
Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
adf7d11
to
cecfc28
Compare
This makes the ContactsStore a public API which can be used by apps. As I described here: #5585 (comment) this is needed for e.g. the Chat app to know which users are allowed to Chat with other users.