diff --git a/appinfo/info.xml b/appinfo/info.xml
index e874f40..6416173 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -6,10 +6,10 @@
AGPL
Loic Blot
1.6.4
- 8
- 9.1
+ 8.1
+ 9.2
-
+
167289
diff --git a/appinfo/ocsmsapp.php b/appinfo/ocsmsapp.php
index b4d42cd..3a48c4c 100644
--- a/appinfo/ocsmsapp.php
+++ b/appinfo/ocsmsapp.php
@@ -37,43 +37,36 @@ class OcSmsApp extends App {
$this->c = $container;
$app = $this;
- /**
- * Core
- */
- $container->registerService('UserId', function($c) {
- return \OCP\User::getUser();
- });
-
/**
* Database Layer
*/
- $container->registerService('ConfigMapper', function ($c) use ($app) {
- return new ConfigMapper(
- $c->query('ServerContainer')->getDb(),
- $c->query('UserId'),
- $c->query('ServerContainer')->getCrypto()
- );
- });
+ $container->registerService('ConfigMapper', function (IContainer $c) use ($app) {
+ return new ConfigMapper(
+ $c->query('ServerContainer')->getDb(),
+ $c->query('CurrentUID'),
+ $c->query('ServerContainer')->getCrypto()
+ );
+ });
- $container->registerService('Sms', function($c) {
- return new Sms($c->query('ServerContainer')->getDb());
- });
+ $container->registerService('Sms', function(IContainer $c) {
+ return new Sms($c->query('ServerContainer')->getDb());
+ });
- $container->registerService('SmsMapper', function($c) {
- return new SmsMapper($c->query('ServerContainer')->getDb());
- });
+ $container->registerService('SmsMapper', function(IContainer $c) {
+ return new SmsMapper($c->query('ServerContainer')->getDb());
+ });
/**
* Managers
*/
- $container->registerService('ContactsManager', function($c) {
+ $container->registerService('ContactsManager', function(IContainer $c) {
return $c->getServer()->getContactsManager();
});
/**
* Controllers
*/
- $container->registerService('SettingsController', function($c) use($app) {
+ $container->registerService('SettingsController', function(IContainer $c) use($app) {
return new SettingsController(
$c->query('AppName'),
$c->query('Request'),
@@ -82,24 +75,25 @@ class OcSmsApp extends App {
);
});
- $container->registerService('SmsController', function($c) use($app) {
+ $container->registerService('SmsController', function(IContainer $c) use($app) {
+ $server = $c->query('ServerContainer');
return new SmsController(
$c->query('AppName'),
$c->query('Request'),
- $c->query('UserId'),
+ $c->query('CurrentUID'),
$c->query('SmsMapper'),
$c->query('ConfigMapper'),
- $c->query('ContactsManager'),
- $c->query('ServerContainer')->getURLGenerator(),
+ $server->getContactsManager(),
+ $server->getURLGenerator(),
$app
);
});
- $container->registerService('ApiController', function($c) use($app) {
+ $container->registerService('ApiController', function(IContainer $c) use($app) {
return new ApiController(
$c->query('AppName'),
$c->query('Request'),
- $c->query('UserId'),
+ $c->query('CurrentUID'),
$c->query('SmsMapper'),
$app
);
diff --git a/controller/smscontroller.php b/controller/smscontroller.php
index 4efad5e..0be4bbc 100644
--- a/controller/smscontroller.php
+++ b/controller/smscontroller.php
@@ -13,6 +13,7 @@ namespace OCA\OcSms\Controller;
use \OCP\IRequest;
+use \OCP\Contacts\IManager as IContactsManager;
use \OCP\AppFramework\Http\TemplateResponse;
use \OCP\AppFramework\Controller;
use \OCP\AppFramework\Http\JSONResponse;
@@ -35,7 +36,8 @@ class SmsController extends Controller {
private $urlGenerator;
private $contactCache;
- public function __construct ($appName, IRequest $request, $userId, SmsMapper $mapper, ConfigMapper $cfgMapper, $contactsManager, $urlGenerator, OcSmsApp $app){
+ public function __construct ($appName, IRequest $request, $userId, SmsMapper $mapper, ConfigMapper $cfgMapper,
+ IContactsManager $contactsManager, $urlGenerator, OcSmsApp $app) {
parent::__construct($appName, $request);
$this->app = $app;
$this->userId = $userId;
diff --git a/db/configmapper.php b/db/configmapper.php
index 0f89fe8..86c4a91 100644
--- a/db/configmapper.php
+++ b/db/configmapper.php
@@ -29,8 +29,8 @@ class ConfigMapper extends Mapper {
*/
private $crypto;
- public function __construct (IDb $api, $user, $crypto){
- parent::__construct($api, 'ocsms_config');
+ public function __construct (IDb $db, $user, $crypto){
+ parent::__construct($db, 'ocsms_config');
$this->user = $user;
$this->crypto = $crypto;
}
diff --git a/lib/contactcache.php b/lib/contactcache.php
index 409a674..354c031 100644
--- a/lib/contactcache.php
+++ b/lib/contactcache.php
@@ -12,7 +12,9 @@
namespace OCA\OcSms\Lib;
-use \OCP\Util;
+use \OCP\Contacts\IManager as IContactsManager;
+
+use \OCA\OcSms\Db\ConfigMapper;
class ContactCache {
/**
@@ -25,11 +27,11 @@ class ContactCache {
private $cfgMapper;
private $contactsManager;
- public function __construct ($cfgMapper, $contactsManager) {
- $contacts = array();
- $contactPhotos = array();
- $contactsInverted = array();
-
+ public function __construct (ConfigMapper $cfgMapper, IContactsManager $contactsManager) {
+ $this->contacts = array();
+ $this->contactPhotos = array();
+ $this->contactsInverted = array();
+
$this->cfgMapper = $cfgMapper;
$this->contactsManager = $contactsManager;
}